LibraryInterview questions
Roll a fair six-sided die repeatedly and stop the first time a six comes up. Let be the number of rolls, so the last roll is always a six, and let be the sum of all rolls.
The rest of the question is for members
Check the shortcut against a second route that treats the final roll separately from the rest. Where the two routes disagree, ask what the stopping rule is allowed to look at.
Wald's identity is not "the average of a random-length sum is the product of the averages". It is that statement plus a condition on the length, and the condition is exactly what stops us peeking at the roll that ends the game.
You have the opening of the question, a hint and the idea. It checks the shortcut against a direct calculation, gives the expected total, and explains when the identity can and cannot be used.
The full question and its solution are part of Thuztra Learn membership, which is a paid subscription. Install the app to read them: