Post Reply 
Little math problem(s) February 2019
02-20-2019, 06:39 PM
Post: #7
RE: Little math problem(s) February 2019
Hi, pier4r

After the few best-of-n's, computations by calculator a bit too much.
This is the Python code that I used to build the winning percentages:

PHP Code:
from gmpy2 import comb as nCr

def win_percent
(coefsxr=0):
    for 
coef in coefscoef     # Horner's rule
    
return (100 * (1-x)**len(coefs),)   # scaled to percent

for n in range(1,25):                       # best-of-n
    
coefs = [ nCr(n-1+ii) for i in range(n-1,-1,-1) ]
    print 
n'\t',
    for 
p in [0.600.650.7]: print '%5.1f' win_percent(coefs1-p),
    print 

If I extend the range to best-of-41, winning precentages = 96.6, 99.7, 100.0
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 06:39 PM



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