Determine the number of integral solutions of the equation \begin{align}
&\mbox{Let}\quad
x_{1} + x_{2} + x_{3} + x_{4} = 20\quad
\mbox{which satisfy:}\quad
\left\{\begin{array}{rcccl}
{\displaystyle 1} & {\displaystyle \leq} &  {\displaystyle x_{1}} & {\displaystyle \leq} & {\displaystyle  6}
\\
{\displaystyle 0} & {\displaystyle \leq} & {\displaystyle x_{2}} & {\displaystyle \leq} & {\displaystyle 5}
\\
{\displaystyle 4} &  {\displaystyle \leq} &  {\displaystyle x_{3}} &
{\displaystyle \leq} & {\displaystyle 9}
\\
{\displaystyle 2} & {\displaystyle \leq} &  {\displaystyle x_{4}} &  {\displaystyle \leq} &  {\displaystyle 7}
\end{array}\right.
\\
&\mbox{Determine the number of integral solutions.}
\\ &\mbox{}
\end{align}
I figured out that I could change each equation to some $y_{i}$ such that
$0 \leq y_{i} \leq 6$.

So I would have $y_{1} = x_{1}, y_{2} = x_{2} + 1, y_{3} = x_{3} - 3$ and $y_{4} = x_{4} - 1$.

This then gives me an equation where
$y_{1} + \cdots + y_{4} = 17$. 
From here, I do not know where to go. How do I figure out the number of integer solutions ?.
 A: The first step is to transform the bounds on your variables. The equivalent problem is to find the number of integer solutions for:
$z_1+z_2+z_3+z_4=17 \\ 1\leq z_1,z_2,z_3,z_4\leq 6$
Now let $y_i=7-z_i$, then an auxiliary problem is
$y_1+y_2+y_3+y_4=11 \\ 1\leq y_1,y_2,y_3,y_4\leq 6$
We can now start a stars-and-bars approach. We're going to be separating eleven stars using three bars. That's $_{10}C_3$. Now, we're going to subtract off the ways we can go outside of our bounds with any of the variables.
Suppose one of our variables is bigger than $6$. WLOG, let $y_1>6$. There are two valid cases, one when $y_1=7$ and one when $y_1=8$. We can't have $y_1$ be bigger than that, because $3$ units must be left over for the other variables.
When $y_1=7$, we count arrangements by applying the stars-and-bars approach to the remaining four units. That's $_3C_2$. When $y_1=8$, there's only going to be one valid arrangement for the other variables, $y_2=y_3=y_4=1$. That's a total of $_3C_2+1=3+1=4$ infringing  arrangements when $y_1>6$. Because our choice of infringing variable was arbitrary, we need to account for the other three variables, too. That's a total of $4\times4=16$ infringing arrangements. No two variables can be over six at the same time, so there's no double-counting.
The total number of valid solutions to this problem would then be $_{10}C_3-16=120-16=104$.
