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...
a) sum = 0 for letter in '12345' : sum = sum + int(letter) print('sum =...
a) sum = 0 for letter in '12345' : sum = sum + int(letter) print('sum = ', sum) Write a program which reads a string containing any characters from the user and prints the sum of the digits in the string. For example, if the string from the user is "I want 3 oranges and 24 bananas', then the output would be 9, since 3 + 2 + 4 = 9. Note that a character C is a digit if...
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...
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...
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,...
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...
2. Let us define a new variable Y = the sum of two dice. Complete both...
2. Let us define a new variable Y = the sum of two dice. Complete both the probability and cumulative probability tables for Y. (Hint: First think about what values Y can take on, and then notice rolling a die produces 6 outcomes but rolling two dice produces 36 outcomes. The following table can help you enumerate all 36 outcomes and find out what is the associated Y value for each outcome.) 1 2 3 4 5 6 1 Y=2...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT