【TED ED 中英雙語】 P73
?Can you solve the Leonardo da Vinci riddle
你能解決達(dá)芬奇之謎嗎

You’ve found Leonardo Da Vinci’s secret vault, secured by a series of combination locks.
Fortunately, your treasure map has three codes: 1210, 3211000, and… hmm.?
The last one appears to be missing.
Looks like you’re gonna have to figure it out on your own.

你找到了列奧納多·達(dá)·芬奇 的秘密地下室,地下室門口有一連串密碼鎖。
幸運(yùn)的是,你的尋寶地圖上 有三串密碼:1210,3211000,還有,呃...
最后一串好像看不清了。
看起來你只能 自己推斷一下這串?dāng)?shù)字了。

There’s something those first two numbers have in common: they’re what’s called autobiographical numbers.?
This is a special type of number whose structure describes itself.
Each of an autobiographical number’s digits indicates how many times the digit corresponding to that position occurs within the number.?
The first digit indicates the quantity of zeroes, the second digit indicates the number of ones, the third digit the number of twos, and so on until the end.?
The last lock takes a 10 digit number, and it just so happens that there’s exactly one ten-digit autobiographical number.?
What is it??
Pause here if you want to figure it out for yourself!?
Answer in: 3
Answer in: 2
Answer in: 1

前兩串?dāng)?shù)字有一些相似之處:這種數(shù)字叫作“自我描述數(shù)”,其特點(diǎn)是能夠描述本身的數(shù)字結(jié)構(gòu)。
自我描述數(shù)的每一位數(shù)字代表了這一位置對應(yīng)的數(shù)字 在整個(gè)數(shù)中出現(xiàn)的次數(shù)。
第一位數(shù)表示數(shù)字0的個(gè)數(shù),第二位數(shù)表示數(shù)字?1?的個(gè)數(shù),第三位數(shù)表示數(shù)字?2?的個(gè)數(shù), 之后的位數(shù)以此類推。
第三行鎖有十位數(shù),巧合的是,正好有唯一的十位的自我描述數(shù)。
這個(gè)數(shù)是多少呢?
【如果你想要自己推導(dǎo)一下, 請?jiān)谶@里暫?!?/p>
【答案即將揭曉:3】
【答案即將揭曉:2】
【答案即將揭曉:1】

Blindly trying different combinations would take forever.?
So let’s analyze the autobiographical numbers we already have to see what kinds of patterns we can find.?
By adding all the digits in 1210 together, we get 4 – the total number of digits.?
This makes sense since each individual digit tells us the number of times a specific digit occurs within the total.?
So the digits in our ten-digit autobiographical number must add up to ten.?
This tells us another important thing – the number can’t have too many large digits.
For example, if it included a 6 and a 7, then some digit would have to appear 6 times, and another digit 7 times– making more than 10 digits.?
We can conclude that there can be no more than one digit greater than 5 in the entire sequence.

盲目嘗試不同數(shù)字組合 恐怕要試到地老天荒。
所以我們先分析一下 已有的這兩組自我描述數(shù)來看看我們能找到什么規(guī)律。
把?1210?的每位數(shù)加起來得到的和是4。
這個(gè)結(jié)果的意義在于,每一位數(shù)字告訴了我們 特定一個(gè)數(shù)字在整數(shù)中出現(xiàn)的次數(shù)。
所以我們的這個(gè) 十位數(shù)的自我描述數(shù),每一位數(shù)加起來的和一定是10。
這同時(shí)告訴了我們 另一個(gè)關(guān)鍵信息——這個(gè)數(shù)字不能有太多的大數(shù),
比如,假如這個(gè)數(shù)字有一個(gè)6和一個(gè)7,那么有的數(shù)字需要出現(xiàn)6次,另一個(gè)數(shù)字要出現(xiàn)7次——這樣加起來就超過了十位數(shù)。
所以我們可以判斷出整個(gè)十位數(shù)里 不會有超過一位大于5的數(shù)。

So out of the four digits 6, 7, 8, and 9, only one – if any-- will make the cut.
And there will be zeroes in the positions corresponding to the numbers that aren’t used.?
So now we know that our number must contain at least three zeroes – which also means that the leading digit must be 3 or greater.
Now, while this first digit counts the number of zeroes, every digit after it counts how many times a particular non-zero digit occurs.
If we add together all the digits besides the first one – and remember, zeroes don’t increase the sum – we get a count of how many non-zero digits appear in the sequence, including that leading digit.

