How many solutions does $x_1+x_2+x_3 = 11$ have if $0\le x_1 \le 3$, $0\le x_2 \le 4$, and $0\le x_3 \le 6$

combinatoricsdiscrete mathematicsinclusion-exclusion

How many solutions does $x_1+x_2+x_3 = 11$ have if $0\le x_1 \le 3$, $0\le x_2 \le 4$, and $0\le x_3 \le 6$?

I tried to do it with method 2 but there is a problem;

\begin{align*}
x_1+x_2+x_3 = 11\tag{1}\\ x_1\ge4, x_2\ge5, x_3\ge7
\end{align*}

then combining equation 1 and 2;
\begin{align*}
y_1 = x_1-4, y_2=x_2-5,y_3=x_3-7\tag{2}\\y_1+4+y_2+5+y_3+7 = 11\\y_1+y_2+y_3=-4\tag{3}
\end{align*}

how can I manage this problem in equation 3?

Best Answer

I'll edit these equations tomorrow if needed. I need to study a bit more to exam lol..

$S_0 = N = \binom{11+3-1}{3-1} = \binom{13}{2}=78\tag{0}$

Equation (0) is Total Number of Solutions

$N(C_1) = y_1+4+y_2+y_3 = 11 => y_1+y_2+y_3 = 7 => \binom{7 + 3 -1}{3-1} = \binom{9}{2} = 36 \tag{1}$

$N(C_2) = y_1+y_2+5+y_3 = 11 => y_1+y_2+y_3 = 6 => \binom{6 + 3 -1}{3-1} = \binom{8}{2} = 28 \tag{2}$

$N(C_3) = y_1+y_2+y_3+7 = 11 => y_1+y_2+y_3 = 4 => \binom{4 + 3 -1}{3-1} = \binom{6}{2} = 15 \tag{3}$

$S_1 = Equation(1)+Equation(2)+Equation(3) = 79$

Equation(1) is Total Number of Solutions with restriction $x_1\ge4$

$N(C_1C_2) = y_1+4+y_2+5+y_3 = 11 => y_1+y_2+y_3 = 2 => \binom{2 + 3 -1}{3-1} = \binom{4}{2} = 6 \tag{4}$

$N(C_1C_3) = y_1+4+y_2+y_3+7 = 11 => y_1+y_2+y_3 = 0 => \binom{0 + 3 -1}{3-1} = \binom{2}{2} = 1 \tag{5}$

$N(C_2C_3) = y_1+y_2+5+y_3+7 = 11 => y_1+y_2+y_3 = -1\tag{6}$

$S_2 = Equation(4)+Equation(5)+Equation(6) = 7$

Equation(4) is Total Number of Solutions with restriction $x_1\ge4 \cup x_2 \ge5$

At Equation(6) $y_1+y_2+y_3=-1$ means there is no solution for this spesific case.

So finally; $N(\overline C_1\overline C_2\overline C_3) = S_0-S_1+S_2 => 78-79+7 = 6$ total solutions with these restrictions.

I believe that is correct.