import numpy as np n = 10000 # options 1, 10, 100, 1000, 10000 sample_space = np.array([ 1, 2, 3, 4, 5, 6]) event = 0 for k in range (0, n): dices = np.random.choice(sample_space, 2) if (np.sum(dices) == 8): event = event + 1 print('Sum 8 occured:', f'{event/n :.4f}', 'times')