Expected index given by
E [X] = \sum_{i \in [2,100)} p(X < i)\prod_{j < i}p (X \ge j)i.
Edit: Sorry rest of reply was wrong. Had to account for not hitting until i^th loop.
E [X] = \sum_{i \in [2,100)} p(X < i)\prod_{j < i}p (X \ge j)i.
Edit: Sorry rest of reply was wrong. Had to account for not hitting until i^th loop.
1/99 * sum([(i-1)*i for i in range(2, 100)]) # 3266.666666666667
Both the median and mean are around 12 for 10K runs of the loop.edit - actually, the calculations from the other guy are probability calculations, so this is related to the median. I have given you a mean calculation, which should be related to the average. But you already mentioned that they are close ...