You are viewing a single comment's thread. Return to all comments →
from collections import Counter r = "r" b = "b" urnX = [r,r,r,r,b,b,b] urnY = [r,r,r,r,r,b,b,b,b] urnZ = [r,r,r,r,b,b,b,b] drawn = [] total = 0 for i in urnX: for j in urnY: for k in urnZ: if r in Counter([i,j,k]).keys(): if (Counter([i,j,k])[r] == 2) and (Counter([i,j,k])[b] == 1): drawn.append([i,j,k]) total += 1 print("{}/{}".format(len(drawn),total))
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 →