|
Post by Carl LaFong on Feb 19, 2024 11:26:17 GMT
You have 100 boxes. Each box contains a single number in it, and no two boxes have the same number.
1. You are told that one of the boxes at random will be removed. But before it is removed you are given an extra box, and allowed to put a single number in it. What number do you put in the extra box that guarantees you will be able to recover the number of whichever box is removed?
2. You are told that two of the boxes at random will be removed. But before it is removed you are given two extra boxes, and allowed to put one number in each of them. What (different) numbers do you put in these two boxes that guarantees you will be able to recover the numbers of both removed boxes?
The analogy here is that each box is a hard drive, the number in the box is the data, and the removal of a box is the failure of the hard drive. With one extra hard drive, we are secure against the random failure of a single hard drive, and with two, we are secure against the failure of two. It seems magical that we can protect such a lot of information against random failures with minimal back-up.
|
|
|
Post by Carl LaFong on Feb 19, 2024 11:27:33 GMT
|
|
|
Post by Carl LaFong on Feb 19, 2024 11:49:58 GMT
1) Is it the product of all one hundred numbers plus 1?
Actually, maybe just the sum of all the numbers.
|
|
|
Post by tickingmask on Feb 19, 2024 12:08:53 GMT
1) Is it the product of all one hundred numbers plus 1? Actually, maybe just the sum of all the numbers. The sum of all the numbers would do for question 1. To recover the missing number, simply subtract the sum of the remaining boxes from this number.
Question 2 you probably just need the sum (S) and the product (P). Suppose M1 and M2 are the numbers in the two missing boxes:
M1 * M2 = P / (Product of remaining boxes) M1 + M2 = S - (Sum of remaining boxes)
So you have two equations which you simply solve for M1 and M2.
|
|
|
Post by Carl LaFong on Feb 19, 2024 12:23:36 GMT
1) Is it the product of all one hundred numbers plus 1? Actually, maybe just the sum of all the numbers. The sum of all the numbers would do for question 1. To recover the missing number, simply subtract the sum of the remaining boxes from this number.
Question 2 you probably just need the sum (S) and the product (P). Suppose M1 and M2 are the numbers in the two missing boxes:
M1 * M2 = P / (Product of remaining boxes) M1 + M2 = S - (Sum of remaining boxes)
So you have two equations which you simply solve for M1 and M2.
Yes, that must be it. Answer at 5pm.
|
|
|
Post by Carl LaFong on Feb 19, 2024 18:32:14 GMT
1. You are told that one of the boxes at random will be removed. But before it is removed you are given an extra box, and allowed to put a single number in it. What number do you put in the extra box that guarantees you will be able to recover the number of whichever box is removed?
Solution The sum of all the numbers in the 100 boxes.
Here’s an explanation with some more working. Let the number in box 1 be n1, the number in 2 be n2, and so on. So, we put n1 + n2 + … n100 in the extra box. Now let’s say that box r is removed, so the information that is lost is the number nr. In order to recover nr we add up all the numbers in the 99 boxes that remain, and subtract it from the number in the extra box. That number is nr.
2. You are told that two of the boxes at random will be removed. But before it is removed you are given two extra boxes, and allowed to put one number in each of them. What (different) numbers do you put in these two boxes that guarantees you will be able to recover the numbers of both removed boxes?
Solution In one box we do what we did in the previous example, which is put the sum of all the numbers in the 100 boxes. Let’s call this number A. In the other box, we need another sum that combines all the digits in the 100 boxes, such as:
n1 + 2n2 + 3n3 + … 100n100
Let’s call this number B.
So let’s say the two boxes that are removed are boxes r and s. If we add up all the 98 numbers that are left, and subtract this from A, we have a value for nr + ns.
Likewise, we add up the values n1 + 2n2 + 3n3 + … 100n100 but without rnr and sns we are left with the value of rnr + sns.
This gives us two equations in two unknowns (nr and ns ) which can be solved to find both nr and ns. (As you hopefully remember from learning basic ‘simultaneous equations’ at school.)
Ta dah! We have managed to find an extremely efficient method to recover our data. And as a bonus, you have learned the basic idea of how “error correcting codes” work, which is the technology that makes sure that the digital world can handle random noise and failures.
I hope you enjoyed today’s puzzle. I’ll be back in two weeks.
|
|
|
Post by tickingmask on Feb 19, 2024 22:21:37 GMT
2. You are told that two of the boxes at random will be removed. But before it is removed you are given two extra boxes, and allowed to put one number in each of them. What (different) numbers do you put in these two boxes that guarantees you will be able to recover the numbers of both removed boxes?
Solution In one box we do what we did in the previous example, which is put the sum of all the numbers in the 100 boxes. Let’s call this number A. In the other box, we need another sum that combines all the digits in the 100 boxes, such as:
n1 + 2n2 + 3n3 + … 100n100
(etc.)
Yes, definitely better than my suggestion, not least because the simultaneous equations you end up with are both linear, so you don't end up with any messy calculations like you would if you did it my way!
|
|