Asking for a better way to count. 3 types of prizes (called X, Y, Z) are to be distributed among students A and B after one Exam.
Each student is eligible for all 3 types and both students can get the same prize at the same time.
Find the number of ways of the prize distribution if at least one prize of each type must be given away.
I can list out all 27 possible ways by noting that A(XYZ) + B(XYZ) is a case of [3 + 3] = 1, [3 + 1] = 6 , ... etc.
Since the result $27 = 3^3$, I suspect this question can be considered as the 3 types of prizes being collected by 3 students (A, B, and N, say). I just cannot relate the work done by N. For example, what is the role of N in the case A(XY) + B(YZ), etc? 
 A: Each prize can go to student $A$, to student $B$ or to both $A$ and $B$, that is $3$ ways. Hence for $n$ prizes we find $3^n$ possible distributions.
Bonus question: for $m$ students, how many prize distributions do we have?
A: While the other answers are more elegant, here's an another approach . . .

Let $k\;$be the number of prizes given to $A$.

For each fixed $k$, with $0\le k\le 3$, there are ${\large{\binom{3}{k}}}$ choices for the $k$ prizes given to $A$, and once the $k$ prizes for $A$ are chosen, $B$ must get the $3-k$ prizes not given to $A$, together with an arbitrary subset of the set of prizes given to $A$.

It follows that for each $k$, the number of possible distributions is ${\large{\binom{3}{k}}}\cdot 2^k$, so the total number of distributions is
$$
\sum_{k=0}^3 {\small{\binom{3}{k}}}\cdot 2^k
$$
which, by the Binomial Theorem, is just $(2+1)^3=27$.
A: Each of the three prizes may be given to A alone, or to B alone, or to both A and B; so there are three things that can happen to each of the three prizes. If you like, you can think of giving a prize to A, or to B, or to AB.
