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.
Descobriste o esconderijo secreto de Leonardo da Vinci, protegido por uma série de fechaduras com combinações. Felizmente, o teu mapa do tesouro tem três códigos: 1210, 3211000 e... hum. Parece que falta o último. Parece que vais ter que o descobrir por ti mesmo.
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.
Há duas coisas que os dois primeiros números têm em comum: são aquilo a que chamamos números autobiográficos. É um tipo especial de número cuja estrutura se descreve a si mesmo. Cada um dos dígitos do número autobiográfico indica quantas vezes o dígito que corresponde a essa posição ocorre dentro do número. O primeiro dígito indica a quantidade dos zeros, o segundo dígito indica o número dos uns, o terceiro dígito o número dos dois e assim sucessivamente até ao fim.
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
A última fechadura tem um número de 10 dígitos, e acontece que só há um número autobiográfico com 10 dígitos. Qual é ele? [Suspende aqui o vídeo se quiseres descobrir sozinho. [Resposta em: 3 [Resposta em: 2 [Resposta em: 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.
Tentar diferentes combinações às cegas demoraria uma eternidade. Assim, vamos analisar os números autobiográficos que já temos para ver que tipo de padrões podemos encontrar. Se somarmos todos os dígitos do número 1210 obtemos 4 — é o número total de dígitos. Faz sentido porque cada dígito individual diz-nos o número de vezes que ocorre um dígito específico nesse número. Então, os dígitos no nosso número autobiográfico de 10 dígitos têm que somar 10.
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. 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.
Isto diz-nos outra coisa importante: o número não pode ter dígitos demasiado grandes. Por exemplo, se incluísse um 6 e um 7, um dos dígitos teria que aparecer 6 vezes e outro dígito 7 vezes, o que resultaria em mais de 10 dígitos. Podemos concluir que não pode haver mais do que um dígito maior que 5 em toda a sequência. Então, dos quatro dígitos 6, 7, 8 e 9, só um deles — ou nenhum — pode constar na sequência. E haverá zeros nas posições correspondentes aos números que não forem usados. Agora que sabemos que o nosso número tem que conter, pelo menos, 3 zeros ou seja, o dígito correspondente a zero tem que ser 3 ou maior.
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. 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.
Enquanto este primeiro dígito conte o número de zeros, todos os dígitos depois dele contam quantas vezes ocorre um dígito diferente de zero. Se somarmos todos os dígitos ao primeiro dígito — e não se esqueçam que os zeros não aumentam a soma — obtemos o total de quantos dígitos diferentes de zero aparecem na sequência, incluindo esse primeiro dígito. Por exemplo, se tentarmos com o primeiro código, obtemos 2 mais 1 igual a 3 dígitos. Se subtrairmos 1, temos um total de quantos dígitos diferentes de zero há depois do primeiro dígito — dois, no nosso exemplo.
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. How many 1s? Turns out there can only be two – any more would require additional digits like 3 or 4 to count them.
Porquê fazer tudo isto? Agora sabemos uma coisa importante: a quantidade total dos dígitos diferentes de zero que ocorrem depois do primeiro dígito é igual à soma desses dígitos menos 1. Como obtemos uma distribuição em que a soma seja exatamente uma unidade maior do que a soma dos números positivos diferentes de zero? A única forma é que um deles seja um 2 e os restantes sejam 1. Quantos 1? Acontece que só pode haver dois — se houvesse mais, seria necessário dígitos adicionais,
So now we have the leading digit of 3 or greater counting the zeroes,
como 3 ou 4 para os contar.
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.
Agora temos o primeiro dígito de 3 ou maior, para contar os zeros. um 2 para contar os uns, e dois 1, um para contar os dois, e outro 1 para adicionar ao primeiro dígito. Por falar nisso, é altura de descobrir qual é esse primeiro dígito. Como sabemos que o 2 e os dois 1, somam 4, podemos subtrair esse número a 10 e obtemos 6. Agora, basta colocá-los todos nos seus lugares: 6 zeros, 2 uns, 1 dois 0 três, 0 quatros 0 cincos 1 seis, 0 setes, 0 oitos e 0 noves.
The safe swings open, and inside you find... Da Vinci’s long-lost autobiography.
O esconderijo abre-se e lá dentro encontras a autobiografia de Da Vinci há muito tempo desaparecida.