Skip to article frontmatterSkip to article content

Vjerojatnost

Šesterostrana kocka za bacanje

P(I)=16P(I) = \frac{1}{6}
import numpy as np
import matplotlib.pyplot as plt
bacanja = np.random.randint(1,7, size=10)
bacanjaPuno = np.random.randint(1,7, size=100000)
malo=np.histogram(bacanja, bins=np.arange(0.5,7.5))[0]
puno=np.histogram(bacanjaPuno, bins=np.arange(0.5,7.5))[0]
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8,3))
ax1.bar(np.arange(1,7),malo)
ax2.bar(np.arange(1,7),puno)
<BarContainer object of 6 artists>
<Figure size 800x300 with 2 Axes>