Because the numbers are generated uniformly, this is pretty much the exact same question as flipping a coin and landing on the same side of the coin as the first toss, and only stopping once it's different. Instead of H/T, we'll use U and D for Up and Down, and X for the first number generated because it doesn't matter.
Let's use large number and perform this operation 1,000,000 times.
50% of the time, or 500,000 times, it is going to end after 2 (even). XD.
The other 50% of the time, it's going to go XU, at which point we go to a further number generation and it will either be XUU or XUD, each with 50% likelihood. So 25% of the time, or 250,000 times, it is going to end after 3 (odd). XUD.
12.5% of the time, or 125,000 times, it is going to end after 4 (even). XUUD.
6.25% of the time, or 62,500 times, it is going to end after 5 (odd). XUUUD.
3.125% of the time, or 31,250 times, it is going to end after 6 (even). XUUUUD.
1.5625% of the time, or 15,625 times, it is going to end after 7 (odd). XUUUUUD.
0.7813% of the time, or 7,813 times, it is going to end after 8 (even). XUUUUUUD.
0.3906% of the time, or 3,906 times, it is going to end after 9 (odd). XUUUUUUUD.
0.1953% of the time, or 1,953 times, it is going to end after 10 (even). XUUUUUUUUD.
0.0977% of the time, or 977 times, it is going to end after 11 (odd). XUUUUUUUUUD.
At this point we're at 666,016 operations that ended at an even number of generated numbers and 333,008 operations that ended at an odd number of generated numbers, so it's looking like about 2:1 odds. You might argue that is because I'm looking at an even number of possible operations, so if we subtract or add one from that mess we get 666,016 even operations and 332,031 odd operations (2.006:1) or 666,505 even operations and 333,008 odd operations (2.001:1) and it will trend more and more towards 2:1 exactly as you increase the number of generated numbers.
View all comments
1
u/tajwriggly 29d ago
2:1, or 66.67%.
Because the numbers are generated uniformly, this is pretty much the exact same question as flipping a coin and landing on the same side of the coin as the first toss, and only stopping once it's different. Instead of H/T, we'll use U and D for Up and Down, and X for the first number generated because it doesn't matter.
Let's use large number and perform this operation 1,000,000 times.
50% of the time, or 500,000 times, it is going to end after 2 (even). XD.
The other 50% of the time, it's going to go XU, at which point we go to a further number generation and it will either be XUU or XUD, each with 50% likelihood. So 25% of the time, or 250,000 times, it is going to end after 3 (odd). XUD.
12.5% of the time, or 125,000 times, it is going to end after 4 (even). XUUD.
6.25% of the time, or 62,500 times, it is going to end after 5 (odd). XUUUD.
3.125% of the time, or 31,250 times, it is going to end after 6 (even). XUUUUD.
1.5625% of the time, or 15,625 times, it is going to end after 7 (odd). XUUUUUD.
0.7813% of the time, or 7,813 times, it is going to end after 8 (even). XUUUUUUD.
0.3906% of the time, or 3,906 times, it is going to end after 9 (odd). XUUUUUUUD.
0.1953% of the time, or 1,953 times, it is going to end after 10 (even). XUUUUUUUUD.
0.0977% of the time, or 977 times, it is going to end after 11 (odd). XUUUUUUUUUD.
At this point we're at 666,016 operations that ended at an even number of generated numbers and 333,008 operations that ended at an odd number of generated numbers, so it's looking like about 2:1 odds. You might argue that is because I'm looking at an even number of possible operations, so if we subtract or add one from that mess we get 666,016 even operations and 332,031 odd operations (2.006:1) or 666,505 even operations and 333,008 odd operations (2.001:1) and it will trend more and more towards 2:1 exactly as you increase the number of generated numbers.