A first coin (coin #1) that has a probability p of coming up heads is tossed n times. When the first coin (coin #1) comes up heads another coin (coin #2) that has a probability r of coming up heads is tossed. Let Z be the random variable giving the number of times the second biased coin (coin #2) comes up heads.
What is the probability mass function of Z? What is the mean and variance of Z?