Labyrinth

Logic Level 4

You and some friends would like to explore a labyrinth from its entrance to its exit:

  • The labyrinth only has one entrance point and one exit point.
  • The labyrinth is located on an infinite square grid; you can only travel in the cardinal directions: East, West, North, and South.
  • The labyrinth is infinite in size, but the shortest path from the entrance to the exit is finite. The entrance and exit are both located on the boundaries of the labyrinth.
  • You have a communication system that allows one to communicate to the others that the exit has been found (but allows no other communication).

What is the minimum number of people that need to enter the labyrinth for there to be a strategy to guarantee that all can come out at the exit in a finite amount of time?

1 2 3 4

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

6 solutions

Mark Hennings
Nov 16, 2018

Consider the possible paths from the starting point. At each junction, you have a finite number of choices as to which route to take. Define the length of a route to be the number of junctions met (after the first).

There are a finite number of routs of length 1 1 (one for each initial choice of direction). For each of the routes of length 1 1 , there are a finite number of routes of length 2 2 that start with the route of length one (one for each possible choice of the last direction to take). Thus there are finitely many routes of length 2 2 . Similarly, each route of length n n can be extended in a finite number of ways to obtain a route of length n + 1 n+1 . Thus, if there are finitely many routes of length n n , then there are finitely many routes of length n + 1 n+1 . If we assume that there are at most four choices of direction at each junction, we deduce that there are at most 4 n 4^n routes of length n n .

Since the distance from the start to the end is finite, the way out is a route of length N N for some N N .

We can try possible routes in some order. If we test a route of length n n and do not get out, we backtrack along this route until we get back to the start. I shall call following a route, and backtracking if the route is unsuccessful testing a route.

A route of length n n can be described by an n n -tuple of the lettters L,F,R,B, where each letter describes which way to turn at each junction. Thus the route ( F , R , B , L ) (F,R,B,L) is a route of length 4 4 which involves going straight on at the start, turning right at the next junction, going back at the next, and then turning left at the final junction. A dull route that gets you back to where you started, but never mind. The point is that these up to 4 n 4^n routes can be sorted lexicographically, so they can be ordered (without having to know the layout of the labyrinth).

Adopt this strategy. Test the length 1 1 routes in order (backtracking to the start if they are unsuccessful). Now test the length 2 2 routes in order, then the length 3 3 routes, and so on. After testing at most 4 + 4 2 + 4 3 + 4 N = 4 3 ( 4 N 1 ) 4 + 4^2 + 4^3 + \cdots 4^N = \tfrac43(4^N-1) routes (each of which has length at most N N passages, meaning that you will have traversed at most 4 3 N ( 4 N 1 ) \tfrac43N(4^N-1) passages (twice each, allowing for backtracking), which will take you finite time), you will get out. Thus you will get out in finite time, without needing help from anyone. The answer is 1 \boxed{1} .

The bottom line is that there are countably many paths of finite length, and these can be tested successively. After a finite number of tests, you will be able to get out.

How is this exploring a labyrinth from its entrance to its exit? This is only finding one path from the entrance to the exit. Maybe some other word should be used rather than explore.

Michael Shaffer - 2 years, 6 months ago

So basically, you go in a spiral around the entrance, just as in the extension of Cantor's diagonal argument to negative rationals.

Rafael Przyrembel - 2 years, 4 months ago

Log in to reply

So long as your spiral takes account of the fact that you try all the paths of length 1 1 , then all the paths of length 2 2 , and so on, then "yes".

Ultimately the proof relies on the fact that there are countably many paths of finite length. Any system which tests all of these exhaustively will get you out of the labyrinth in finite time.

Mark Hennings - 2 years, 4 months ago

Log in to reply

I thought the comparison to Cantor's diagonal argument made that clear. Well, I was wrong. But yes, I thought of a spiral winding around the entrance as close as possible, which should meet this requirement. (Actually, it should be the shortest way to guaranteedly find the exit, as it saves you any backtracking and progresses in all directions evenly. Since there is no information about where the entrance is, any other strategy requires luck to succeed faster.)

Thank you for your response.

Rafael Przyrembel - 2 years, 4 months ago

Log in to reply

