You are viewing a single comment's thread. Return to all comments →
dice_1 = [1, 2, 3, 4, 5, 6] dice_2 = dice_1.copy() diff_and_sum_to_6 = 0 all_outcomes = 0 for v1 in dice_1: for v2 in dice_2: all_outcomes += 1 if (v1 != v2) and (v1 + v2 == 6): diff_and_sum_to_6 += 1 prob_diff_and_sum_to_6 = diff_and_sum_to_6 / all_outcomes print(prob_diff_and_sum_to_6)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: More Dice
You are viewing a single comment's thread. Return to all comments →