Created
May 5, 2016 11:12
-
-
Save matsuken92/96ed94ca107d99cb81c91fa143cb3fda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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