# Number of ways to write 5 digit number with restriction?

How many ways to write a 5 digit number so that every digit is scritctly greater than the digit on it's right ?

How could we derive a formula for such a N digit number where N <= 9 ?

-

This is the same as picking $5$ different digits out of the nine possible (I assume you don't want $0$ involved), and then ordering them afterwards. So $\binom{9}{5} = 126$. For $N$ digits the general answer is $\binom{9}{N} = \frac{9!}{N!(9-N!)}$.

-
we can't use 0 at first place as it will make a 4 digit number. 0 can be used anywhere else. –  Bharat Kul Ratan Oct 13 '12 at 12:27
If we want $0$, you'd have to change the $9$-s in my answer to $10$-s. If we pick $0$, it would have to be in the rightmost position anyways, as having the zero in any other position would make the rest of the digits impossible to place. So $0$ gets no special treatment, and the answer is $\binom{10}{5} = 252$ –  Arthur Oct 13 '12 at 12:56
thanks, got it. I don't know why I treated this as a tough problem :( –  Bharat Kul Ratan Oct 13 '12 at 13:43
It's a matter of perspective. The moment you start to tunnel in on the set of integers between $10\:000$ and $99\:999$, and try to classify and count the right ones, it becomes a hard problem. –  Arthur Oct 13 '12 at 13:49