# Solving a combinatorics problem using stars and bars instead of complement method.

A question paper on mathematics consists of $12$ questions divided into $3$ parts, $A,B,C$, each containing $4$ questions. In how many ways can an examinee answer $5$ questions, selecting at least one from each part?

How do I solve it using stars and bars?

Using complement method, the answer is:

Total number of ways- Number of ways in which he doesn't select any question from any section

$\equiv \dbinom{12}{5}- 3 \times \dbinom{8}{5}$

• Does this not depend on how many questions are in each part? I would have thought $10+1+1$ might give a different answer to $4+4+4$ – Henry Jan 8 '18 at 19:31
• @Henry edited to add the number of questions in each part – Archer Jan 8 '18 at 19:53
• Is there a reason you think stars and bars is helpful here? – BallBoy Jan 8 '18 at 20:36
• You cannot use that technique here since the objects you are selecting are distinct. – N. F. Taussig Jan 8 '18 at 22:36

Your "complement method" produces the correct result ($624$) only by accident: You have deducted the papers where he only solved $A$-problems several times (but in fact there are none such). In a similar case with other figures you would have to set up an inclusion/exclusion process to handle the problem in this way.
Instead I propose the following: There are only two partitions of $5$ into $3$ nonempty parts, namely $3+1+1$ and $2+2+1$. The total number $N$ of admissible papers then is given by $$N=3\cdot{4\choose3}{4\choose1}{4\choose1}+3\cdot{4\choose2}{4\choose2}{4\choose1}=624\ .$$
• The complement method is actually correct, but only because there are no papers in which only $A$ problems are solved -- $A$ has $4$ problems, but the student solves $5$ problems – BallBoy Jan 8 '18 at 20:34