November 2018
Intermediate to advanced
360 pages
9h 36m
English
import randomimport matplotlib.pyplot as plt%matplotlib inline
num_sims = 100000num_ofs = 20num_hets_AA_AT = []for sim in range(num_sims): sim_hets = 0 for ofs in range(20): sim_hets += 1 if random.choice([0, 1]) == 1 else 0 num_hets_AA_AT.append(sim_hets) fig, ax = plt.subplots(1,1, figsize=(16,9))ax.hist(num_hets_AA_AT, bins=range(20))print(len([num_hets for num_hets in num_hets_AA_AT if num_hets==20]))
We get the following output: ...