# Number of ways by which we can form a n digit number such that no two digit are same in the number?

Example : 2 digit number : so all two digit number except 11 22 33 44 55 66 77 88 99...this is simple but how to generalize for a number of n digit?(Also at each place any digit from 0 to 9 can come so 012 is perfectly valid.)

• 001 has two identical digits... if you are saying that it is valid, you need to clarify the statement of the problem. – Roger Burt Aug 2 '14 at 18:26
• I am sorry Roger...Edited :) – johri21 Aug 2 '14 at 18:29

It's simple, the first number has $10$ options, the second digit has $9$ options and so on. You just need to multiply those numbers.
After $10$ digit numbers all digits have ben used aleast once so there's no numbers matching with $11$ or more digits.
Here's a formula that gives the amount of numbers which have no equal digits for $n$ digit numbers
$$\prod_{k=0}^{n - 1} 10 - k=(10 - 0) \times (10 - 1) \times \cdots\times(10-(n-1))$$
Note that this formula equals $0$ for $n>10$, since if $n>10$ the expression $10-10=0$ appears in the numbers that are multiplied better