I’m trying to calculate an appropriate timeout time for a real time simulator that I’m writing:
For p = probability of success, the time for a successful request = m, and the time for a failed attempt = f. What is the average time for 5 successful requests?
Let’s call the total number of tries x.
The total time would be
or
If m=1, f=2, and p=0.1, the answer should be 5 * 1 + 45 * 2 = 95. This checks out.
There might be errors in here, but I did my best.