# What is the minimum number of balls to be extracted to be sure that we have at least 2 balls with the same color in the following case: The box contains 30 balls in total that are red, yellow, blue and green in color. It is known that 20 balls are not blue, 3 are green and 25 balls are not yellow.

The box contains balls of 4 colors such that there are 3 green balls; 20 balls that are not blue and 25 balls are not yellow.

For this problem we don't need to calculate the number of balls of each of the colors in the box or perform any other calculation.

The minimum number of balls that need to be picked to ensure that at least 2 balls have the same color can be derived by considering the fact that there are balls of 4 colors in the box. If 5 balls are picked and the first four have different colors the fifth is sure to have the color of one of the first four.

This gives the minimum number of balls that need to be picked to be sure that 2 of them have the same color as 5.

Approved by eNotes Editorial

To solve this problem, we apply the pigoenhole principle. Let each color represent a pigeon hole. We therefore have 4 holes, one for each color. By the pigeonhole principle, once we have drawn 5 balls, there will be at least two holes with the a ball of the same color.

To further clarify this:

Suppose the first ball extracted was red, the second yellow, the third blue, and the fourth green. Since we've now drawn all possible colors, no matter what color we extract next, we will have already extracted that color.

A minimum of 5 balls must be extracted to be sure we have extracted at least two balls with the same color.