The Gateway to Computer Science Excellence
+1 vote
174 views
How many solutions are there to the equation: $X_1+X_2+X_3+X_4+X_5=21$ ?

If $0 \leq X1 \leq 3 , 1 \leq X2 < 4 , X3 \geq 15$
in Combinatory by Junior (765 points)
edited by | 174 views
0
What about the constraints on $X_4$ and $X_5$?
0
519??
0
X4,X5>=0
0
answer = 116 ?

1 Answer

+3 votes
OK          

( use  star and bar technique  number of solution to  x1 + x2 +  x3 + ....  xN  =   S   =    C(   S +  N - 1  , N - 1  )      where  xi >= 0 )

First   convert x3 >= 15 ,  into x3 >= 0

then x1 + x2 + x3  + x4 + x5  =  21 - 15  =  6

x1 + x2 + x3 + x4 + x5   =   6  where   0 <= x1 <= 3 ,   1 <= x2 <= 3 ,   x3 >= 0 , x4 >= 0 , x5 >= 0

now x3 , x4 , x5 have no constraint on upper bound , we have to focus only on x1 and x2

x1 and x2 have 12 pairs : ( 0 , 1 ) ( 0 , 2 ) ( 0 , 3 ) ( 1 , 1 ) ( 1 , 2 ) ( 1 , 3 ) ( 2 , 1 ) ( 2 , 2 ) ( 2  , 3 ) ( 3 , 1 ) ( 3 ,2 ) ( 3 , 3 )

Min sum they can make is 1 and maximum is 6    

Now for each sum find the number of ways they make sum S  and multiply the number of ways x3,x4,x5 make sum (6 -  S)  where 1 <= S <= 6

numeber of ways for x1 and x2 for sum = 1 , 2 , 3 , 4 , 5 , 6   =  (   1 , 2 , 3 ,  3 , 2 , 1 )

final result  =  1 * (  x3 + x4 + x5 = 6 - 1 )  +  2 *  (  x3 + x4 + x5 = 6 - 2 ) +  3 * (  x3 + x4 + x5 = 6 - 3 ) + 3 * (  x3 + x4 + x5 = 6 - 4 ) + 2 * (  x3 + x4 + x5 = 6 - 5 )  +  1 * (  x3 + x4 + x5 = 6 - 6 )

= 1 * C ( 5 + 3 - 1 , 3 - 1 )  + 2 * C ( 4 + 3 - 1 , 3 - 1 )  + 3 * C(3 + 3 - 1 , 3 - 1 )  + 3 * C ( 2 + 3 - 1 , 3  - 1  )  + 2 * C ( 1 + 3 - 1 , 3 - 1 ) +  1 * ( 0 + 3 - 1 , 3 - 1 )

= 1 * 21 +  2 * 15 +  3 * 10 + 3 * 6 +  2 * 3 + 1 * 1 =  21 + 30 + 30 + 18 + 6 + 1 =  106.
by Active (3k points)
0
It's correct. But, I think you should use laTex to make it properly readable.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,316 answers
198,359 comments
105,087 users