COSC 3340: Introduction To Theory of Computation
COSC 3340: Introduction To Theory of Computation
Computation
University of Houston
Dr. Verma
Lecture 15
Ans: No.
How do we know this?
– Ans: Cardinality arguments.
Let C(CFG) = {G | G is a CFG}. C(CFG) is a
countable set. Why?
Let AL = { L | L is a subset of *}. AL is
uncountable.
The parse tree must contain some long path from the
start variable at the root of the tree to one of
the terminal symbol at a leaf. On this
T
long path some variable symbol ..
..
R must repeat because of the R
pigeonhole principle. ..
.
R
u v x y z
We start with a smallest parse tree with yield s
x
u z
a…ab…bc…c |vy| 0
|vxy| p
p p p
|w| = 3p p
Case 1:
– Both v and y contain only one type of alphabet symbols, v
does not contain both a’s and b’s or both b’s and c’s and the
same holds for y. Two possibilities are shown below.
a…ab…bc…c
v y/v y
Case 2:
– Either v or y contain more than one type of alphabet
symbols. Two possibilities are shown below.
a…a … a b b b… b c … c
v y/v y