15 students in a given class had a sanwich for lunch on Monday. 12 had a sandwich for lunch on Tuesday, and 9 had a sandwich for lunch on Wednesday. If 22 students had a sandwich at least once during these three days, what is the maximum number of students who could have eaten a sandwich on all three days?
So I've tried using the PIE, but I had problems figuring out the number of students who had sandwiches on Monday and Tuesday, Tuesday and Wednesday, and Wednesday and Monday... Wouldn't they be 12, 9, and 9 respectively? But apparently it is a wrong way to think about it as the answer is not correct. How would I solve this?
To maximise the number of students who have eaten on all three days we will minimise the number of new people eating on every next day.
Monday: $15$ (new students)
Tuesday: $12$ (students in total) $=$ $x$ (new students) $+$ $n$ (students who have eaten on Monday)
Wednesday: $9$ (students in total) $=$ $22 - 15 - x$ (new students) $+$ $n$ (students who have eaten on both Monday and Tuesday)
$$\begin{cases} x + n = 12\\ 7 - x + n = 9 \end{cases} \implies \begin{cases} x + n = 12\\ - x + n = 2 \end{cases} \implies n = 7$$
Therefore the maximum number of students who could have eaten a sandwich on all three days is $\textbf{7}$.