Can you explain me this problem of combinatorics? Yesterday was my final test of Discrete Mathematics and the second question was:  
Wath is the cardinality of these sets:
a) Integers with 4 different digits and its digits increase, decrease and then increase again.
Eg. 1308 is valid
    1300 is not valid
    1320 is not valid  
b) Integers $4000\le n<7000$ even and all its digits are different.  
c) Positive integers $n<10000$ such that the sum of its digits is 15.  
Could you explain me this question?
 A: (a) is interestingly tricky. I would approach this by selecting the digits as a set and then choosing how many orders are valid, but there a quite a few cases no matter which way you attempt it.
I use the binomial coefficient $\binom nk$ (say "$n$ choose $k$") since this gives the number of ways to select an unordered set of $k$ items out of a pool of $n$. For the actual value, $\binom nk = \frac{n!}{(n-k)!k!}$ 


*

*$4$ different digits, none zero: $\binom 94$ options, $5$ arrangements/option

*$4$ different digits, one of which is zero: $\binom 93$ options, $3$ arrangements/option

*$2$ digits the same, $2$ other digits, none zero: $\binom 93$ options for numbers, $2$ choices for pair with $2$ arrangements/option, $1$ choice with only $1$ arrangement possible

*$2$ digits the same, $2$ other digits, one of which zero: $\binom 92$ options for numbers, $2$ choices for pair with $1$ arrangement/option

*$2$ pairs - $\binom 92$ options, $1$ arrangement/option


This gives $$5\binom 94 + 3\binom 93 + 5\binom 93 + 2\binom 92 +\binom 92 = 5\cdot 126 + 8\cdot 84 + 3\cdot 36 \\[3ex] = 630+672+108=1410$$
EDIT: except, whoops, the question specifies four different digits, so only the first two list items apply. This gives us:
$$5\binom 94 + 3\binom 93 = 5\cdot 126 + 3\cdot 84 = 630+252 = \fbox{882}$$
(b) is not as interesting, just different case for leading $5$ as opposed to $4$ or $6$, followed by choosing the trailing digits, followed by choosing the middle two digits.
(c) is a partition question with a little bit of inclusion-exclusion - find ordered partitions of 15 (using stars-and-bars), then exclude those where one of the parts is $10$ or more (by setting aside a "preload" of $10$ units for each digit zone in turn), giving $\binom {18}3 - 4\binom 83 = 592$
A: For (b), which is the easiest of the three problems:
Let the digits from left to right be $D(1),D(2),D(3),D(4).$
If each of the $3$ cases $D(4)=0$ or $D(4)=2$ or $D(4)=8,$ there are $3$ choices ($4,5$,or $6$) for $D(1)$. This gives $(3)(3)=9$ choices for the pair $(D(1),D(4)).$ For each  pair there are $8$ choices of $D(2)$.  There are 7 choices of $D(3)$ for each triplet $(D(1),D(2),D(4)).$ This gives $(9)(8)(7)=504$ values when $D(4)$ is $0,2$,or $8$.
In each of the $2$ cases $D(4)=4$ or $D(4)=6$ there are only $2$ choices for $D(1).$ (That is, $D(1)=5$ or $6$ when $D(4)=4$; and $D(1)=4$ or $5$ when $D(4)=6$). This gives $(2)(2)=4$ choices for the pair $(D(1),D(4)).$   There are $8$ choices of $D(2)$ for each pair $(D(1),D(4))$ and  7 choices of $D(3)$ for each triplet $(D(1),D(2),D(4)).$ This gives $(4)(8)(7)=224$ values when $D(4)$ is $4$ or $6.$
Altogether we have a total of $504+224=728$  values.
