If x , y , z , a , and b are non-negative integers, how many distinct 5-tuples ( x , y , z , a , b ) that satisfy x + y + z + a + b = 1 5 exist?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
how and why? please explain
Log in to reply
See Stars and bars .
It is a formula. Given the equation:
x 1 + x 2 + … + x n = r
There are ( r n + r − 1 ) different ways for the sum to be satisfied.
Log in to reply
Provided that x 1 , x 2 , . . . x n ≥ 0 . And yes, nothing more special in it, it is just found by assuming that we have r balls which we have to 'distribute' in n boxes. And the no. of ways for the same is given by that formula which can be found easily.
thanks for clarification.
Solved with nested for loops:
1 2 3 4 5 6 7 8 9 |
|
Here's a slightly shorter solution:
1 2 3 4 5 6 |
|
Problem Loading...
Note Loading...
Set Loading...
Total ways = 1 5 + 5 − 1 C 5 − 1 = 1 9 C 4 = 3 8 7 6