Find the number of non negative integer solutions for x+y+z+b+c=8 x , y ,z ,b ,c > = 0
you may use stars and bars
i will try it out
stars and bars??
what are stars and bars
\[x+y+z+b+c=8\] you have \(5\) variables on left side and you want them add up to \(8\)
yeah
so you take \(8\) stars and \(5-1\) bars : \[\large \star \star| \star \star| \star|\star \star| \star \]
How on earth is this related to the original problem of fining number of nonnegative integer solutions to \(x+y+z+b+c = 8\) ?
yes
How do i know , i am asking the question
Here is the trick : the "number of stars" before the first bar is the value of \(x\), the "number of stars" between first bar and the second bar is the value of \(y\) etc..
for example : \[\large \star \star| \star \star| \star|\star \star| \star \] refers to the solution \(x=2\) \(y=2\) \(z=1\) \(b=2\) \(c=1\)
what is "x" and "y" and how do you divide them with bars ,
ok got it
but how do you divide themwith bars
lets do two more examples before working the final answer
we will see shortly, its easy :) find the solution corresponding to below stars and bars pattern : \[\large \star |\star| \star \star \star|\star \star| \star\]
fine..
x=1 , y=1 , z =3 , b= 2 , c=1
You got it ! ok last example : \[\large |\star \star| \star \star \star|\star \star| \star\]
x=0 y=2 z=3 b=2 c=1
Excellent! we're ready to solve the actual problem
cool
8+4 = 12 there are \(12\) places to choose from for the \(4\) bars. so the answer is simply : \[\large ^{12}C_4\]
we're done!
wait 1 min
the answer is correct let me think
sure feel free to ask if anything doesnt make sense.. this method won't be obvious for the first couple of times...
how 12 places
well i didn't read the website
number of places = (number of stars) + (number of bars)
I am reading thanks for help, will tag you if i don't understand
number of stars = 8 number of bars = 5-1
don't go to that website.. it can be confusing..
I see you get the general idea. Just work couple more example problems and im sure you will get hang of it..
yes
total places = Number of stars + Number of bars
Here is an example problem that you may try Find the number of nonnegative integer solutions of \(x+y+z = 5\)
7C2
it is correct right?
Yes! one more if you want : \[a+b+c+d+e+f = 1213123\]
As you can see it wont take much effort to answer the problem once you see how it works using stars and bars
now it seems easy peasy thank you
Find the number of integral sollutions ?
If that was the question then?
yes find the number of nonnegative integer solutions
and what about the negative sollutions?
as it is asked integral sollutions
there will be infinitely many integer solutions so nobody usually asks that question
consider below equation \[x-y = 1\] every pair of integers \((t+1, t)\) satisfy the above equation yes ?
conditions must be different on variables for finite sollutions to exist , it didn't strike me
yes if the linear equation \(ax+by = c\) has an integral solution, then it will have infinitely many integral solutions.
equations like these are called "linear diophantine equations"
Join our real-time social learning platform and learn together with your friends!