CHAPTER 19
Turing Machines
:& THE TURING MACHINE
At this point it will help us to recapitulate the major themes of the previous two parts an,
outline all the material we have yet to present in the rest of the book in one large table:

CSI 3104 Introduction to Formal Languages
Winter 2016
Assignment 3
Assigned February 6, due Monday, February 15 at 10:00
1. Describe in words the language accepted by the transition graph TG (i) pictured
on the last page of this assignment.
2. Let = cfw_a

350 CHAPTER 15 CFG = PDA
17 (i) From the summary table produced in Problem 15, write out the productions of [11
DA.
CFG that generate the row language of the P
(ii) Convert this to the CFG that generates the actual language of the PDA (not the row
lang

288 CHAPTER 13 Grammatical Format
A ->a | A
B ~> b | A
Note that A is a word in this language, but when converted into CNF, the gramm
will no longer generate it.
(vi) S >SaS | SaSbS | SbSaS I A
(vii) S >AS I SB
A ->BS | SA
B -> SS
15. Convert the foll

x BUILDING A PDA FOR EVERY CFG
318
We are now ready to prove that the set of all languages accepted by PDAs is the same as
set of all languages generated by CFGs.
We prove this in two steps.
THEOREM 30
Given a CFG that generates the language L, there is a

206
CHAPTER 10 Nonregular Languages
(ii) Show that if we subtract a nite set of words from a regular language, the resul
regular language.
(iii) Show that if we add a nite set of words to a nonregular language, the resul
nonregular language.
(iv) show tha

CHAPTER 8 Finite Automata with Output
15. Show that the following machine also has this identity property:
0/0, 1/1
0/1, 1/0
16. Find yet another Mealy machine with this identity property.
Regular
Languages
For Problems 17 and 18, similarly, giv

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 12: Context-Free Grammars
Chapter 12: Context-Free Grammar
I. Theory of Automata
II. Theory of Formal Languages
III. Theory of Turing Machines
Dr. Nejib Zaguia
CSI3104-W11
1
Chapter 12: Con

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 10: Nonregular Languages.
Chapter 10: Nonregular Languages
We show several examples of nonregular
languages: those that cannot be defined
by regular expressions.
Dr. Nejib Zaguia
CSI3104-W11

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 9: Regular Languages.
Chapter 9: Regular Languages
A regular language is a language that can
be defined by a regular expression.
We study some properties of the class of
regular languages.
Dr

CSI 3104 /Winter 2011: Introduction to Formal Languages
Nejib Zaguia
Winter 2011
I. Theory of Automata
II. Theory of Formal Languages
III. Theory of Turing Machines
12/30/2010
Dr. Nejib Zaguia
CSI3104-W11
1
CSI 3104 /Winter 2011: Introduction to Formal La

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 6: Transition Graphs
Chapter 6: Transition Graphs
We introduce the first non-deterministic but simple
theoretical machine: Transition Graph.
Dr. Nejib Zaguia
CSI3104-W11
1
Chapter 6: Transiti

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 4: Regular Expressions
Chapter 4: Regular Expressions
What are the languages with a finite representation?
We start with a simple and interesting class of such
languages.
Dr. Nejib Zaguia
CSI

5% EMPTINESS AND USELESSNESS
402
. dictions. Suppose we have a question that requires a decision procedure. If we prove that no
CHAPTER 18
Decidabilit /
In Part II, we have been laying the foundation of the theory of formal languages. Amon

a? THE TWO-STACK PDA
480
CHAPTER 21
Minskys Theore ,
We shall soon see that Turing machines are fascinating and worthy of extensive study,
they do not seem at rst glance like a natural development from the machines that we
been studying befo

CHAPTER 17
Context-Free
Languages
4% CLOSURE PROPERTIES
In Part I, we showed that the union, the product, the Kleene closure, the complement, an
the intersection of regular languages are all regular. We are now at the same pomt in our (118
show in the

CSI 3104 Introduction to Formal Languages
Winter 2016
Assignment 2
Assigned January 29, due Friday, February 5 at 12:00 (noon)
1. Let = cfw_a, b. Construct a regular expression dening each of the following languages over .
(a) The language of all words th

CSI 3104 Introduction to Formal Languages
Winter 2016
Assignment 1
Assigned January 16, due Friday, January 29 at 12:00
1. Let = cfw_a, b.
(a) Give an example of a language S over such that the language S has more
six-letter words than seven-letter words.

CSI 3104 Introduction to Formal Languages
Winter 2015
Assignment 1
Assigned January 20, due Wednesday, January 28 at 16:00
1. Consider the language S where S = cfw_aa, aaa. Describe all the ways that a12 can
be written as the concatenation of factors in S

534 CHAPTER 22 Variations on the TM
sents cell ii, and so on. Show how to simulate the two—way TM instructi
arrangement for a TM. H
16. On a certain two-way TM, the input is the single letter a surrounded by all A
nately, the TAPE HEAD is

‘Q‘ SYNTAX AS A METHOD FOR DEFINING LANGUAGES
224
CHAPTER 12
Context-Fre
Gramma
Because of the nature of early computer input devices, such as keypunches, paper tape,
netic tape, and typewriters, it was necessary to develop a way of writin

258 CHAPTER 12 Context-Free Grammars
(vi) 1+(2*(3+4)
(vii)1+(2*3)+4
20. Invent a form of preﬁx notation for the system of propositional calculus used in this,
chapter that enables us to write all well-formed formulas without the need for parentheg
ses (

Yet Another Method for Deﬁning Languages 53
determined by the prior state and the input instruction. Nothing else. No choice is involved.
N0 knowledge is requiredof the state the machine was in six instructions ago. Some se-
quences of input instructions

{e THE MOVE-IN-STATE MACHINE
494
CHAPTER 22
Turing machines can be drawn using different pictorial representations. Let us consider
diagram below, which looks like a cross between a Mealy and a Moore machine:
a/a,b/b a/a,b/b
This is a new way of writi

564
CHAPTER 23 TM Languages
Run each of the six encoded words on their respective machines to see which are in the lan-
guage ALAN.
14.
15.
16.
17.
18.
19.
20.
Can the code word for any TM be a palindrome? Prove your answer.
Decode the following words fro

CHAPTER 25
Computers
e DEFINING THE COMPUTER
594
The nite automata, as dened in Chapter 5, are only language-acceptors. When we gave them
output capabilities, as with Mealy and Moore machines in Chapter 8, we called them trans-
ducers. The pushdown auto

456 CHAPTER 19 Turing Machines
11. An alternate TM to accept EVEN-EVEN can be based on the algorithm:
1. Move up the string, changing as to As.
2. Move down the string, changing 17s to 88.
CHAPTER 20
We can modify this algorithm in the following

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 8: Finite Automata with Output
Chapter 8: Finite Automata with Output
Two equivalent theoretical machines with output are
introduced.
Dr. Nejib Zaguia
CSI3104-W11
1
Chapter 8: Finite Automata

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 7: Kleenes Theorem
Chapter 7: Kleenes Theorem
Regular expressions, Finite Automata, transition
graphs are all the same!
Dr. Nejib Zaguia
CSI3104-W11
1
Chapter 7: Kleenes Theorem
Method of pro

CSI 3104 /Winter 2011: Introduction to Formal Languages
Chapter 11: Decidability.
Chapter 11: Decidability
How to decide whether two regular expressions define the
same language? (can we?)
How to decide whether two finite automata accept the same
language

Chapter 2
Languages
2.1
Introduction
In English, there are at least three different types of entities: letters,
words, sentences.
letters are from a finite alphabet cfw_ a, b, c, . . . , z
words are made up of certain combinations of letters from the

Chapter 8
Finite Automata with Output
8.1
Moore Machines
Definition: A Moore machine is a collection of five things:
1. A finite set of states q0 , q1 , q2 , . . . , qn , where q0 is designated as the start
state.
2. A finite alphabet of letters for formi