A five digit positive integer is a mountain number if the first three digits are in strictly ascending order and the last three digits are in strictly descending order. For example, 46872 is a mountain number, but none of 43434, 54456 and 46766 is a mountain number.
Determine the probability that N is a mountain number, given that N is a positive integer chosen at random between 40000 and 99999 inclusively.
Toward globalization
If we skip the middle digit demand, i.e. the number of ascending and descending members being not necessarily equal, the outcome will be much larger- but the calculation difficulty the same.
I'll try to go for it.
If 9 is the "summit" ,not neccesserally the middle, then from the up - set 12345678 we can choose any subset, except the empty set , and from the down -set 876543210 we can choose any subset, except the empty set ,
so there are 2^8-1)*(2^9-1) choices. 255*511=130305
For 8 as the "summit" (2^7-1)*(2^8-1) choices 127*255=32385.
For 7 as the "summit" (2^6-1)*(2^7-1) choices 63*127=8001
For 6 as the "summit" (2^5-1)*(2^6) choices. 31*63=1953
For 5 as the "summit" (2^4-1)*(2^5-1) choices 15*31=465
For4 as the "summit" (2^3-1)*(2^4-1) choices. 7*15=105
For 3 as the "summit" (2^2-1)*(2^3-1) choices. 3*7=21
For 2 as the "summit" (2^1-1)*(2^2-1) choices. 1*3=3
173,238 from 123456789876543210 to 120 inclusive.
Edited on April 8, 2010, 2:07 pm