Question: in python validate that the law of large numbers holds for coin flips and dice, which is the original context where Gerolamo Cardano discovered the

in python validate that the law of large numbers holds for coin flips and dice, which is the original context where Gerolamo Cardano discovered the law. Since the results of coin flips are not numeric, we will need to make some convention to encode heads and tails as numeric values. The traditional choice is HEADS => 1, TAILS => 0. We can then flip a fair coin ten times using scipy.stats (which we imported under the name stats): stats.binom(n=1, p=0.5).rvs(10) By a fair coin, we mean a coin with equal chance of landing heads or tails. Below, we will refer to the probability of a coin landing heads as the fairness of the coin. 1. Write a coin flipping function which flips any coin (may be unfair) a specified number of times. Your function signature should look like this: def flip_coin(n_flips, p=0.5)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!