This commit is contained in:
mhjensen
2020-11-02 16:26:03 +01:00
parent cbb7ca21cc
commit e9f83107f5
7 changed files with 62 additions and 6 deletions
+11
View File
@@ -55,6 +55,15 @@ The example here shows how we can implement the coin tossing case, clealry demos
!split
===== Simple Voting Example, head or tail =====
!bc pycod
# Common imports
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
plt.rcParams['axes.labelsize'] = 14
plt.rcParams['xtick.labelsize'] = 12
plt.rcParams['ytick.labelsize'] = 12
heads_proba = 0.51
coin_tosses = (np.random.rand(10000, 10) < heads_proba).astype(np.int32)
cumulative_heads_ratio = np.cumsum(coin_tosses, axis=0) / np.arange(1, 10001).reshape(-1, 1)
@@ -995,3 +1004,5 @@ plt.show()