(a) Before reading any symbols, the machine starts on
1 circle, and reading the first six
0s takes
6 steps, so the machine visits
6+1=7 circles in total (watch out for the common slip of counting only the
6 steps and saying
6 circles visited, which would not force a repeat in a
6-circle machine). By the Pigeonhole Principle, since the machine only has
6 circles, at least one circle must be visited twice during the first six
0s. (b) Skipping the loop gives
xz=000111111 (three
0s and six
1s), and going around the loop twice gives
xy2z=000000000111111 (nine
0s and six
1s). Be careful not to drop the leading
0 at the start of
z=0111111, which would wrongly give two
0s
(00111111) and eight
0s
(00000000111111). Because both paths end on the same Accept circle as
xyz, the machine accepts strings with unequal numbers of
0s and
1s, contradicting its claim.