You are viewing a single comment's thread. Return to all comments →
from fractions import Fraction x = ['w']*5 + ['b']*4 y = ['w']*7 + ['b']*6 def black_probability(x,y): return (Fraction(x.count('w') * y.count('b'), len(x) * (len(y)+1)) + Fraction(x.count('b') * (y.count('b')+1), len(x) * (len(y)+1))) print(black_probability(x,y))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 3: Basic Probability Puzzles #6
You are viewing a single comment's thread. Return to all comments →