Final answer:
Using the pigeonhole principle, you would need to buy a minimum of 9 packages to guarantee obtaining 3 matching Angry Birds figures.
Step-by-step explanation:
To guarantee getting 3 matching figures when picking from figures of red, blue, yellow, gray birds, and piggys, we can use the pigeonhole principle from mathematics. This principle states that if there are n pigeonholes and more than n pigeons, then at least one pigeonhole must contain more than one pigeon. Given that there are 5 types of figures, to ensure that we get 3 matching figures, we need to account for the possibility of getting a maximum of 2 of each type without getting a third matching one. Therefore, if we buy 2 each of the first 4 types (8 figures total) and then one more figure, we are guaranteed to get at least 3 figures of the same type. This is because the worst-case scenario would have us getting 2 reds, 2 blues, 2 yellows, 2 grays, and 1 piggy before getting a third matching figure. So the minimum number of packages needed to buy is 2(red) + 2(blue) + 2(yellow) + 2(gray) + 1 = 9 packages.