所以在6,7,8,9這四個(gè)數(shù)中,最多只能出現(xiàn)一個(gè), 才能滿足這一標(biāo)準(zhǔn)。
而且,這十位數(shù)里會有0,代表了沒有用到的數(shù)字。
所以現(xiàn)在我們知道了 這個(gè)數(shù)至少要有三個(gè)0——這就意味著首位數(shù)不能小于?3。
既然這個(gè)首位數(shù)表示?0?出現(xiàn)的次數(shù),那么在它之后的每一位數(shù)表示的 就是一個(gè)非零數(shù)出現(xiàn)的次數(shù)。
如果我們把首位數(shù)后 的每位數(shù)都加起來——注意,0?不會影響總和——我們會得到整個(gè)十位數(shù)中 非零數(shù)出現(xiàn)了多少個(gè),包括首位數(shù)。

For example, if we try this with the first code, we get 2 plus 1 equals 3 digits.?
Now, if we subtract one, we have a count of how many non-zero digits there are after the first digit – two, in our example.?
Why go through all that?
Well, we now know something important: the total quantity of non-zero digits that occur after the first digit is equal to the sum of these digits, minus one.?
And how can you get a distribution where the sum is exactly 1 greater than the number of non-zero positive integers being added together??
The only way is for one of the addends to be a 2, and the rest 1s.

舉個(gè)例子,如果我們 把第一串?dāng)?shù)這樣加和,我們得到?2+1=3,三個(gè)數(shù)。
那么如果我們減?1,就會得到在首位數(shù)之后 出現(xiàn)的非零數(shù)的個(gè)數(shù),在這個(gè)例子中也就是?2。
為什么要這么處理數(shù)字呢?
注意,我們現(xiàn)在 掌握了一個(gè)關(guān)鍵信息:在首位數(shù)后出現(xiàn)的非零數(shù)的總數(shù)等于這些數(shù)的總和減一。
那么你要如何得到一個(gè)數(shù), 使它的各位數(shù)之和正好比非零正數(shù)的總和大?1?呢?
唯一的辦法是使加數(shù)之一為?2,其余的都是?1。

How many 1s??
Turns out there can only be two – any more would require additional digits like 3 or 4 to count them.?
So now we have the leading digit of 3 or greater counting the zeroes, a 2 counting the 1s, and two 1s – one to count the 2s and another to count the leading digit.?
And speaking of that, it’s time to find out what the leading digit is.?
Since we know that the 2 and the double 1s have a sum of 4, we can subtract that from 10 to get 6.?
Now it’s just a matter of putting them all in place: 6 zeroes, 2 ones, 1 two, 0 threes, 0 fours, 0 fives, 1 six, 0 sevens, 0 eights, and 0 nines.?
The safe swings open, and inside you find... Da Vinci’s long-lost autobiography.

那么是多少個(gè) 1 呢?
看起來只能有兩個(gè) 1 ——因?yàn)橐坏┏^兩個(gè),就會出現(xiàn) 3 或 4 等 其他的數(shù)字用以表示 1 的出現(xiàn)次數(shù)。
所以現(xiàn)在我們知道第一位數(shù)是 不小于 3 的表示 0 出現(xiàn)次數(shù)的數(shù),還有表示 1 出現(xiàn)次數(shù)的數(shù)字 2,還有兩個(gè) 1 ——表示 2 出現(xiàn)的次數(shù),還有另一個(gè)表示第一位數(shù) 出現(xiàn)次數(shù)的數(shù)。
說到這里,我們應(yīng)該來推斷一下首位數(shù)了。既然我們知道 2 和兩個(gè) 1 的總和是 4,我們可以用 10 減掉 4,得到 6,
現(xiàn)在就是如何排列它們的問題了:六個(gè) 0,兩個(gè) 1,一個(gè) 2,零個(gè) 3,零個(gè) 4,零個(gè) 5,一個(gè) 6,零個(gè) 7,零個(gè) 8,零個(gè) 9。
守護(hù)之翼張開,走進(jìn)去你發(fā)現(xiàn)了...達(dá)芬奇失傳已久的自傳。