Yesterday, I witnessed and fell victim to a slew of assassination attempts. It was brutal, bloody, and horrifying.
The problem is as follows:
Amelia is hiding behind one of five doors. You can open a door, look to see if she's there, and then close the door. After you close the door, she will move one door to the left or one door to the right. How can you guarantee you will always find her? And what is the minimum number of doors you need to open to do so?
So, you need to find an algorithm that will always eventually find her, even in the worst case.
Perhaps one way to solve this is to look closely at one door. Like, really closely. Close enough to see the mold growing on the top of it. Gross.
The green mold begins at a layer on the top of the door. This is a special kind of mold, though. It aims to grow downwards, but only so diagonally. Your goal is to stop the mold from growing, and lucky for you, you never forget your special blue tape. You know, the type of tape that mold can't grow on. But you're limited in how you can place it — you can only place one piece of blue tape on the layer of most recent growth. A turn consists of
How does the mold game connect to the door problem? Well, we can think of each row of tiles in the mold game as a turn in the door problem, and think of each tile as a door. Then, a moldy tile corresponds to a door Amelia can be behind. Placing our blue tape is analogous to opening a door. Notice that the empty tiles are doors we know she can't be behind, and thus our goal is to eventually make a row of all empty tiles.
Using this connection, our goal can be restated as finding solutions to this mold game. For a width of five tiles (five doors), the optimal solution seems to be 6.
This game helps us keep track of the door problem on a large number of doors:
If one follows the solutions I've given, there is an upper bound for optimal solutions. Namely, for
In the door problem, we have five doors in a single line. If we think of each door as a vertex in a graph and each connection between the doors which Amelia can travel to on her turn as edges, then we simply have a path graph with five vertices.
It's natural here to extend this problem to any (simple, connected) graph. For example, we can consider the door
problem on the
cyclic graph
Well, this is just our mold game but the mold is allowed to grow diagonally down at the edges and appear on the other side.
We can see that the information we were able to get before (information, here, being the empty tiles—knowing where she's not) isn't obtainable now. Before, we were able to get a tile of information (a blank tile) and build off of it, in a sense, until we had a whole row of blank tiles. Here, we can't even get started. The takeaway: the door problem is impossible on a cyclic set of doors.
I want to show now that if a graph contains a cycle, the door problem is unsolvable on it. Doing this is hard with
the mold game, since we're limited to a two-dimensional visualization. One way to formalize this instead is to
consider the strong product
The vertices
Notice how this game works on our original problem of 5 doors using the strong product
Also note that using this strong product model shows that cycles are impossible for this game.
Here's the thing: if
It seems like not all trees will work. All paths work, as we've seen. But it's hard to see whether the door problem is solvable on certain trees.