Probability › Drawing from bags › Colour ratios

Color of the last ball

High school · ●●●○○ 50 pts

Milan has a bag of 2020 red balls and 2021 green balls. He repeatedly draws 2 balls out of the bag uniformly at random. If they are the same color, he changes them both to the opposite color and returns them to the bag. If they are different colors, he discards them. Eventually the bag has 1 ball left. Let pp be the probability that it is green. Compute ⌊2021p⌋\lfloor 2021 p \rfloor.

Sign in to save your progress.

invariantsmodular arithmeticfloor function