Maths Olympiad Prep

Track / Stage 5 / 334 of 400 #934 of 1964

Problem 934

AIME late
Combinatorics Difficulty 5.8 Find the answer

4. Masha has 1000 beads in 50 different colors, 20 beads of each color. What is the smallest nn such that for any way of making a necklace from all the beads, one can choose nn consecutive beads, among which there are beads of 25 different colors?

A number or a short expression. Spacing, $ signs and \frac vs / are all fine.

Official solution

Answer: n=462n=462.

First solution. Let's call a segment of the necklace of length mm a set of mm consecutive beads. If the beads in the necklace are arranged in groups of 20 of the same color, then a segment of length 461 cannot contain more than 24 different colors. Therefore, n462n \geqslant 462. Consider a segment of the necklace of length 462. Suppose that in this segment, 25 beads of different colors do not appear. Number the beads of the necklace counterclockwise so that the first beads are those of the chosen segment. Let mm be the number of the first bead of a color that is not present in the segment (say, yellow). We will show that the segment of the necklace from m461m-461 to mm contains 25 colors. Indeed, the yellow color is present in it. In the remaining part of the segment, the yellow color cannot appear by construction. But there are beads of at least 24 colors in it, since 461>2320461 > 23 \cdot 20.

Second solution. Let's call a segment of the necklace 462 consecutive beads. We will show that in some segment, there will be 25 different colors. Suppose the opposite. Then in any segment, there are no more than 24 different colors. Consider all possible pairs consisting of a segment of the necklace and some color present in it. In each segment, there are no more than 24 different colors, and the total number of segments of the necklace is 1000. Therefore, the number of pairs does not exceed 241000=2400024 \cdot 1000 = 24000. Now consider some specific color (say, blue). There are 20 blue beads in total, and between the farthest blue beads AA and BB, there are always at least 18 beads (exactly 18 only when all blue beads are consecutive). Thus, there are at least 19 segments containing BB and not containing AA. The bead AA itself is included in 462 segments. Therefore, blue beads are contained in at least 481 segments. These arguments are valid for any color. Therefore, the total number of pairs is at least 48150=24050>24000481 \cdot 50 = 24050 > 24000, which is impossible.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.