Post Reply 
Little math problem(s) February 2019
02-20-2019, 10:55 PM
Post: #9
RE: Little math problem(s) February 2019
I tried best-of-21 simulation, the result match theoretical numbers well.

PHP Code:
from random import random

def simulation
(nbest_oftotal_win=0random=random):
    for 
t in xrange(n):
        
lst = [0,0]
        while 
max(lst) < best_oflst[random() >= 0.6] += 1
        
if lst[0] == best_oftotal_win += 1
    
return total_win 

for i in range(10): print simulation(10000, 21)
0.904
0.9069
0.9079
0.9043
0.9046
0.9042
0.8995
0.9003
0.9062
0.9037
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Little math problem(s) February 2019 - Albert Chan - 02-20-2019 10:55 PM



User(s) browsing this thread: 10 Guest(s)