Skip to main content

Probability Riddle Using Python: Two Balls of the Same Color


In an urn there are black and white balls, 121 balls in all. The probability of drawing at random two balls of the same color equals 0.5. How many balls of each color are there?

Python Solution (due to simulation error, it got the almost correct answer):

Riddle source: