Using the principle of inclusions and exclusions count how many solutions to the equation $$ x + y + z = 12 $$ $$ 1 \le x \le 5$$ $$ -2 \le y \le 4$$ $$ 0 \le z \le 5 $$ $$ x,y,z \in \mathbb{Z}$$
1 Answers
Let $a = x - 1, b = y + 2, c = z$. Then our equation becomes $a+b+c=13 \ (\star)$ with constraints: $$\begin{align*} 0&\le a \le 4 \\ 0&\le b \le 6 \\ 0&\le c \le 5 \end{align*}$$
Let $U$ be the set of all nonnegative integer solutions of $(\star)$. This is $|U| = \binom{15}{2}.$
Let the following sets be subsets of $U$.
$$\begin{align*}
A &= \{s \in U : a > 4\} \\
B &= \{s \in U : b > 6\} \\
C &= \{s \in U : c > 5\}
\end{align*}$$
In other words, $A$ is the set of all solutions of $(\star)$ where $a > 4$, etc.
Since we wish to count the number of solutions of $(\star)$ and satisfy our constraints, then we want to find the size of $A^c \cap B^c \cap C^c.$
By the Inclusion-Exclusion principle, this is $$|A^c \cap B^c \cap C^c| = |U| - |A| - |B| - |C| + |A\cap B| + |B \cap C| + |A\cap C| -|A\cap B\cap C|. $$
We can count each one of the above sets. For example, since $A$ is the set of all solutions of $(\star)$ where $a>4$, we're guaranteed $a \ge 5$, so we just have to look at the number of nonnegative integer solutions of $a+b+c=8$, i.e. $|A| = \binom{10}{2}$.
Similarly $|B|$ is the number of solutions of $a+b+c=6$, i.e. $|B| = \binom{8}{2}$. And $|C|$ is the number of solutions of $a+b+c=7$, i.e. $|C| = \binom{9}{2}$.
Also $|A\cap B|$ is just the number of solutions where $a\ge 5$, and $b\ge 7$, so we just look at the number of solutions of $a+b+c=1$, i.e. $|A \cap B| = \binom{3}{2}$. Through similar reasoning, we can find the others. We arrive at
$$|A^c \cap B^c \cap C^c| = \binom{15}{2} - \binom{10}{2} - \binom{8}{2} - \binom{9}{2} + \binom{3}{2} + \binom{2}{2} + \binom{4}{2} - 0,$$
which turns out to be a measly $6$. So small it makes us mad! $$\begin{align*} 3+4+5=12 \\ 4+3+5=12 \\ 4+4+4=12 \\ 5+2+5=12 \\ 5+3+4=12 \\ 5+4+3=12 \\ \end{align*}$$

- 2,857
- 1
- 18
- 23