Advertisement
martin2250

CGdA_B4_1a

Jun 10th, 2016
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import itertools
  2.  
  3. def probability(wuerfel, zahl):  
  4.   prob = 0
  5.   for i in itertools.product(np.arange(1, 7), repeat=wuerfel):
  6.     if sum(i) == zahl:
  7.       prob += 1
  8.   return prob / 6**wuerfel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement