In a competition of $45$ people, how many received medals in exactly two categories? Background
I've been learning the basics of set theory and this is a reference to Business Mathematics and Statistics
by Asim Kumar Manna, section 2.56:

In a competition, a school awarded medals in different categories. $36$
medals in dance, $12$ medals in dramatics and $18$ medals in music. If
these medals went to a total of $45$ people and only $4$ people got
medals in all the three categories, how many received medals in
exactly two of these categories?

My attempt

Let $A$ = set of persons who got medals in dance.
$B$ = set of persons who got medals in dramatics.
$C$ = set of persons who got medals in music.
Given,
$n(A) = 36$
$n(B) = 12$
$n(C) = 18$
$n(A \cup B \cup C) = 45$
$n(A \cap B \cap C) = 4$
We know that number of elements belonging to exactly two of the three sets $A, B, C$
$= n(A \cap B) + n(B \cap C) + n(A \cap C) - 3n(A \cap B \cap C)$
$= n(A \cap B) + n(B \cap C) + n(A \cap C) - 3 \times 4 \dots(i)$
$=n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(B \cap C) - n(A \cap C) + n(A \cap B \cap C)$
Therefore
$n(A \cap B) + n(B \cap C) + n(A \cap C) = n(A) + n(B) + n(C) + n(A \cap B \cap C) - n(A \cup B \cup C)$
From $(i)$ required number
$= n(A) + n(B) + n(C) + n(A\cap B \cap C) - n(A \cup B \cup C) - 12$
$= 36 + 12 + 18 + 4 - 45 - 12$
$= \boxed{13}$
13 medals received. Is there a better way go about this? Is this process succinct?
 A: In words

*

*There were $36+12+18 =66$ medals

*$45$ teams won at least one

*leaving $66-45=21$ extra medals

*of which $4\times(3-1)=8$ were extra medals for teams winning three matches

*leaving $21-8=13$ extra medals for teams winning two matches

*so there were $13$ teams winning exactly two matches

As equations, if $m_1$ teams won one medal, $m_2$ teams won two medals and $m_3$ teams won three medals then

*

*$m_1+m_2+m_3 = 45$

*$m_1+2m_2+3m_3=36+12+18$

*$m_3=4$
which are three linear equations in three unknowns, with the unique solution $m_1=28, m_2=13, m_3=4$ and the question asks for $m_2$
A: Your set analysis seems solid. There's a minor shortcut available since we know the total winning population is being overcounted by the category medal counts due to those who won multiple medals.
Given total medals of $36+12+18=66$, we know we could also express this total medal count as  $M_1 + 2M_2 + 3M_3 = 66$, where $M_i$ is the number of people who won $i$ medals.
Then we also know that the number of medal winners $M_1 + M_2 + M_3 = 45$,
So subtracting, $M_2+2M_3 = 21$ and of course $M_3 = 4$ giving the consistent result $M_2 = 13$
