Skip to content

Instantly share code, notes, and snippets.

@matsuken92
Created May 5, 2016 11:12
Show Gist options
  • Save matsuken92/96ed94ca107d99cb81c91fa143cb3fda to your computer and use it in GitHub Desktop.
Save matsuken92/96ed94ca107d99cb81c91fa143cb3fda to your computer and use it in GitHub Desktop.
trial_num = 10000
x = rd.multinomial(1, [1/6]*6, trial_num)
result = np.sum(x, axis=0)
data = np.array([result, np.array([1/6]*6)*trial_num]).T
# Draw graph
df = pd.DataFrame(data, columns=["trial","theory"],index=range(1,7))
ax = df.plot.bar()
ax.set_ylim(0,2000)
ax.legend(loc='best')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment