21. You roll a fair 12 -sided die repeatedly. The probability that all the primes show up at least once before seeing any of the other numbers can be expressed as a fraction $p / q$ in lowest terms. What is $p+q$ ?
21. 793
There are 5 primes which are at most 12 - namely $2,3,5,7$ and 11 . Notice that if a number has already been seen, we can effectively ignore all future occurrences of the number. Thus, the desired probability is the fraction of the permutations of $(1,2, \ldots, 12)$ such that the primes all occur first. There are 5! ways to arrange the primes, and 7 ! ways to arrange the composites to satisfy the condition. Since there are 12 ! possible permutations, the desired probability is $\frac{5!7!}{12!}=\frac{1}{792}$, and the required sum is $1+792=793$