Self-Descriptive Number

Logic Level 4

A self-descriptive number is an integer m m in which each digit d d at position n n (the most significant digit being at position 0 0 and the least significant at position 9 9 ) counts how many instances of digit n n are in m m . The smallest self-descriptive number is 1210 1210 , as it has 1 zero, 2 ones, 1 two and 0 threes. Find the largest self-descriptive number.


The answer is 6210001000.

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.

6 solutions

I played the following game (having in mind that if one wants to maximize, then take a 10 10 -digit number):

0000000000 0 0 0 0 0 0 0 0 0 0

One starts putting something in the 9 9 th position. Logically, we only can put 1 1 . Otherwise, we would get a number with more than 10 10 digits. The same logic applies for the 8 8 th , 7 7 th and 6 6 th positions. So we put 1 1 and we try whatever would imply putting that 1 1 .

For example, putting 1 1 on the 9 9 th position implies having a 9 9 on the 0 0 th position, and then the number doesn't works because we would get 8 8 zeroes, which contradicts having a 9 9 on the 0 0 th position. So we pass to the eight position, and seventh position, and similar things will occur (deserves long explanation, but is the same idea... sorry im lazy to write). When we get to the 6 6 th position, we are able to put a 6 6 on the 0 0 th position, while we have 8 8 zeroes. On the 1 1 th position we put a 2 2 , and on the 2 2 th position a 1 1 . That is:

6210001000 6 2 1 0 0 0 1 0 0 0

So we've maximized... the answer: 6210001000 \boxed {6210001000} .

Why 9000000000 can't be self descriptive

Theerdala Vignesh - 2 years, 4 months ago

Log in to reply

Its missing 1 for number 9 at the end

Nia Bride - 2 years, 3 months ago

sir please tell me what about 8000000010, it is larger than your number+8 is at 0th position and contains 8 zeroes+1 is at 8th place and contains one 8, then why this is not correct answer,reply please............

Mansi Panwar - 7 years, 3 months ago

Log in to reply

your number has a 1 too hence a 1 should come right after 8 and hence does not satisfy....

Anurag Shrivastav - 7 years, 3 months ago

We have that to maximize n n , so n n have 10 digits. Be n = a 1 a 2 a 3 a 10 n=\overline{a_1 a_2 a_3 \cdots a_{10}} , is autodescriptive so a 1 + + a 10 = 10 a_1+ \cdots + a_{10}=10 . If a 1 = 9 a_1=9 , then a 2 + + a 10 = 1 a_2+\cdots +a_{10}=1 , but is not posible, because a 10 = 1 a_{10}=1 and a 2 = 1 a_2=1 . Contradiction. If a 1 = 8 a_1=8 , then a 2 + + a 10 = 2 a_2+\cdots +a_{10}=2 , but is not posible, because a 9 = 1 a_9=1 and a 2 = 2 a_2=2 and a 2 = 1 a_2=1 . Contradiction. If a 1 = 7 a_1=7 , then a 2 + + a 10 = 3 a_2+\cdots +a_{10}=3 , but is not posible, because a 8 = 1 a_8=1 and a 2 = 2 a_2=2 and a 2 = 1 a_2=1 . Contradiction. If a 1 = 6 a_1=6 , then a 2 + + a 10 = 4 a_2+\cdots +a_{10}=4 , is posible, when n = 6210001000 n=6210001000 .

Hi. I like your explanation. Simple and straightforward. I just want to ask where is the property a(1) + ... + a(10) = 10 derived?

Marvin Belina - 7 years, 3 months ago

Log in to reply

You have a ten digit number, so the sum of all digits also has to be ten since it is only adding the number of digits.

Great explanation Ricardo. I was surprised none realized the sum of all digits principle until I scrolled down to your solution..

Pritish Reddy - 7 years, 3 months ago
Aditya Joshi
Feb 19, 2014

We want to number to be as large as possible. First, we try to place 9 9 at the most significant digit.

9000000000
0123456789

This can't work because there is 1 1 nine and there have to be 9 9 zero's for the number to be self descriptive.

Then, we try 8 8 .

8200000010 
0123456789

This only has 7 7 zeros but we need 8 8 .

After iterating a couple of times, we find a suitable candidate at a number that starts with 6 6 . Now, this number has to be the greatest because we tried and failed for number that start with 9 , 8 , 7 9,8,7 . Any other combination that we try will be < 6210001000 < 6210001000 . Thus, finally we get 6210001000 \boxed{6210001000} .

why cant we put 9000000000

zain aabdin - 7 years, 3 months ago

Log in to reply

  9000000000
has 1 1 nine and 9 9 zeros. But in the 9 th 9^{\text{th}} position, it shows 0 0 instead of 1 1 , that is,

  9000000001

would have been right if there were 9 9 zeros. But there are only 8 8 zeros here. Thus, we can't make a self descriptive number with 9 9 in the first digit.

Aditya Joshi - 7 years, 3 months ago

Log in to reply

oh yeah rite i forgot to put 1 for 9 in number....thanx

zain aabdin - 7 years, 3 months ago
Aakarshit Uppal
Feb 23, 2014

Note two things first -

i) It can not have more than ten digits. ii) It should have maximum zeroes.

Step 1. Let's try nine zeroes

9000000000

But it should be 9000000001, because there is one '9' (yes, this is also wrong but we have to get the first digit first). But now there are 8 zeroes.

Step 2. Now let's try eight zeroes.

8000000010

But it should be 8100000010, because there is one '1'. But now there are 7 zeroes.

Step 3. Now let's try seven zeroes

7100000100

But it should be 7210001000, because there are two '1's and one '2'. But now there are 6 zeroes.

Step 4. Let's try Six zeroes, then.

6210001000

Yep, that's the answer.

Explanation for maximum 10 Digits -

  1. First digit tells - No. of '0' s
  2. Second digit tells - No. of '1' s
  3. Third digit tells - No. of '2' s
  4. Fourth digit tells - No. of '3' s
  5. Fifth digit tells - No. of '4' s
  6. Sixth digit tells - No. of '5' s
  7. Seventh digit tells - No. of '6' s
  8. Eighth digit tells - No. of '7' s
  9. Ninth digit tells - No. of '8' s 10.Tenth digit tells - No. of '9' s 11.Eleventh digit tells - No. of '10's ??? No !!!!!

So, there are only 10 digits possible

Aakarshit Uppal - 7 years, 3 months ago

Log in to reply

Thank you for this easy explanation. I needed it.

Tanya Kaushal - 7 years, 3 months ago

Log in to reply

Anytime, miss ;)

Aakarshit Uppal - 7 years, 3 months ago
Faizan Khan
Jan 10, 2016

ZiSongYeoh

But the answer is not the largest self-descriptive number. You should think on these self-descriptive numbers, 72100001000, 821000001000 and so on, What do you say?

dude, as we know, the question says "digit" which mean single digit(0-9), e.g. 72100001000, the last digit of this number express the number of digit "10". Since "10" is not single digit your argument is flaw. CMIIW

Resha Dwika Hefni Al-Fahsi - 5 years, 4 months ago

could you please give clear explanation?

Mohammad Khaza - 3 years, 10 months ago
Jj Treadway
May 31, 2016

You should clarify that the number can have a maximum of 10 digits. One could interpret the problem as saying that (for example) the 11th digit (digit number 10), which indicates how many times the digit "10" appears in the number, must equal the number of times the two-digit string "10" occurs, or that it must equal zero because "10" is not a digit, so of course the digit "10" appears zero times. Using the latter interpretation (which is the interpretation I first assumed) the answer would be 9210000001000. I haven't tried to solve the problem with the former interpretation.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...