SOLUTION: Let A be the set of four-digit numbers A1,A2,A3,A4 where A1>A2>A3>A4,Then how many of A are possible?

Algebra ->  Permutations -> SOLUTION: Let A be the set of four-digit numbers A1,A2,A3,A4 where A1>A2>A3>A4,Then how many of A are possible?      Log On


   



Question 1135742: Let A be the set of four-digit numbers A1,A2,A3,A4 where A1>A2>A3>A4,Then how many of A are possible?
Found 2 solutions by math_helper, greenestamps:
Answer by math_helper(2461) About Me  (Show Source):
You can put this solution on YOUR website!

NOTE: To solve this, I got on a train of thought and followed it, but it is likely more optimal solutions exist.

Looking at two-digit numbers A1>A2:

A1 A2
9 --- 8,7,...,0 --> 9 numbers in all
8 8 numbers in all (A2 can be 7,6,...,0)
7 7
...
1 1
-----
9+8+...+1 = 9*10/2 = 45 two-digit numbers with A1>A2

I then extended this to three digit numbers A1>A2>A3:
A1 A2
9 8 (which contributes 8 numbers, from the two-digit example)
9 7 (which contributes 7 numbers, again from the two-digit example)
9,A2,A3 has 8+7+6+...+1 = 8*9/2 = 36 numbers where A1>A2>A3
8,A2,A3 has 7+6+...+1 = 7*8/2 = 28 numbers
7,A2,A3 has 6*7/2 = 21
6,A2,A3 has 5*6/2 = 15
5,A2,A3 has 4*5/2 = 10
4,A2,A3 has 3*4/2 = 6
3,A2,A3 has 2*3/2 = 3
2,A2,A3 has 1*2/2 = 1
36+28+21+15+10+6+3+1 = 120 total three-digit numbers with A1>A2>A3

Now finally four-digit numbers:
9,A2,A3,A4 has 28+21+15+10+6+3+1 = 84 total numbers
(this comes from {three-digit cases for 8,A3,A4} + {three-digit cases for 7,A3,A4} +...+ {three-digit cases for 2,A3,A4})

8,A2,A3,A4 has 21+15+10+6+3+1 = 56 total numbers
7,A2,A3,A4 has 15+10+6+3+1 = 35 total numbers
6,A2,A3,A4 has 10+6+3+1 = 20 total numbers
5,A2,A3,A4 has 6+3+1 = 10 total numbers
4,A2,A3,A4 has 3+1 = 4 numbers (4321, 4320, 4310, and 4210)
3,A2,A3,A4 has 1 = 1 number (3210)
Summing these: 84+56+35+20+10+4+1 = +highlight%28+210+%29
Check:
Brute-force check by running this Perl one-liner on my MACbook:
perl -e '$c=0; for($i=1000;$i<10000;$i++) { @w=split(//,"$i"); if ($w[0]>$w[1] && $w[1]>$w[2] && $w[2]>$w[3]) { $c++;} } print "count=$c\n";'
210


And to see all 210 of the numbers with A1>A2>A3>A4:
perl -e '$c=0; for($i=1000;$i<10000;$i++) { @w=split(//,"$i"); if ($w[0]>$w[1] && $w[1]>$w[2] && $w[2]>$w[3]) { $c++; print "$i\n"; } } print "count=$c\n";'



Answer by greenestamps(13196) About Me  (Show Source):
You can put this solution on YOUR website!


You have received an excellent response from tutor @Math_Helper, showing how to find the answer to the question by finding and following a pattern.

I followed a similar but different path to the answer, using a different kind of pattern.

Both solutions are good examples of how you can solve many problems by looking for patterns.

My path to the answer started with listing all the 4-digit numbers with leading digit 3 that meet the requirements, then listing the ones with 4 as the leading digit, and so on. Here is what I found.
1: leading digit 3
There is clearly only 1 4-digit number with leading digit 3 that meets the requirements: 3210
2: leading digit 4
The 4-digit numbers with leading digit 4 that meet the requirements can be separated into two distinct groups: (a) All the 4-digit numbers with leading digit 3 that meet the requirements, with the leading digit "3" replaced by leading digit "4"; and (b) All the 4-digit numbers that meet the requirements having first TWO digits "43".
From (a) we get the single 4-digit number 4210.
From (b) we get... 4321, 4320; (2 numbers) 4310 (1 number)
We have 1 4-digit number from (a) and (2+1) = 3 from (b); the total number of 4-digit numbers that meet the requirements is 1+3 = 4.
3: leading digit 5
The 4-digit numbers with leading digit 5 that meet the requirements can be separated into two distinct groups: (a) All the 4-digit numbers with leading digit 4 that meet the requirements, with the leading digit "4" replaced by leading digit "5"; and (b) All the 4-digit numbers that meet the requirements having first TWO digits "54".
From (a) we get 4 numbers that meet the requirements.
From (b) we get... 5432, 5431, 5430; (3 numbers) 5421, 5420; (2 numbers) 5410 (1 number)
We have 4 4-digit number from (a) and (3+2+1) = 6 from (b); the total number of 4-digit numbers that meet the requirements is 4+6 = 10.
4: leading digit 6 or higher
I won't go into the details for any of the other cases; the pattern is clear to me. If you don't see it yet, go through the details for one or two more leading digits to help you.
The results you find are...
leading digit 6: from(a), the 10 numbers from the case with leading digit 5; and from (b), 4+3+2+1 = 10 numbers. Total: 10+10 = 20 numbers.
leading digit 7: from (a), the 20 numbers from the case with leading digit 6; and from (b), 5+4+3+2+1 = 15 numbers. Total 20+15 = 35 numbers.
leading digit 8: from (a), the 35 numbers from the case with leading digit 7; and from (b), 6+5+4+3+2+1 = 21 numbers. Total 35+21 = 56 numbers.
leading digit 9: from (a), the 56 numbers from the case with leading digit 8; and from (b), 7+6+5+4+3+2+1 = 28 numbers. Total 56+28 = 84 numbers.
And, finally, the total number of 4-digit numbers that meet the requirement is
1+4+10+20+35+56+84 = 210

Like the other tutor, it seems to me there might be an easier path to the answer; but I haven't seen it yet.

It is curious to me that all the numbers in the calculations are the C(n,r) numbers in Pascal's Triangle. But again I haven't been able to see the logical connection between those numbers and this problem.