Games with perfect information
Exercise sheet 11
TU BraunschweigSebastian Muskalla Summer term 2018
Out: June 27 Due: July 4
Submit your solutions on Wednesday, July 4, at the beginning of the lecture.
Please submit in groups of three persons.
Exercise 1: Counter machines
Show how to construct a counter machine of dimensiond⩾ 2 with two control statesq0,qfsuch that there is a transition sequence from(q0,n,m, . . .)that reachesqfif and only if
a) n⩾m, b) n< m,
c) nis divisible bym.
Hint:You may use an arbitrary constant number of additional counters.
Exercise 2: Primality testing
Show how to construct a counter machine of dimensiond ⩾ 1 with two statesq0,qfsuch that there isa transition sequence from(q0,n, . . .)that reaches stateqfif and only ifnisnota prime number. Explain your construction.
Hints: You may use an arbitrary constant number of additional counters. You can use non- determinism. You may split your construction into smaller parts (gadgets) and explain later how these should be combined.
Exercise 3: One-counter automata as pushdowns
Prove that one-counter automata can be simulated by pushdown systems.
Recall that a pushdown system is an automaton(Q,→)with memoryS∗, whereSis some finite stack alphabet. The transition rules in→are of the shape
q −−−−−push→a p or q−−−−−push→a p for symbolsa∈S. There is a transition((q,m)→(p,m′))∈Tif
• there is a ruleq−−−−−push→a pandm′ =m.a, or
• there is a ruleq−−−−pop→a pandm =m′.a.
(Here, we use the convention that the right end of the wordmencodes the top of stack.) Note that a popatransition is only enabled whenais indeed the top of stack.
Assume that some one-counter automatonAOCA =(Q′,→′)with statesq0,qfis given. Show how to construct a pushdown systemAPDS = (Q,→)withQ′ ⊆ Qover a suitable stack alphabet such thatqf is reachable inAOCAfrom(q0,0)if and only ifqf is reachable inAPDS from some suitable initial configuration. Briefly argue that your construction is correct.
Exercise 4: Integer counter machines
Aninteger counter machineof dimensiondis defined similarly to a counter machine of dimen- siond. However, the counters can reach negative values, i.e. the memory isZd. A transition of typeq−−−xi−−→pis enabled even if the value of counterxiis zero.
a) LetAICM be an integer counter machine of dimensiond, andq0,qfcontrol states. Show how to construct a counter machine ACM with states q′0 and q′f such that qf is reachable from (q0,0, . . . ,0)inAICMif and only ifq′fis reachable from(q′0,0, . . . ,0)inACM.
b) LetACM be a counter machine of dimensiond, andq′0,q′f control states. Show how to con- struct an integer counter machineAICM with statesq0andqf such thatqf is reachable from (q0,0, . . . ,0)inAICMif and only ifq′fis reachable from(q′0,0, . . . ,0)inACM.
In both cases, argue briefly that your construction is correct.