

I added a description to OP.
Gambler (PROGRAM 1.3.8) is a simulation that can help answer these questions. It does a sequence of trials, using Math.random() to simulate the sequence of bets, continuing until the gambler is broke or the goal is reached, and keeping track of the number of wins and the number of bets.
This is amazing, thank you! You’ve given me a lot to think about, not just with respect to this program, but what sort of things to consider when analyzing the behavior of any program. Describing the classes of input like you did was enlightening.