You are viewing a single comment's thread. Return to all comments →
from fractions import Fraction urns = [[4,3],[5,4],[4,4]] red = [] black = [] for lst in urns: red.append(Fraction(lst[0],sum(lst))) black.append(Fraction(lst[1],sum(lst))) doub = [] for i in range(len(red)-1): for j in range(i+1, len(red)): doub.append(red[i]*red[j]) final = [] for j in range(len(black)): final.append(doub[j]*black[len(black)-j-1]) print(sum(final))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Basic Probability Puzzles #3
You are viewing a single comment's thread. Return to all comments →