How many four digit numbers are there such that its digits strictly ascending? How many four digit numbers are there such that its digits strictly ascending?
I got this problem from a combo and probability book, and I found that all numbers have to be $\le 6789$, but certain numbers like $6788$ don't work. How do you find how many numbers there are without going through tons of casework? I would also like a solution to the problem applied to a n-digit number.
 A: Let's choose 4 distinct numbers from the set of digits $\{1,2,3,4,5,6,7,8,9\}.$ (Note that $0$ cannot be included in this set.)
For each choice, there is a unique way by which we can relabel those 4 numbers so that they are in ascending order. (For example, if we chose the numbers $1, 2, 3,\text{ and } 8,$ then the only way we can have them in ascending order would be $1238$ and nothing else.) So we'd have $\binom{9}{4}$ 4-digit numbers whose digits are strictly increasing. Using this logic, it wouldn't be too hard to extend it to any n-digit number as long as $n<10.$
A: 1234 to 6789
6790-1234 = 5556
Now get all possibilities of 0 out of these numbers.
Then get rid of all number doubles, triples, quadruples.
In the balance get rid of smaller numbers in sequence....
Total 126 numbers are there.
PHP program to do it:
$a = Array();
for ($i = 1234; $i < 6790; $i++) {
    $num = str_split((string)$i);

    for ($j=0; $j < 3; $j++) {
  $flag=($num[$j] < $num[$j+1]);
  if (!$flag) break;
  if ($j == 3) $a[] = $i;
 }
 if ($flag) {
        echo $i . "<br>\n"; 
  $a[] = $i;
 }
}
echo count($a);

