Comments by "Hiyuke La Vie" (@hiyukelavie2396) on "Can you solve the computer virus riddle? - James Tanton" video.
-
I thought I solved this, but when I continued watching the video the solution given seems a lot more complicated
My (easier?) solution is as follows:
I will give my team the following instructions
1. There are four lights, let's call them #1, 2, 3 and 4, with #1 being the indicator
2. If you see only one lit light, just destroy that one
3. If you see only one unlit light, just destroy that one
4. If you see there are two lit and two unlit lights, destroy the one that has the same state as the indicator (#1)
5. If you see all lights are lit or unlit, destroy the indicator itself (#1)
This feels like a simpler solution, doesn't it?
The logic behind this solution is this:
What I need to do is to make sure that the corrupted light is the only one that is lit or unlit, and my team will destroy it as per instructions 2. and 3.
Easy
And if this is not possible, then what I will need to do is indicate which is the corrupted light by matching its state to the indicator (#1), and my team will destroy is as per instruction 4.
And if the indicator (#1) itself is the one corrupted?
Then I can either make sure all the lights are either lit or unlit, in which case they will destroy the indicator (#1) as per instruction 5., or I can make it so that the indicator (#1) is the only light that is lit or unlit, in which case they will still destroy it as per instructions 2. and 3.
Try it with any permutation of the lights being lit or unlit, and corrupt any one of them, you will find that following this set of five instruction the corrupt light will always be the one destroyed
1
-
Some examples, with #1, 2, 3, and 4 representing the four lights
1 lit
2 lit - corrupt
3 unlit
4 unlit
I unlit 1, and 2 being the only light that is lit will be destroyed. The inverting the states of the light will present no problem, see the next example
1 unlit
2 unlit - corrupt
3 lit
4 lit
I lit 1, 2 being the sole unlit light will be destroyed
You can repeat this for any permutation of lights two lit and two unlit and see that it works
Let's try something different
1 lit
2 unlit
3 lit - corrupt
4 lit
I unlit 4. 3 being lit (same state as the indicator) will be the one destroyed. Again, inverting the state of the lights poses no problem, see next example
1 lit
2 unlit
3 lit - corrupt
4 lit
I unlit 4. 3 remaining lit (same state as the indicator) will be the one destroyed
Again, you can try this with any permutation of 3 lit/unlit lights and 1 unlit/lit light and it will work
What if the indicator was the one corrupted?
1 lit - corrupt
2 lit
3 unlit
4 unlit
I unlit 2. The indicator being the only one that is lit will be destroyed
Try it again
1 unlit - corrupt
2 lit
3 lit
4 lit
I lit 1. All lights are lit, the indicator will be destroyed
And so on. You can try with any permutations you can think of, but you can always single out the corrupt lit by following the set of five instructions given above
1