Question

A tuple, unlike a multiset, has an order: (1,2,1) is different than (1,1,2). Define the sum...

A tuple, unlike a multiset, has an order: (1,2,1) is different than (1,1,2). Define the sum of a tuple as the sum of all the elements in that tuple. For instance, the sum of (1,1,2) is 4. Using the elements of S, how many tuples of size 4 can be made that sum to 5? For example,(1,2,1,1), (2,0,0,3) and (0,3,0,2) are such tuples.

S = {0, 1, 2, 3, 4}

Homework Answers

Answer #1

total 52 tuple possible.

(4 1 0 0 ),(4 0 1 0),(4 0 0 1),(1 4 0 0 ),(0 4 1 0),(0 4 0 1),(1 0 4 0),(0 1 4 0),(0 0 4 1),(1 0 0 4),(0 1 0 4),(0 0 1 4)

(3 2 0 0) (3 0 2 0) (3 0 0 2) (2 3 0 0)(0 3 2 0) (0 3 0 2 ) (2 0 3 0) (0 2 3 0)(0 0 3 2) (2 0 0 3)(0 2 0 3)(0 0 2 3)

(2 2 1 0)(2 2 0 1)(2 1 2 0)(2 1 0 2)(2 0 1 2)(2 0 2 1)(1 2 2 0)(1 2 0 2)(1 0 2 2)(0 2 2 1)(0 2 1 2)(0 1 2 2)

(1 1 1 2)(1 1 2 1)(1 2 1 1 )(2 1 1 1)

(3 1 1 0)(3 1 0 1)(3 0 1 1)(1 3 0 1)(1 3 1 0)(0 3 1 1)(0 1 3 1)(1 0 3 1)(1 1 3 0)(0 1 1 3)(1 0 1 3)(1 1 0 3)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1-Create a week_tuple and assign the days of the week as strings to the week_tuple. b....
1-Create a week_tuple and assign the days of the week as strings to the week_tuple. b. Print out the elements in the week_tuple. 2-a. The following list has been declared as follows: credit_list = [24,3,15] b. Convert the credit_list to a tuple named credit_tuple. c. Print out the elements in the credit_tuple. 3-a. Write an initialize_list_values function that takes in a number for the number of elements in a list and an initial value for each element. The function creates...
Suppose that the set S has n elements and discuss the number of subsets of various...
Suppose that the set S has n elements and discuss the number of subsets of various sizes. (a) How many subsets of size 0 does S have? (b) How many subsets of size 1 does S have? (c) How many subsets of size 2 does S have? (d) How many subsets of size n does S have? (e) Clearly the total number of subsets of S must equal the sum of the number of subsets of size 0, of size...
2. Define a relation R on pairs of real numbers as follows: (a, b)R(c, d) iff...
2. Define a relation R on pairs of real numbers as follows: (a, b)R(c, d) iff either a < c or both a = c and b ≤ d. Is R a partial order? Why or why not? If R is a partial order, draw a diagram of some of its elements. 3. Define a relation R on integers as follows: mRn iff m + n is even. Is R a partial order? Why or why not? If R is...
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that...
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that stored floating point numbers between 0.6 to 2.5 in increment of 0.2. 1.2)What is the size of vector b? How is the size of ‘b’ stored? Define number of rows of ‘b’ in variable ’row’ and number of columns of “b” in variable “col”. 1.3)Define matrix “A” as a 10 by 10 matrix of all “1”s. 1.4)Update matrix “A” as following: set all the...
c) A function named tallied_data() that takes in a nested list (Use this on the data...
c) A function named tallied_data() that takes in a nested list (Use this on the data from part 1, but it should be able to be used to solve similar problems), indices for two columns and returns a tallied list. The inputs are: i) a nested list, ii) an index for the ‘reference column’/ ‘category’ (col_ref) iii) another index for the column to be tallied (col_tally) iv) this function returns a list of tuples where each element is a tuple...
Circular Permutations and Permutations with Similar Elements 1) In how many ways can three people be...
Circular Permutations and Permutations with Similar Elements 1) In how many ways can three people be made to sit at a round table? 2) In how many ways can three couples be seated at a round table, so that men and women sit alternately? 3) In how many ways can five keys be put on a key ring? 4) Find the number of different permutations of the letters of the word MATHEMATICS. 5) How many different ways can three pennies,...
A python question... In your class, many students are friends. Let’s assume that two students sharing...
A python question... In your class, many students are friends. Let’s assume that two students sharing a friend must be friends themselves; in other words, if students 0 and 1 are friends and students 1 and 2 are friends, then students 0 and 2 must be friends. Using this rule, we can partition the students into circles of friends. To do this, implement a function networks() that takes two input arguments. The first is the number n of students in...
2. There is a famous problem in computation called Subset Sum: Given a set S of...
2. There is a famous problem in computation called Subset Sum: Given a set S of n integers S = {a1, a2, a3, · · · , an} and a target value T, is it possible to find a subset of S that adds up to T? Consider the following example: S = {−17, −11, 22, 59} and the target is T = 65. (a) What are all the possible subsets I can make with S = {−17, −11, 22,...
A “superfecta” is correctly guessing the top four horses in order in a horse race. (a)...
A “superfecta” is correctly guessing the top four horses in order in a horse race. (a) If there are 8 horses in a race, how many different superfectas are possible? (b) “Boxing” a superfecta means that you get to choose the four horses for the superfecta without regard to order. How many box superfectas are possible? (c) If a bet on a superfecta costs 10 cents. How much would you expect for a box superfecta to cost? (Hint: Think about...
We are creating a new card game with a new deck. Unlike the normal deck that...
We are creating a new card game with a new deck. Unlike the normal deck that has 13 ranks (Ace through King) and 4 Suits (hearts, diamonds, spades, and clubs), our deck will be made up of the following. Each card will have: i) One rank from 1 to 15. ii) One of 5 different suits. Hence, there are 75 cards in the deck with 15 ranks for each of the 5 different suits, and none of the cards will...