Register to reply 
Simple yet difficult Math question. 
Share this thread: 
#1
Jun2413, 09:11 AM

P: 669

How many five digit numbers are there which have first three digits in ascending order and last three digits in descending order?
I thought people from all faculty can ponder on this, that is why I placed it in GD rather than Maths forum. Clarifications (Added after 6 replys had been made): 1. Base 10. (Never thought I would have to answer this too!) 2. strictly ascending and strictly descending. 3. No leading 0s allowed. But since this isn't a homework question It doesn't really much matter what assumptions you take. I just wanted to see how you would approach it. But the assumptions shouldn't make it too easy, like assuming, Base 2, notstrictly ascending, and No leading 0s. 


#2
Jun2413, 10:42 AM

PF Gold
P: 641




#3
Jun2413, 10:50 AM

Emeritus
Sci Advisor
PF Gold
P: 4,500

I'm assuming by ascending you mean strictly ascending, so 11111 doesn't count. Once you pick a middle digit, you can pick any two digits to come before it, then any two digits to come after it, as long as all four digits picked are smaller than the middle digit. Random caveat that 0 can't be the first digit of a number, so you can't pick a 0 as one of the two digits to come before. So if I pick for the middle digit
0: No way to do this 1: No way to do this 2: No way to do this (because of the 0 starting the number) 3: I have 2 choose 2 ways to pick the starting digits, and 3 choose 2 ways to pick the ending digits, for a total of 3 ways 4: I have 3 choose 2 ways to pick the starting digits, and 4 choose 2 ways to pick the ending digits, for a total of 18 ways Add up all the results through 9 and get some sort of number 


#4
Jun2413, 10:54 AM

PF Gold
P: 739

Simple yet difficult Math question.
Let's see how easy it could be... I haven't given this any thought and just started typing.
Let's define the five digit number thusly: ##### = abcde (just for ease of typing). So in the number 13542:
Assuming that a leading zero doesn't make for a valid fivedigit number, the definition for a is the closed interval between 1 and 7. a = [1,7] b = (a,8] c = (b,9] d = [1,c) e = [0,d) Ugh... you need summation notation to go any further... does someone with decent Latex experience want to carry on with this one? 


#5
Jun2413, 10:54 AM

Sci Advisor
HW Helper
PF Gold
P: 3,216

I'll make a few assumptions since your question is ambiguous:
* we are using decimal digits * leading zeros are OK, e.g. 01210 qualifies * by "ascending" and "descending" you don't mean "strictly", e.g. 11211 qualifies Try constraining the middle digit to a fixed value, and consider how many possibilities are available for the first two digits. If the middle digit is 0, then the first two digits must be 00. If the middle digit is 1, then the first two digits can be 00, 01, or 11. If the middle digit is 2, then the first two digits can be 00, 01, 02, 11, 12, or 22. If the middle digit is 3, then the first two digits can be 00, 01, 02, 03, 11, 12, 13, 22, 23, or 33. In general, if the middle digit is N, then there are 1+2+...+(N+1) possible combinations for the first two digits, and this sum is equal to $$\sum_{k=1}^{N+1} k = \frac{(N+1)(N+2)}{2}$$ Of course the formula for the number of combinations for the last two digits is the same due to the symmetry of the problem. And, given N, the first two digits can be chosen independently of the last two digits. Therefore for a given N, the total number of combinations is $$\left(\frac{(N+1)(N+2)}{2}\right)^2$$ So we can just sum this formula from N=0 to N=9 to get the total number five digits numbers that meet the criteria: $$\sum_{N=0}^{9}\left(\frac{(N+1)(N+2)}{2}\right)^2$$ This sum can be evaluated by multiplying out the numerator and splitting the sum into pieces involving various powers of N. Or, we can be lazy and use Wolfram Alpha to get the answer, which is 7942. 


#6
Jun2413, 10:56 AM

PF Gold
P: 739




#7
Jun2413, 10:59 AM

