3 ms·
- edit: To explain, why not 0.5? Because the probability of your opponent having drawn a smaller number than 0.5 after two attempts is <0.5 and the probability
by andreschuelein 10y ago
-
edit: To explain, why not 0.5? Because the probability of your opponent having drawn a smaller number than 0.5 after two attempts is <0.5 and the probability of a larger number is >0.5. A strategy of keeping >=0.5 after the first draw will loose against the optimal strategy on average.
- SonOfLilit 10y agoDefinitely not 67% of cases, more like 50% + epsilon: def round(): x = random.random() if x <= 0.66666: x = random.random() y = random.random() if y <= 0.5: y = random.random() return x >= y sum(round() for _ in xrange(10000000)) 5001450 sum(round() for _ in xrange(10000000)) 5004434 sum(round() for _ in xrange(10000000)) 5000238 I also ran a test of 0.6666 vs. 0.625, and... sorry to say, but 0.625 wins hands down.