Assume that a girl has written letters to four boyfriends and
has addressed four envelopes with their names. In haste she
places the letters into the envelopes in random order. Consider
the addressed envelopes to be in positions 1, 2, 3, 4, and let
the order of the letters placed into the envelopes be given by
a listing of the letters A, B, C, D. For example, ACBD means
that boy 2 gets the letter for 3 and boy 3, the letter for 2,
while the others receive the correct letters.
(a) How many listings are possible?
(b) Let X be a random variable giving the number of boys who
receive their letter. Find f(x), the probability function
for X.