Module 7
Properties of context-free languages
What are the boundaries of being context free?
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
7.1
Topics for this module
Normal forms for context-free grammars
The pum
CS 360 Introduction to the Theory of Computing
Spring 2007
Assignment 2
Due: Friday, June 8 at 4:00 pm
1. [10 points] Let = cfw_0, 1 and dene a language A over as follows:
A = cfw_www : w .
For example, these are strings in A: , 000, 111, 000000, 010101,
CS 360 Assignment 2
Due Friday, June 20, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; see t
CS 360 Assignment 1
Due Friday, May 23, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; see th
FINAL EXAMINATION
FALL TERM 2014
Student Name (Print Legibly)
(family name)
(given name)
Signature
Waterloo Student ID Number
COURSE NUMBER
CS 360
COURSE TITLE
Introduction to Theory of Computing
COURSE SECTION
001
DATE OF EXAM
Friday, December 12, 2014
T
MID-TERM EXAMINATION 2
FALL TERM 2014
Student Name (Print Legibly)
(family name)
(given name)
Signature
Waterloo Student ID Number
COURSE NUMBER
CS 360
COURSE TITLE
Introduction to Theory of Computing
COURSE SECTION
001
DATE OF EXAM
Thursday, November 13,
CS 360 - MODULE 7 - ADDITIONAL NOTES
COLLIN ROBERTS
1. Example of Creating a CNF Grammar From An Arbitrary Grammar
Recall the grammar for palindromes over = cfw_0, 1:
G : S |0|1|0S0|1S1.
Here we create a new CNF grammar G such that L(G) = L(G ) cfw_.
(1)
Module 9
Undecidability
What computers cannot do.
CS 360: Introduction to the Theory of Computing
Winter 2015
Collin Roberts
University of Waterloo
1
Topics for this module
An undecidable language
Other undecidable languages
Reduction: how to prove a give
Module 7
Properties of context-free languages
What are the boundaries of being context free?
CS 360: Introduction to the Theory of Computing
Winter 2015
Collin Roberts
University of Waterloo
1
Topics for this module
Normal forms for context-free grammars
Module 5
Context-free grammars and languages
Building a connection between human language and formal language
CS 360: Introduction to the Theory of Computing
Winter 2015
Collin Roberts
University of Waterloo
1
Topics for this module
Context-free grammars
CS 360 Assignment 3
Due on Friday, June 27, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; se
CS 360 Assignment 2
Due Friday, October 10, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; se
CS 360 Assignment 5
Due Friday, November 28, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; s
CS 360 Assignment 2
1. We assume towards a contradiction that A is regular. Then, due to the Pumping
Lemma, there exists a pumping length n 1 such that every string s A of length at
least n can be written as s = xyz, satisfying the following three conditi
CS 360 Introduction to the Theory of Computing
Spring 2007
Assignment 1 Solutions
1. [12 points] Give a DFA that recognizes the language
L1 = cfw_w cfw_a, b, c : every c in w is immediately preceded by aa.
For example: the strings aab, baaca, and are in L
CS 360 Introduction to the Theory of Computing
Fall 2016
Lecture Notes
Tuesday, Thursday at 11:30am
Class 01 September 8th
This course focuses on these questions:
(a) what are the fundamental capabilities and limitations of computers?
(b) What kind of pro
Lecture 3
Nondeterministic finite automata
This lecture is focused on the nondeterministic finite automata (NFA) model and its
relationship to the DFA model.
Nondeterminism is an important concept in the theory of computing. It refers
to the possibility o
Lecture 5
Proving languages to be nonregular
We already know that there exist languages A S that are nonregular, for any
choice of an alphabet S. This is because there are uncountably many languages in
total and only countably many regular languages, over
CS 360 Assignment 1
Due Friday, Sept 26, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it; see t
CS 360 Assignment 3
Due on Friday, October 31, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it;
CS 360 Assignment 4
Due on Friday, November 7, 4:00 PM
You should start as early as possible, and contact course staff if you get stuck.
This assignment is worth between 0% and 4% of your mark in the course, depending on how many
points you receive on it;
Module 6
Pushdown automata
The automata for context-free languages
CS 360: Introduction to the Theory of Computing
Winter 2015
Collin Roberts
University of Waterloo
1
Topics for this module
Pushdown automata denitions
Languages of pushdown automata
The eq
Module 8
Introduction to Turing machines
Simplifying computers down to automata?
CS 360: Introduction to the Theory of Computing
Winter 2015
Collin Roberts
University of Waterloo
1
Topics for this module
Introduction to the limits of programs.
Turing mach
Module 3
Regular languages and regular
expressions
What can a computer do with no memory?
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
3.1
Topics of Module 3
Regular Expressions
Regular Languages
Kleenes Theore
Module 2
Finite Automata
The simplest computers for the simplest languages
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
2.1
Topics of Module 2
Deterministic nite automata
Nondeterministic nite automata and the e
Module 5
Context-free grammars and
languages
Building a connection between human language and formal
language
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
5.1
Topics for this module
Context-free grammars and lang
Module 4
Properties of regular languages
Not everything is regular.
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
4.1
Topics for Module 4
Proving languages non-regular: the Pumping Lemma
Closure rules for regular
CS 360 - MODULE 6 - ADDITIONAL NOTES
COLLIN ROBERTS
1. Example: From Final State to Empty Stack
Input:
G
q0
s
, Z0 /Z0
1, 0/
G
q1
s
,Z0 /Z0
G
q2
1,0/
0, Z0 /0Z0
0, 0/00
Output:
G
s
,Z0 /Z0 X0
G
q0
s
, Z0 /Z0
1, 0/
G
q1
s
,Z0 /Z0
G
q2
,/
1,0/
0, Z0 /0Z0
0,
Module 6
Pushdown automata
The automata for context-free languages
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
6.1
Topics for this module
Pushdown automata denitions
Languages of pushdown automata
The equivalence
Module 9
Undecidability
What computers cannot do.
CS 360: Introduction to the Theory of Computing
Collin Roberts, University of Waterloo
9.1
Topics for this module
An undecidable language
Other undecidable languages
Reduction: how to prove a given languag
Lecture 1
Course overview and mathematical
foundations
1.1 Course overview
This course is about the theory of computation, which deals with mathematical properties of abstract models of computation and the problems they solve. An important idea to keep in