How many 4-element subsets of a given set contain no consecutive integers 
How many 4-element subsets of the set S = {1,2,3...,10} contain no consecutive integers?

We went over a problem like this is class. The lecturer said the answer is the number of integer solutions to
$b_0 + b_1 + b_2 + b_3 + b_4 = 9$
Where for the choice $a_1, a_2, a_3, a_4$ $b_0 = a_1 - 1, b_{4} = 10 - a_4,  b_i = a_{i+1}-a_i, 1 \le i \le 3$  
The condition is then imposed that $b_0 \ge 0, b_4 \ge 0, b_1 \ge 2, b_2 \ge 2, b_3 \ge 2$
I understand that $b_1 \ge 2$ etc conditions are used to specify the next choice can't directly follow it, but I don't understand what $b_0$ is used for or even how the first equation was even found. The lecturer used a generating function produced from the above information to solve the problem. Could someone help clarify a few things, by explaining how the above equations are found and how they can be used in a generating function?
Thanks
 A: The idea is that you first choose $a_1$ and then $a_2-a_1$ which determines $a_2$ and then $a_3-a_2$ which determines $a_3$ and so on, and finally the difference to 10 to make sure that you stayed below 10.
Summing over the given definitions of your $b_i$, the equation is obviously true and also the inequalities are easily checked.
There are two issues with going to a generating function:

1) It is easier to solve the problem directly without generating functions or $b_i$.
You have 10 items and want to choose 4 which are non-consecutive. Add an 11th one at the end. Now, the task is the choice of four pairs of two consecutive items without overlap (because you take away the "forbidden" one after your choice as well). 
But this is the same thing as choosing four items freely from 7 objects because you can just add four additional objects after your four chosen ones.
So, you have $\displaystyle \binom 7 4$ choices.

2) For the generating function approach, it is not good that the $b$s have different lower bound, so it is a good idea to set $c_0=b_0$, $c_1=b_1-2$, $c_2=b_2-2$, $c_3=b_3-2$, $c_4=b_4$ before starting any calculation because this gives $c_0+c_1+c_2+c_3+c_4=3$ and $c_i \ge 0$.
But this is means that you just have to pick the coefficient of $x^3$ in the sum
$$\sum_{c_0\ge 0} \sum_{c1\ge 0}\sum_{c_2\ge 0}\sum_{c_3\ge 0}\sum_{c_4\ge 0} x^{c_0+c_1+c_2+c_3+c_4}= \left(\sum_{n\ge 0} x^n\right)^5 = (1-x)^{-5}.$$
This coefficent is $(-1)^3\binom{-5}{3}= \binom{7}{3}$.
