How many ordered quadruples of positive integers $\{a,b,c,d\}$ are there such that $a\leq b\leq c\leq d\leq 50$ and $a+b+c+d=100$? How many set of positive integers $\{a,b,c,d\}$ are there such that $ a\leq b\leq c\leq d\leq 50$ and $a+b+c+d=100$? 
I was thinking about using stars and bars, and it seems to work if there were only three variables:
If $a\leq b\leq c\leq 50$ and $a+b+c=100$, then we can define $x=50-a,y=50-b,z=50-c$ such that $x,y,z\leq 50$ and $x+y+z=3\times 50-(a+b+c)=50$. Then we can simply use stars and bars to find the number of triples of $\{x,y,z\}$, each of which corresponds to a unique $\{a,b,c\}$.
If $x\neq y,y\neq z$, and $z\neq x$, then only one out of the six sets consisting of $x,y,$ and $z$ is listed from the smallest to the largest. Since $50$ is not a multiple of $3$, $x=y=z$ is not possible. If two of the three elements are the same, then this element can be any integer between $1$ and $24$, inclusive. Since it can be either $x=y\neq z$, $x=z\neq y$, or $y=z\neq x$, each case appears three times. Thus, the total number of ordered triples $\{a,b,c\}$ is $\dfrac{C_{49}^2-24\times 3}{6}+24$.
However, when there's a fourth variable $d$, this method doesn't seem to work. Are there any other ways to circumvent it? Sorry for my poor English. 
 A: As far as I can tell, there are several theoretical ways to solve this, but all of them involve some sort of enumerating / recurrence / looping, and there is no closed form solution.  Since your problem is so small ($4$ numbers, max size $50$, total $100$), a simple quadruply-nested loop might take the least amount of total coding + running time.  In fact I just did it: it took $< 1$ minute to code and $< 1$ second to run, and the answer is $3789$, as @Semiclassical already pointed out using Mathematica.
Anyway, the exact form of your problem is a number partition with both restricted part size (max part size $=50$) and restricted number of parts (exactly $4$ parts).  This is described in this section of wikipedia.  The solution is given in terms of a recurrence with $3$ parameters - the total, the max part size, and the number of parts - so if you want to use that solution you'd still have to write the equivalent of a triple-loop.  Since you have only $4$ parts (variables), a brute-force quad-loop is easier.
Note that the wikipedia section quoted above answers the question for "at most $M$ parts" whereas you have "exactly $M$ parts".  However, you can transform between them by the change of variables $a' = a - 1, b' = b-1$ etc and allowing the $a', b', c', d'$ to be zero (hence at most $4$ parts, since zeros don't count as parts) and changing the sum to $96$ and the max part size to $49$.
A: My approach would be to list the values of a, b, c, and d, setting a, b, and c at their minimum value $1$, and d at its maximum value $50$.  I would decrement d by 1, and find that only c could be incremented by 1 to compensate.  Then would decrement d by 2 and find that either c or d could be incremented by 1 to compensate.  I would run through all such increment/decrement sets, keeping $a = 1$.  Then I would repeat, beginning with the first possible increment of $a$.
It's a tedious method, but after the first few cycles it establishes a pattern that could be represented as a series sum.
