In how many ways can $25$ identical pens be distributed to four students with restrictions? Use combinatorics to count how many ways can 25 identical pens be distributed to four students so that each student gets at least three but no more than seven pens. 
What I have done so far is look like it make sense but it doesn't work out
I was thinking about view it as bit string of 0 and 1. 
I put 3 pens for each student first so I left with 13 pens(o's)
Now I try to distribute these 13 pens. And found out that there is 13 Choose 4 = 715 ways. But now when I'm trying to excluded the ways in which there is student who got more than 7 pens. I supposed to get 705 because (when I use the generating function method I got result 10, so if 715-705 = 10 this will be correct)but I can't find the way that this will work out.
 A: Add $3$ pencils to your $25$ pens.  Distribute the $28$ by giving each of the four people $7$ writing implements; this will result in them each getting no more than $7$ pens. The number of ways of doing this is the number of ways of distributing the pencils so everybody get at least $3$ pens, i.e. no more than $7-3=4$ pencils (not a problem as there only are $3$ pencils), which is ${3+4-1 \choose 4-1} ={6 \choose 3}= 20$. 
An alternative approach to your original problem is to use a generating function, so you are looking for the coefficient of $x^{25}$ in the expansion of $$(x^3+x^4+x^5+x^6+x^7)^4.$$
Your idea of distributing the minimum $3$ each to the four people is similar to taking out the factor of $x^3$ to give $x^{12}(1+x+x^2+x^3+x^4)^4$ or looking for  the coefficient of $x^{13}$ in the expansion of $$(1+x+x^2+x^3+x^4)^4.$$ You could work this out directly.  My pencil approach is similar to noting that by symmetry this is also the coefficient of $x^{4\times 4 - 13}=x^3$, which is easier to work with.
A: This is a typical example of string and gap method now we want to  distribute pens in a way $3<x<7$. The general solution is $(n+k-1)C(k-1)$, so putting three strings creates four gaps so number of ways are $(3+4-1)C(4-1)$ so ways are $6C3=20$. Hope this helps you.
