Combinatorics: Creating a Sum of 1's and 2's with Repetitions Allowed

In summary, the conversation discusses the problem of finding the number of ways to create a sum of k by adding either 1 or 2 with repetitions allowed. The conversation includes multiple attempts at solving the problem, such as re-writing the sequence and working out possible combinations. The final solution involves finding the number of ways to create a sum with a given number of 1's and 2's, and then determining the values of k and n.
  • #1
majestrooo
7
0

Homework Statement



In how many ways can we create the sum

k = x_1 + x_2 + ... + x_n

where each x_i is either 1 or 2 with repetitions allowed. n <= k <= 2n

For example

n = 4
k = 5

1+1+1+2
1+1+2+1
1+2+1+1
2+1+1+1

are four ways.

Homework Equations



Is this solving the number of multisets (bags) and ordering them?

The Attempt at a Solution



A few failed attempts :(
 
Physics news on Phys.org
  • #2
majestrooo said:
A few failed attempts :(
Let's see 'em!
 
  • #3
Avodyne said:
Let's see 'em!

Heh allright! Didn't thought they would be of any interest, since I didn't get any far.

Anyway I have tried to rewrite the the sequence k = x_1 + ... + x_n
in different forms.

only this one I felt was kind of near the solution...

a_i = x _i + i .

Which means I should try to find the number of sequences a_i.
But this yields an increasing sequence

2 <= a_1 <= a_2 <=. ... <= a_n <= 2 +n

< = > 0 <= a_1 <= a_2 <=. ... <= a_n <= n

since according to my lecturer, the numbers of above sequences are given by (n+k-1) over k. So that's why I tried to rewrite it like that. But I don't know where to go from there, or if that's really the right approach.

Is this attempt good enough? :)
 
  • #4
Try working out the possible combinations for x_1, then once you pick x_1, how many combinations do you have for x_2,...?

I'll use your example, for the first one you have two possibilities, 1 and 2 (3 would mean you can't have n=4). If x_1=1 then x_2+x_3+x_4=5-1=4, if x_1=2 then x_2+x_3+x_4=5-2=3. The first case gives 3 cases (you can make one of the x_2,x_3,x_4 = 2), the second gives one case. In total you have 4 ways of doing it.

Now try it for n and k.
 
  • #5
Focus said:
Try working out the possible combinations for x_1, then once you pick x_1, how many combinations do you have for x_2,...?

I'll use your example, for the first one you have two possibilities, 1 and 2 (3 would mean you can't have n=4). If x_1=1 then x_2+x_3+x_4=5-1=4, if x_1=2 then x_2+x_3+x_4=5-2=3. The first case gives 3 cases (you can make one of the x_2,x_3,x_4 = 2), the second gives one case. In total you have 4 ways of doing it.

Now try it for n and k.

But I don't know where to fit in n .

if
x1 = 1 then x2+x3+...+xn = k-1 (n-1 x left to choose)
OR
x1 = 2 then x2+x3+...+xn = k-2 (n-1 x left to choose)

The n-1 can be chosen in how many ways? Because the choice for x2 is as you said depending on if x1 = 1 or 2 and also the value of k (remember: n <= k <= 2n) . So how do I formalise that?

if x1 = 2

x2=1 then x3+...+xn = k-2-1
x2=2 then x3+...+xn = k-2-2
(n-2 x left to choose)

How do i choose the rest n-2 ??

etc

Help greatly appreciated:smile:
 
  • #6
Ok I've reached a formula by trial and error hehe :)

n over k-n .

But can anyone help me with answering my previous post?
 
  • #7
Suppose you were told that the sum consisted of [itex]n_1[/itex] 1's and [itex]n_2[/itex] 2's. Could you then answer the question of how many ways there are to create the sum?

Then, given [itex]n_1[/itex] and [itex]n_2[/itex], what are [itex]k[/itex] and [itex]n[/itex]?
 

FAQ: Combinatorics: Creating a Sum of 1's and 2's with Repetitions Allowed

What is combinatorics?

Combinatorics is a branch of mathematics that deals with the study of counting, arrangements, and combinations of objects without actually listing them out.

What is the purpose of creating a sum in combinatorics?

The purpose of creating a sum in combinatorics is to find the total number of possible outcomes or arrangements of a given set of objects or elements.

How do you create a sum in combinatorics?

To create a sum in combinatorics, you need to identify the number of objects or elements involved, and then use mathematical formulas such as combinations and permutations to calculate the total number of possible outcomes.

What are the different types of sums in combinatorics?

The different types of sums in combinatorics include combinations, permutations, and partitions. Combinations refer to the selection of objects without regard to their order, permutations refer to the selection of objects with regard to their order, and partitions refer to the division of objects into groups.

How is combinatorics used in real life?

Combinatorics is used in various fields, such as computer science, statistics, and engineering, to solve problems related to counting and arranging objects. It is also used in everyday life, for example, in calculating the number of possible outcomes in a game of cards or the number of ways to arrange a set of books on a shelf.

Similar threads

Replies
6
Views
1K
Replies
9
Views
721
Replies
9
Views
1K
Replies
5
Views
2K
Replies
4
Views
2K
Replies
1
Views
5K
Back
Top