The problem I'm trying to solve:
Determine the number of integer solutions to the equation
$x_1 + x_2 + x_3 + x_4 = 7$, where $x_i \ge 0\,\,\,\forall i = 1,2,3,4$.
Solution using the formula mentioned in my text book:
$={n+r-1 \choose r},$ where $n=4,\,r=7;$
$={4+7-1 \choose 7} = {10 \choose 7} = \boldsymbol{120}$
Now everything was fine till here until, I checked for examples on Youtube and Google. The problem there, is that most of the problems are being solved using a different formula and weirdly it gives the same result. I'm completely confused and there's no mention of the below formula in my textbook
Solution using formula NOT mentioned in my text book:
$={n+r-1 \choose r-1}$ where $n=7,\,r=4;$
$={7+4-1 \choose 4-1} ={10 \choose 3}=\boldsymbol{120}$
My question to the Math community is:
What is this formula that is being used instead of my textbook version? Why are the values of n and r just being interchanged like that? Is there any correlation between the formula that I'm using and the one that's being used over the other mediums? Is the formula used over the other mediums correct?
As you said, one formula selects bars, the other rejects bars.
but why is it(r-1)
? that's the question. How does this1
come into the picture? I only know of(n-r)
Can somebody post an elaborated answer. It will be useful to many other students using the same textbook as mine. – Salvino D'sa Sep 25 '22 at 14:20