For three-set medal problems, first compute $S_2=\sum$ of pairwise intersections using inclusion-exclusion. Then subtract $3\times$ the "all three" count to get the number in exactly two categories.
Step 1: Notation and given data.
Let $D$ = Dance, $R$ = Dramatics, $M$ = Music.
$|D|=36,\ |R|=12,\ |M|=18,\ |D\cup R\cup M|=45,\ |D\cap R\cap M|=4$.
Step 2: Inclusion-exclusion to find the sum of pairwise intersections.
\[ |D\cup R\cup M| = |D|+|R|+|M| - \big(|D\cap R|+|D\cap M|+|R\cap M|\big) + |D\cap R\cap M|. \] Hence \[ 45 = 36+12+18 - S_2 + 4 \ \Rightarrow\ S_2 = 36+12+18+4-45 = 25, \] where $S_2=|D\cap R|+|D\cap M|+|R\cap M|$.
Step 3: Extract those in exactly two categories.
Every person in all three sets is counted three times inside $S_2$, while a person in exactly two sets is counted once.
Let $E_2$ be the number who received medals in exactly two categories. With $t=|D\cap R\cap M|=4$, \[ S_2 = E_2 + 3t \ \Rightarrow\ E_2 = S_2 - 3t = 25 - 12 = 13. \] \[ \boxed{13\ \text{persons}} \]
