Beautiful numbers

A 10-digit number is called beautiful if the digits 0, 1, 2, 3, 4 appear in ascending order, and the digits 9, 8, 7, 6, 5 appear in descending order.

If 0 can't be the first digit, how many beautiful numbers exist?

Note: As an explicit example, 9018762354 is beautiful because the 2 sequences appear in order, as evidenced by 901 87623 54 \color{#D61F06}{9} 0 1 \color{#D61F06}{8 76 } 23 \color{#D61F06} {5} 4 .


The answer is 126.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Rafi Ramadhana
Sep 3, 2014

Simply, algorithm I used for this prob is -> UNIVERSE - EXCEPTION

Which is : (10C5) - (9C5) = 126

10C5 is the total number of position could obtained.

Then, 9C4 is the number of position which the 1st digit is 0. So we just need to find how to place the rest 4 digits there.

Can you explain how universe is 10C5?

Sriram Sitharaman - 6 years, 9 months ago

Log in to reply

You know that we have 10 digits in total right? Then we have 2 sequences which is 5 numbers for each.

So, that 10C5 is come from the place to put all the number from a sequence. ( It doesnt matter which sequence do you choose )

Then how about the other sequence? It will fill the space naturally, so the probability is 1.

Why 1 ? Because it base on the rule that the sequence must be put in order. Thus, there is only 1 way to put the 5 numbers from other sequence.

Rafi Ramadhana - 6 years, 9 months ago
Bill Bell
Jan 2, 2016

A nice computational solution is available for this problem too.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from itertools import permutations
from re import compile

hi=compile('[5-9]+')
lo=compile('[0-4]+')

count=0
for p in permutations('9876543210'):
    n=''.join(p)
    if n.startswith('0'):
        continue
    if ''.join(hi.findall(n))=='98765':
        if ''.join(lo.findall(n))=='01234':
            count+=1

print count    

Generate each permutation of the ten digits in turn. Use regular expressions to select the parts of each permutation consisting of digits between 5 and 9 and 0 and 4 respectively. Then compare these parts against 98765 and 01234 respectively.

Rishabh Mishra
Sep 4, 2014

Solution is 8C4 + 8C3 = 126. There are 10 places. 0 cannot be in the first place, so first place has to be 9. Second place can either be 8 or 0. If second place is 0, then we are left with 4 more numbers in the sequence {0,1,2,3,4}. So we can select 4 places out of 8 in 8C4 ways. To fill the remaining 5 places there is only one way. Similarly, if second place is 8, then we need 3 places to fill the remaining numbers in the sequence {9,8,7,6,5}. This can be done in 8C3 ways. So, the total number of possible sequences are 8C4 + 8C3.

Or you can just say there is 9c4 ways to put 8765 in the 9 spots

Since 8c3+ 8c4=9c4

Aadil Bhore - 6 years, 9 months ago
Dewita Sonya
Aug 25, 2014

The first digit must be 9. So the problem is to arrange the other 9 numbers. Because 0,1,2,3,4 is monotonically increasing, we just have to choose 5 spot for this numbers. It is 5C9=126

10C5 - 9C4

Tahsin Ahmed - 6 years, 9 months ago

Can you explain why you used 5C9??

Ivan Martinez - 6 years, 9 months ago

Log in to reply

It was a typo - she meant 9C5

Mark Kong - 6 years, 9 months ago

shouldn't it be 10 digit number??? i mean in the question . cause there are 10 digits. and i suppose it should be 9C5 :)

Nurul Alam Pavel - 6 years, 9 months ago

Log in to reply

9c4 = 9c5 ._.

math man - 6 years, 9 months ago

Log in to reply

can You explain how can we get numbers using ACN ? i'm just at high school level at math ..

Jhoemar Mendiogarin - 5 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...