# Inclusion and exclusion

There is a total of 50 beans in a jar. The beans can be classified as tasty, sour, colorful. A bean may be in more than category, if there are 25 classified as tasty, 40 as sour and 10 as colorful, what is the maximum number of beans that could be tasty and sour and colorful?

-
Does every bean have to be either tasty, sour, or colorful? I assume yes, as otherwise, 10 is the obvious answer. –  Harald Hanche-Olsen Dec 14 '12 at 13:31
Your assumption is correct. –  fosho Dec 14 '12 at 13:33
add comment

## 1 Answer

Even with the clarification in the commentss, the answer is (trivially) 10. Here is how: Make 10 beans have all three properties. Of the remaining 40, we need to have 15 tasty and 30 sour ones. That is easily arranged: Make 10 just tasty, 25 just sour, and 5 both tasty and sour.

-
add comment