Question: Pac - Man lives on a two - dimensional grid that extends infinitely in all directions, and its moves are controlled by a mysterious outside
PacMan lives on a twodimensional grid that extends infinitely in all directions, and its moves are controlled by a mysterious outside force.
Movement commands come from the alphabet $Sigma settextttLtextttRtextttUtextttD$ which correspond to moving unit left, right, up and down, respectively.
PacMan starts from home at the origin $$ and receives an arbitrary finite string of commands $s in Sigma$ to execute in sequence.
However, PacMan first wants to know more about where it will end up after following the sequence of commands in~$s$
beginparts
part Define an empheven 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 PacMan 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$
beginsolution
endsolution
part Prove that emphno DFA correctly determines, for an arbitrary command sequence~$s$ whether PacMan will end up back at home at the origin after completing the commands.
beginsolution
endsolution
part In clear and precise English, describe an emphalgorithm that, given an arbitrary command sequence~$s$ determines whether PacMan 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 PacMan's problem, an algorithm and hence a Turing machine can!
beginsolution
endsolution
endparts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
