A Permutation Combination question I had in an exam on 28 June.

Discrete Math

As the exam was a CBT I don't have picture of it but I do remember the questions (not the options tho :/)

Q. You have 30 candies. The candies are distributed among 4 identical children C1, C2, C3 and C4, where C1 gets atleast 4 and atmost 7 candies, C2 gets atleast 2 and atmost 6 candies. How many ways can the candies be distributed?

Posted Jul 1, 2022, 5:16 AM UTC

16
Badcomposerwannabe•

I take it C3 and C4 needs to get at least one candy each?

If C1 gets x candies, C2 gets y, C3 gets z, and C4 gets w, then x+y+z+w=30.

Let x’=x-4,y’=y-2,z’=z-1,w’=w-1. Then the number of non negative solutions to

Case 1: x’+y’+z’+w’=22 is the number of ways the candies can be distributed according to the “least number” conditions on C1 and C2.

Case 2: Replace x’ by x”=x-8, then x”+y’+z’+w’=19 gives the number of distributions where C1 must get more than 7 candies.

Case 3: Replacing y’ by y”=y-7 while retaining x’=x-4 gives the similar “C2 gets too many candies” case, where x’+y”+z’+w’=17.

Case 4: x”+y”+z’+w’= 13 gives the case where both C1 and C2 gets too many candies.

Th total number of ways of distributing the candies according to all the restrictions would be

(Case 1) - (Case 2) - (Case 3) + (Case 4)

2
DistortGamingOP•

It wasn't specified that C3 and C4 get atleast one, I have no idea of what the answer or options are so can't confirm on that basis too :/

Also, Why do we add Case 4? Shouldn't it be subtracted from Case 1 too?

2
Badcomposerwannabe•

If C3 and C4 can get zero candies, we may replace back z’ and w’ by z and w respectively.

The reason case 4 was added is because it would be both contained in case 3 as well as case 2, so it’s subtracted twice. For instance in Case 2, there wasn’t an extra upper bound on how many candies C2 can get, so C2 might get more than 6 candies in some of the distributions in case 2.

2
DistortGamingOP•

Ok so we solve with w and z instead of their minimum one case

And, gotcha so it is similar to AnB = A + B - AuB

Thanks for the help, due to time restraint i wasn't able to solve it and it kept bugging me.

1
DistortGamingOP•

From what I had thought, I thought we can make it an AND argument for C1 ^ (C2,C3,CR)

So the equation i got was

26C1(24C3-19C3) + 25C1(23C3-18C3) + 24C1(22C3-17C3) + 23C1(21C3-16C3)

The logic behind the term in parentheses was that first term (n-2)C3 was it was for case atleast 2 and second term was for all cases where she would get atleast 7 thus excluding the cases not matching the requirements.

1
Uli_Minati:upvote: Helpful Responder•

4 identical children C1, C2, C3 and C4

"Let's try to be as unrealistic as possible"

1