theory of computation (fall 2014): beyond regularity: proofs by contradiction, pumping lemma proofs,...
DESCRIPTION
TRANSCRIPT
Theory of Computation
Beyond Regularity:Proofs by Contradiction,Pumping Lemma Proofs,
Pumping Lemma & Finite Languages
Vladimir Kulyukin
Outline
● Proofs by Contradiction● Detailed Pumping Lemma Proofs● Pumping Lemma & Finite Languages
Beyond Regularity
● Are there languages that cannot be recognized by finite state automata?● Yes, there are: anbn is one of the languages that cannot be recognized
by any FSA ● In general, any language whose strings have symbolic dependencies
(the number of some symbol depends on the number of some other symbol) cannot be recognized by an FSA
Proof by Contradiction● Pumping Lemma applications are examples of a proof technique known
as proof by contradiction● Proof by contradiction is used to prove statements of the form
IF A THEN B● A typical use of this technique consists of two steps:
Assume that A is true and B is false
Find a contradiction, i.e., a statement that contradicts another statement known to be true; that statement can be A itself, which is assumed to be true
Proof by Contradiction
● Why does proof by contradiction works?● It works because the statement IF A THEN B is true in all cases except
when A is true and B is false● Proof by contradiction allows us to rule out that case by finding a
contradiction● It is this contradiction that proves the original statement IF A THEN B
because it excludes the only case under which this statement can be false
Three Questions about Proof by Contradiction● What contradictions can/should we look for?
No general answer but experience, intuition, and insight● How can we use the assumptions that A is true and B is false to
reach a contradiction? Work forward from both assumptions and see what shakes
loose● When can/should we use proof by contradiction?
A reliable indicator is the word not in the statement B
Proof by Contradiction: Example
If r is a real number such that r2 = 2, then r is not rational (irrational)
A: r is a real number such that r2 = 2B: r is not rational (irrational)
Proof by Contradiction: Example
Assume A and NOT B:A: r is a real number such that r2 = 2NOT B: r is rationalNow we have to find a contradiction
Proof by Contradiction: Example
If r is rational (remember that NOT B is assumed to be true), then r = p/q, q != 0
We can assume that p and q have no common divisors (aka mutually prime); if they had, they could be divided out.
Proof by Contradiction: Example
Since r = p/q, r2 = (p/q)2.Since r2 = 2, then 2 = (p/q)2.Since 2 = (p/q)2, 2q2 = p2.Since p2 = 2q2, p2 is even.Since p2 is even, p is even.
Proof by Contradiction: Example
Since p is even, p = 2k, where k is an integer.
Since 2q2 = p2, 2q2 = (2k)2 = 4k2.
Since 2q2 = (2k)2 = 4k2, q2 = 2k2.
Since q2 = 2k2, then q is even.
But then, since both p and q are even,
they have at least one common divisor.
We found a contradiction because p and q were assumed to have no common divisors.
Proof by Contradiction: Example
Since p is even, p = 2k, where k is an integer.
Since 2q2 = p2, 2q2 = (2k)2 = 4k2.
Since 2q2 = (2k)2 = 4k2, q2 = 2k2.
Since q2 = 2k2, then q is even.
But then, since both p and q are even,
they have at least one common divisor.
We found a contradiction because p and q were assumed to have no common divisors.
Pumping Lemma Examples
Review: Pumping Lemma
.0for , and 1 where
, can write Then we . and Let
states. DFA with a is where,Let
iLwuvv
uvwxnxLx
nMMLL
i
Review: Pictorial Insight
q0 q’q
M
u
v
w
nxuvwx ,
Pumping Lemma Use
● Pumping Lemma is not used to prove that languages are regular● Pumping Lemma states that if a language is regular, then its
strings have a specific property (pumping property)● Pumping Lemma is used to show that languages are not
regular: assume that a language is regular and then show that a specific string does not satisfy the pumping property
Pumping Lemma Example: Proof 1
ion.contradict a achieve wecases, 3 theofeach In .
Thus, ., , If . Thus, s.'
follow s' wherestring a is , If .
Thus, ., , If .;
; :for choices 3 are There .0,
Then .1 ,Then .||,Let
Lemma. Pumping theofconstant thebe Let :1 Proof
regular.not is | :Claim
0
02
20
0
Lwuv
kmbawuvbvLwuvb
awuvbavLwuv
mkbawuvavbvbav
avvmbaz
vuvwznzLz
n
NkbaL
km
mk
mm
kk
Pumping Lemma Example: Proof 1
regular.not is Hence, s.' ofnumber the
an greater thstrictly isy in s' ofnumber thebecause ,
, Since .Consider .for choice
only theis Thus, states. 1 of sequence processing a
needs states DFA with the, process To .1,
Lemma, Pumping By the .||,Then .Let
Lemma. Pumping theofconstant thebe Let :2 Proof
regular.not is | :Claim
2
Lb
aLy
avuvvwwuvyv
avn
navuvwz
nzLzbaz
n
NkbaL
n
nn
kk
Pumping Lemma & Finite Languages
● Any finite language is regular● We can construct a finite automaton for each individual
string (that automaton will accept that string and only that string)
● The individual automaton can then be compiled into one union automaton that accepts all strings in that language
Pumping Lemma & Finite Languages● Does the Pumping Lemma contradict the regularity of finite
languages?● No, because for any finite language we can find the length of the
longest string (say n)● The Pumping Lemma's statement is vacuously true for all strings
whose length is greater than n, because there are no such strings in the language
● So we do not get any contradiction out of the Pumping Lemma for finite languages
References & Reading Suggestions
● Davis, Weyuker, Sigal. Computability, Complexity, and Languages, 2nd Edition, Academic Press
● Brooks Webber. Formal Language: A Practical Introduction, Franklin, Beedle & Associates, Inc
● Hopcroft and Ullman. Introduction to Automata Theory, Languages, and Computation, Narosa Publishing House
● D. Solow. How to Read & Do Proofs, Wiley & Sons