Mentor
P: 15,067

Are leading zeros allowed? Trailing ones? Strict vs nonstrict ascending / descending? 


#8
Jun2413, 12:28 PM

P: 218

are trailing zeros allowed ?
is the ascending/descending condition strict ? I'm getting this for the different possibilities: strict, no leading 0: 2142 strict, accepting leading 0:2892 not strict, no leading 0: 6237 not strict, accepting leading 0: 7942 


#9
Jun2513, 10:29 AM

P: 535

1. Base 10
2. strictly ascending and strictly descending. 3. No leading 0s allowed. I only get 7: 12321 23432 34543 45654 56765 67876 78987 


#10
Jun2513, 10:40 AM

Mentor
P: 15,067

bahamagreen, you apparently don't know what "strictly ascending" means. It does not mean consecutive, which is how you took it. The sequence 1,2,2 is an ascending sequence. In an ascending sequence, each element but the last is less than or equal to the following element. The sequences 1,2,3 and 1,2,4 are not only ascending sequences, they are also strictly ascending sequences.



#11
Jun2513, 11:38 AM

P: 184

I assume this is supposed to be done by hand? Using a computer this wouldn't be that difficult.
That said, I would start by breaking the problem up into: 1. how many ordered pairs (a,b) with a < b (with 0 < a,b < 10) 2. how many ordered pairs (b,a) with b > a (with 0<= a,b < 10) 3. for a given x between 3 and 9, how many pairs from the first set satisfy x > b 4. how many pairs from the second set satisfy x > b 5. the product of 3 and 4 It wasn't difficult to work out by hand that (1) = 8+7+6+5+4+3+2+1 and (2) = 9+8+7+6+5+4+3+2+1. (there are 8 numbers strictly greater than 1, 7 numbers strictly greater than 2, and so on). That's where I would start, but my problem solving approach has been "tainted" by computer science lately. I think (4) should be easy to work out as well. (The number should be (x1) + (x 2) ... + (x  x)) Edit: here I'm being handwavy with the term "numbers". I think anyone with the intelligence to realize that I haven't been precise should also be smart enough to figure out what I mean. 


#12
Jun2513, 12:17 PM

Mentor
P: 15,067

Now that we've had a clarification from the OP the problem isn't that hard. For a middle digit n≥3, there are (n2)(n1)/2 possible strictly ascending sequences for the first three digits (including that middle digit) and (n1)n/2 strictly descending sequences for the last three digits (once again including the middle digit). These are independent choices, so altogether there are (n2)(n1)^2n/2 solutions given that the middle digit is n. Now sum from n=3 to n=9 (or to B1 to generalize to base B). Could I do this by hand? Yes. With lots of mistakes along the way. Would I want to? No. I'd make lots of mistakes along the way. Why torture myself when I can do it just as I wrote it with a tool such as Wolfram Alpha? 


#13
Jun2513, 12:23 PM

P: 535

So 1, 1, 1, 1, 1, 1 is an ascending sequence; I suppose it a decsending one too? 


#14
Jun2513, 02:38 PM

P: 98

$$\sum_{m=3}^{9}\frac{(m1)(m2)}{2}·\frac{m(m1)}{2}=2142$$
Took me more to typeset it than to figure it out 


#15
Jun2513, 02:48 PM

P: 184




#16
Jun2513, 11:19 PM

P: 669

So, its 2142 for Base 10 system. http://www.wolframalpha.com/input/?i...1%29%5E2n%2F4 If strict restriction is lifted on ascending and descending, I think it will be ((n)(n+1)/2)*((n+1)(n+2)/2). http://www.wolframalpha.com/input/?i...%2B2%29%2F2%29 


Register to reply 
Related Discussions  
Simple math question  General Discussion  22  
Another simple math question.  Introductory Physics Homework  1  
Simple Math question  Introductory Physics Homework  2  
Simple Math Question  Introductory Physics Homework  10  
Simple math question. .  General Math  7 