@Rafael Przyrembel There is a problem with just spiralling round the entrance. For example, suppose that you attempt this spiral by keeping your left hand on the wall... We are told that the labyrinth is infinite - it might be that you never get back to find the exit. You need to define what you mean by "spiralling round the entrance as close as possible".

Mark Hennings - 2 years, 4 months ago

Log in to reply

@Mark Hennings True. I notice right now that I haven't thought of the walls because their shape was not specified (and that would be too easy), so I defaulted to an infinite grid without walls, where you can freely move in the cardinal directions on every square. But as this is supposed to be a labyrinth, my idea seems naive and would most likely not work.

The abstract strategy, laid out by you, seems to be the most we can tell about the situation.

Rafael Przyrembel - 2 years, 4 months ago

The problem statement and choices reveal the solution. If one person might not ever find it, then how can the communication device help another? Since infinity is not one of the choices, the answer must be one!

Here is a strategy where the communication device can help:

2 people enter the maze, one follows the left wall while the other follows the right wall. One of them is guaranteed to find the exit, and can tell the other that she has found the exit. The other can then backtrack by turning around, and simply following the wall the first had followed.

Julian Poon - 2 years, 6 months ago

Log in to reply

Two people may find the exit FASTER, but the question asks for the minimum people for a FINITE TIME. In your example, one can go a distance of 1 along the left wall, then back and 2 along the right wall, then back and 3 along the left wall, etc., until finding the exit.

Haim Michael Modiano - 2 years, 6 months ago

Log in to reply

Of course i know that, I'm the problem setter. I'm just saying that communication does help, and so your solution does not work.

Julian Poon - 2 years, 6 months ago

Following the wall can be an infinite path that leads nowhere.

Piscary Kaito - 2 years, 6 months ago

How'd one know it's the outer wall, there might be a dead end to the outer wall

A Former Brilliant Member - 9 months, 2 weeks ago

Just a guess, maybe if the problem is redefined, so that travellers have no memory (so that each step does not depend on previous steps taken), then there might be a difference by adding more people.

Darko Simonovic - 2 years, 6 months ago

Log in to reply

That's a nice thought! I might go with it

Julian Poon - 2 years, 6 months ago

Is it possible to invent a similar problem whose answer is not 1?

Harry Potter - 2 years, 5 months ago

I agree that it would be interesting to have a variation such that the answer is not 1.

On the other hand, an easier thing you could do to change the problem is to add "There is no strategy for any number of people" to the choices.

Peter Byers - 2 years, 5 months ago

What if there is a circuit in the maze?

Bert Seegmiller - 2 years, 5 months ago

It requires only one person and even if a person is blind, he/she can find the exit route .You just have to put your hand on any one side of the wall and just walk along with the wall without lifting your hand, surely you will reach your destination.

Bhaskar Sahu - 2 months, 2 weeks ago
Binky Mh
Dec 3, 2018

The minimum number of required people is 1 \boxed{1} .

If the distance between the entrance and exit is finite, there must also be a finite number of possible paths to take of this exact finite length.

Start by testing all paths of distance 1 1 from the entrance. If the exit is not found, increase the distance by 1 1 , and test all possible paths of the new length. Repeat until you find the exit.

An easy way to do this would be to follow the left wall, considering any paths beyond the current test length to be blocked off. Once you find yourself back at the entrance, increase the distance and repeat.

As the entrance and exit are located on the labyrinth boundary and the labyrinth is entirely on a single plane, we know we can't accidentally pass around the back of the exit or entrance.

Barak Pat
Dec 7, 2018

Think about the labyrinth as a graph were the nodes are the squeres and the edges are a possible moves. Do BFS, and becuse the exist is within finite steps, you are certain to find it.

The communication device does not allow you to say where the exit is, hence it is useless. Because of this, a singular person would have the same odds as the whole group working individually. The exit is at a finite distance, meaning it is possible to reach.

Tomas Po
Dec 3, 2018

It’s a logic problem, not a mathematical one. If no people enter the maze, there is no strategy of finding the exit. Therefore you need at least 1 person for strategy to exist.

Obviously you need at least one person (otherwise there is no problem). The question is whether one person can get out on her own, or whether she needs help.

Mark Hennings - 2 years, 6 months ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...