All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Games
God and the Devil (Posted on 2005-02-08) Difficulty: 4 of 5
God and the Devil decide to play a game. God will start by picking an infinite sequence of moves of the form "left", "right", "up", and "down". The Devil responds by creating a finite maze with an exit and by placing God somewhere inside. God then follows His pre-selected sequence to traverse the maze. Unmakable moves are ignored; for example, if the next move is "left" and there is a wall to the left of the current square, God goes on to the next move in the sequence without moving.

If God escapes the maze in finite time, He wins. Otherwise, the Devil wins.

Assuming both agents act optimally, who will win?

(assume that the maze is formed by deleting some edges from a rectangular grid, and that it has no isolated regions; i.e., it is always possible to get to the exit from any point inside the maze)

See The Solution Submitted by David Shin    
Rating: 3.6842 (19 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
getting out of the maze Comment 67 of 67 |
I have come the conclusion that God can win. This will be made possible by the fact that G's full infinite sequence of moves can be the combination of an infinite set of finite sequences placed one after the other in an infinite number of random orderings.  

But, a vastly simpler and completely sufficient way to win, G can just prepare an infinite random string of moves and be guaranteed success in a finite amount of time. (However, this finite amount of time may make the age of the Universe seem very small depending on the size of the Devil's finite maze, but giving enough time, G will win.)  

One note in the instructions is that the Devil must make a "finite" maze. It is not said that God knows its size before God makes the infinite list of moves. So, the size of the Devil's maze, while finite, may be of any size: the size includes an infinite number of possibilities. But, no matter the size, and G's initial placement, G's infinite sequences will _eventually_ allow escape.

First, some facts (in answer to some issues raised in the first dozen reader posts):

1) There is an escape route that touches no cell more than once for every position in a finite (n-cell) maze, with each escape route being n-cells long or less. The way to see this is just to grow multiple strands of a string from the exit inward toward every cell, bifurcating at each maze branch, so as to reach all cells. The strands are the paths out. Thus, for every starting position there is a "way out" consisting entirely of "make-able" moves which traverses n or fewer cells. In the same way, there is a sequence of n or less moves from any one cell of the maze to any other. For a maze of n cells, the set of all possible n or less-length sequences may be generated. The total number of moves in this sequence of sequences is the sum of the number of sequences of each length  (4^1 + 4^2 + ... + 4^n ). Call this sum f(n).  

2) There is no possibility for G to build-in to G's sequence "retracing instructions" for each failed path, since blockages are irreproducible when backtracking and so backtracking it impossible. This means that G cannot build in a "reverse this attempt" sequence following every sequence of moves. So, each sequence brings G to an unknowable position, likely one different than the previous position. 

3) A note on infinities: Countable infinities multiplied together still make countable infinities. For a well known example, consider a set containing the positive integers, and consider a set of these sets indexed by the positive integers. How many integers are there in total? This total is equivalent to the number of integer grid points in Quadrant I of the coordinate plane, which may be counted on a zig-zag line starting at the origin. Thus, there are still a countable infinity of elements in the product set.  

4) A note on probabilities: If there is a non-zero probability of an event occurring in a random process, and an infinite number of realizations of the process are considered, then eventually (in a finite time) that event will occur. As in QM: that which is not forbidden is compulsory. 

For a beginning idea of where this is going, image a maze of n cells.
G makes a list of all f(n) sequences and concatenates them in an infinite number of random orderings so that each of the f(n) members appear an infinite number of times in what we'll call the random Grand Sequence. Note that the length of the GS is the product of two countable infinities.  This GS will, by chance, eventually match the phase of the wanderer. In other words, G, moving through the maze will eventually be in the right cell when the right route out starts. The reason for this is that while every exit sequence is in the GS, so is every path from every cell to every other cell. By chance, G will be shuttled to every cell and also by chance, at some point in a finite amount of time, find that the appropriate exit sequence will start when G is in one of the cells. Think of it like this: G is constantly being showered with sequences and is also constantly moving through the maze. Eventually the right sequence for the exit will hit G when G is in the right cell for it.  

The final wrinkle in this solution is that the actual size of n is unknown. So G's GS must be built by concatenating the 4^n sequences from ever larger and larger n while also randomly concatenating-in sequences from 4^m where 1<m<n. By ordering them randomly and endlessly, even with n growing, the right sequence matching G's position will be mode.  (This is the multiplication of a third countable infinity to make the GS.)

Finally, we ask: could one completely random infinite sequence of U, D, R, and Ls contain all the aspects required in the GS? I.e, skip making the GS entirely? Again, the answer is yes. An infinite base 4 number of random digits is necessarily a "normal number" that contains any desired pattern, including all f(n) sequences in all random orders out to any desired finite length. This very long random number, easy to produce, contains all f(n) arranged randomly an infinity of times for every n, no matter how large is n. (That which is not forbidden is compulsory).  This random number alone is all G needs to get out. So, this then is the simplest way out for G.

Edited on September 22, 2022, 11:46 am
  Posted by Steven Lord on 2022-09-20 22:46:42

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information