# fact(n):= n! = n*(n-1)*...*2*1
def fact(n):
total = 1
while n >= 1:
total *= n
n -= 1
return total
#comb(n,m):= C(n,m) = fact(n)/(fact(m)*fact(n-m))
def comb(n,m):
return fact(n)/(fact(m)*fact(n-m))
#simply define a function f as f(n):= comb(n,n/2)/2**n for even n
def f(n):
return comb(n,n/2) / 2**n
print( f(200) ) # OverflowError: int too large to convert to float
print( comb(200,100) / 2**200 ) # 0.05634..., it works!