Monte Carlo Simulation, Mathematical Modeling, Yahtzee.
close to the actual probability of this event, by calculating the average of the results. for exp in range(nbExp): # each exp is the simulation of 1 roll of dices for dice in range(nbDices): dices.append(np.random.randint(1, 7)) nbDifferentDices = len(set(dices)) if nbDifferentDices == 1: nbYahtzee