Question: Pac - Man lives on a two - dimensional grid that extends infinitely in all directions, and its moves are controlled by a mysterious outside

Pac-Man lives on a two-dimensional grid that extends infinitely in all directions, and its moves are controlled by a mysterious outside force.
Movement commands come from the alphabet $\Sigma =\set{\texttt{L},\texttt{R},\texttt{U},\texttt{D}}$, which correspond to moving 1 unit left, right, up, and down, respectively.
Pac-Man starts from home at the origin $(0,0)$, and receives an arbitrary (finite) string of commands $s \in \Sigma^*$ to execute in sequence.
However, Pac-Man first wants to know more about where it will end up after following the sequence of commands in~$s$.
\begin{parts}
\part[5] Define an \emph{even position} in the grid as one in which both the horizontal and vertical coordinates are even numbers.
Give, with brief justification, a DFA that determines whether Pac-Man would end up at an even position after completing the sequence of commands in~$s$.
If so, the DFA should accept~$s$; otherwise, it should reject~$s$.
\begin{solution}
\end{solution}
\part[8] Prove that \emph{no} DFA correctly determines, for an arbitrary command sequence~$s$, whether Pac-Man will end up back at home (at the origin) after completing the commands.
\begin{solution}
\end{solution}
\part[2] In clear and precise English, describe an \emph{algorithm} that, given an arbitrary command sequence~$s$, determines whether Pac-Man will end up back at home after completing the sequence.
Briefly justify its correctness, but you do not need to give pseudocode or analyze the running time.
So, while a DFA cannot solve Pac-Man's problem, an algorithm (and hence a Turing machine) can!
\begin{solution}
\end{solution}
\end{parts}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!