There are 7 questions. Each question has the choices a,b,c,d. One possible exam would answer all A's, another all B's, etc correct. So we want to construct all possible ways one could answer on the exam.
we do this by first representing each question as a set: {a,b,c,d}. We can then use the cartesian product to construct ALL possible ways of completing the test (the cartesian product is really powerful):
{a,b,c,d} x {a,b,c,d} x {a,b,c,d} x {a,b,c,d} x {a,b,c,d} x {a,b,c,d} x {a,b,c,d} = {a,b,c,d}7
The cardinality of |{a,b,c,d}7| is |{a,b,c,d}|7 which is 47. Simplifying 47 we have 16384 answer keys or in another words, 16384 different ways of
doing the exam.