Could you please explain how to do this question? Thank you very much.

Gustav is an untidy man who keeps all his socks loose in his drawer. He has 6 pairs of white socks, 4 pairs of green socks and 5 pairs of black socks. What is the most number of socks Gustav will have to take out of his drawer to ensure he has a pair of socks of the same colour to wear?

He has 30 socks loose in the drawer. They are three different colors. If he takes four socks out of the drawer, at least two of them must be the same color.

To find the maximum number of socks Gustav will have to take out of his drawer to ensure he has a pair of socks of the same color to wear, we need to consider the worst-case scenario.

Here's how you can approach this problem:

1. Begin by assuming that Gustav picks socks randomly without paying attention to their color.
2. To maximize the number of socks he takes out, let's assume he starts by picking one sock from each color at a time.
- In the worst case, Gustav will pick one white sock, one green sock, and one black sock successively.
3. After these initial picks, Gustav will not have a pair of socks of any color yet. So, he needs to continue picking socks until he gets a matching pair.
4. In the worst case scenario, the next sock he picks will either be another white, green, or black sock.
- Let's assume it's another white sock.
5. Now, Gustav will have at least two pairs of white socks (since he initially had 6 pairs), but no matching pair yet.
6. The worst case continues until Gustav picks a green sock and a black sock, ensuring he has at least two pairs of each color.
7. Finally, the next sock he picks will guarantee a matching pair of the same color.
- Let's assume it's a white sock.

Now, let's count the socks Gustav needs to pick:
- 1 white sock
- 1 green sock
- 1 black sock
- 1 white sock
- 1 green sock
- 1 black sock
- 1 white sock (this guarantees a pair of white socks)

In total, Gustav needs to pick at least 7 socks to ensure he has a pair of socks of the same color to wear.

Therefore, the most number of socks Gustav will have to take out of his drawer is 7.