radhika108 wrote:there are six flavors of ice cream: banana, chocolate, lemon, strawberry and vanilla and pistachio. You can have three scoops. How many variations will there be?. It has been worked out as(r+n-1)!/r!(n-1)! Can somebody explain the working for this. thanks in advance.
This is problem of selecting items from a set where the order does not matter and at the same time repetition is allowed.
n=6, r=3
Here we know that we have to select 3 flavors. But how many options do we have for selection? Is it 6? NO. B'cos repetition is allowed.
Imagine, you are at an ice-cream counter and you can take 3 scoops from 6 flavors available. Note that having selected a flavor you can still stand there and select it again b'cos repetition is allowed. You always move from left to right and once you say No (N) to one flavor, you move on to next flavor.
So, the counter from left to right is like (banana, chocolate, lemon, strawberry, vanilla, pistachio)
Let say one selects (banana, vanilla, pistachio): that is YNNNNYNY where Y corresponds to selecting a flavor and N corresponds to not selecting a flavor.
Lets say one selects (banana, lemon, vanilla): that is YNNYNNYN
Lets say one selects (banana, chocolate, lemon): that is YNYNYNNN
Let's say one selects (banana, banana, banana): that is YYYNNNNN
Note that once you are done with 3 scoops, you can't say NO to that same flavor anymore b'cos no one is asking you to take more

You have to just move ahead saying NO politely to the remaining options
So, we have to say yes 3 times and No 5 times. That is we have 8 options. That is 6+3-1.
So, the answer is (r+n-1)C(r) = 56 ways.
Further: n=6,r=3
If order matters and repetition allowed
6*6*6= 6^3 = 216 ways
If order matters and repetition not allowed
6P3 = 6!/3! =120 ways
If order does not matter and repetition not allowed
6C3= 6!/(3!*3!) = 20 ways
HTH!!