Stars 'n' bars Theorem Problem. 1. A bagel shop has 8 kinds of bagels. How many ways to buy a dozen bagels? 2. A bagel shop has 8 kinds of bagels. How many ways to buy a dozen bagels, with at most 4 onion and at most 2 poppy seed?
do you know Combinations and Permutations
12C1 +12C2 +12C3+...12C8
Oh, are you sure? I know the answer for both problems, I'm just looking for the methods. The first solution should have k=4;n=8 .
are these your answers 50388 and 35846?
Let me run it through Wolfram Alpha, I just have the combinatoric form.
Unfortunately, no to the first one. I have 11C4, which is 165. For the second, it was correct!
35846 is correct but 50388 is not?
Honestly, perhaps I'm concluding the wrong answer for the first question, we didn't complete the problem to its entirety. I just have k =4; n=8, which in the stars n bars theorem is just (10 choose 8). Perhaps it meant something else.
We just wrote that 8 bagels were determined, so the question boiled down to x1+x2...+x8=4
shouldn't you have \[{8-1+12\choose 8-1}\] or \[{8-1+12\choose 12}\]
if you are using stars and bars
My understanding that it's a little different with a lower and upper bound. I don't understand the concepts yet to agree nor disagree with what you wrote.
you have 8 different bagels ||||||| the bars make 8 possible locations or bagels 1||||||| |2|||||| ||3||||| |||4|||| ||||5||| |||||6|| ||||||7| |||||||8
let xxxxxxxxxxxx be the bagels
you want to arrange |||||||xxxxxxxxxxxx
the above is an example of all 12 bagels of the same kind (the 8th kind of bagel)
the number of ways to arrange it is \[{7+12\choose 7}={8-1+12\choose 8-1}\]
anyway...the number of ways to do problem 1 has to be larger than the number of was to do #2
since we are putting on a restriction
Ah! Okay!
You're correct, I wrote my response referring a different question. I agree with what you wrote!
so you know how to get the 35846
?
I know how to get the first answer. For the second, would we use the inclusion - exclusion principle?
yes
All Solutions - solutions with x> 4 - solutions with y> 2 + intersection where (x> 4 and y> 2)? How do I find all solutions?
that is it we already did...\[{8-1+12\choose 8-1}=50388 \]
That's obvious. I don't even know why I asked that question. I got it from here , you're the bomb. Thanks so much.
no problem
Join our real-time social learning platform and learn together with your friends!