Hint for hw06, expectation The average ("expected") number of rolls needed is the infinite sum: 1*(probability of 1 roll) + 2*(probability of 2 rolls) + 3*(probability of 3 rolls) + 4*(probability of 4 rolls) + ....

Let's write "P(R=3)" as shorthand for "probability of exactly 3 rolls". (In a probability class, we'd say that R is the random variable representing number-of-rolls-until-conclusive-result.)

Computing

1*P(R=1) + 2*P(R=2) + 3*P(R=3) + 4*P(R=4) + ...
is a bit difficult: if we didn't have the preceding factors of "2*, 3*, 4*", then we'd have a geometric sum, and a formula from high school.

The hint is, we'll replace "2*P[R=2]" with P(R=2)+P(R=2), and similarly the 3*P(R=3) with the sum of itself three times. This seems to make things messier, but the secret is to organize all the summands in a nice way.

If you thing that helps you, go for it! Otherwise you can continue the hint.