In pulse-amplitude modulation (PAM), a PAM word consists of a sequence of pulses, where each pulse may take on a given number of amplitude levels. Suppose a PAM word is n pulses long and each pulse may take on m different levels.
(a) How many distinct PAM words are there?
(b) If each PAM word, 4 pulses long, is equally likely to occur and each pulse can have one of three levels, {0, 1, 2}, what is the probability of a PAM word occurring with exactly two pulses of level 2?