Answer: 26
==============================================================
Step-by-step explanation:
Let's say your first selection was red. If you have really good luck, you'll pick 7 more red and the answer would be 8. However, we need to consider the opposite side of the spectrum. We need to consider the worst possible scenario and having the worst luck ever. In this scenario, we don't match colors until the very last possible moment. If you pick red first, then you cannot pick red again until you've picked blue, yellow and black/white.
There are a few ways to consider the worst case scenario. One way is to form a table as shown below. See the attached image. Each row represents the colors "red, blue, yellow, black/white" in that exact order. This could be one way to select the items. For this row, we haven't selected a repeat color. Red is selected first. Each row repeats itself, although the black/white gets exhausted after 4 rows.
By the 7th row, we have 7 red, 7 blue and 7 yellow. We don't need a full 8th row to reach our goal. We can stop once we reach the highlighted cell I marked in the table. That cell represents picking the 8th red. You could replace that highlighted cell with "blue" or "yellow" and still achieve the goal because you'd get 8 of that color. I'm just picking on red since it's the first one listed.
If you count out the items, you should count out 33 total. Ignore the stuff after the highlighted cell in row 8.
We have a 7 by 3 rectangle that has 7*3 = 21 items. Then the highlighted cell bumps the count up to 21+1 = 22. Finally, the four black/white items are counted as well to get to 22+4 = 26 as the final answer
We need to make 26 selections to guarantee that we selected 8 of the same color. Again, this is because we're considering a scenario in which we get the worst luck ever and don't make any color matches until the last possible moment.