0% found this document useful (0 votes)
38 views10 pages

Class Discussion: Can You Draw A DFA That Accepts The Language (A B - K 0,1,2, ) Over The Alphabet (A, B) ?

The document discusses proofs that certain languages are non-regular by using contradictions. It first proves that the language {a^ib^i | i >= 0} is non-regular by showing that if there was a DFA that accepted it, there would be a string it should accept but does not. It then shows another example language {1^k2 | k > 0} is non-regular using a similar proof. It also introduces the pumping lemma for regular languages and proves it holds by considering repeated states in a DFA. Finally, it poses proving a new language of strings with one more 1 than 0s is non-regular as a discussion question.

Uploaded by

theresa.painter
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views10 pages

Class Discussion: Can You Draw A DFA That Accepts The Language (A B - K 0,1,2, ) Over The Alphabet (A, B) ?

The document discusses proofs that certain languages are non-regular by using contradictions. It first proves that the language {a^ib^i | i >= 0} is non-regular by showing that if there was a DFA that accepted it, there would be a string it should accept but does not. It then shows another example language {1^k2 | k > 0} is non-regular using a similar proof. It also introduces the pumping lemma for regular languages and proves it holds by considering repeated states in a DFA. Finally, it poses proving a new language of strings with one more 1 than 0s is non-regular as a discussion question.

Uploaded by

theresa.painter
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

Class Discussion

Can you draw a DFA that accepts the language {akbk | k = 0,1,2,} over the alphabet ={a,b}?

Limitations of FA
Many languages are non-regular: {anbn | n = 0,1,2,} {0i2 | i 0,1,2,} p {0 | p is a prime number } the set of all well-formed parentheses over the alphabet ={(, )} the set of all palindromes over the alphabet ={a, b} ...

Why Impossible?
We want to prove that L = {aibi | i = 0,1,2,} is non-regular. Prove by contradiction: Assume that there is a DFA M that recognizes L. Let n be the total number of states in M. Consider the path followed by the input string anbn in M:
q(0) a q(1) a a q(n) b q(n+1) b ... b q (2n) ...

Why Impossible?
Since M has only n states, there must be at least one state visited twice in the first n transitions. Let this state be visited at the ith and the jth steps, where j > i.

q(i) = q(j)
q(2n) F q(0)

The path in M when reading anbn

By skipping the loop, an-(j-i)bn should also be accepted, but this is contradictory since an-(j-i)bnL

Another Example
We want to prove that L = {1k2 | k > 0} is nonregular. Prove by contradiction: Assume that there is a DFA M that recognizes L. Let n be the total number of states in M. M should also accept the string 1n2
q(0) 1 q(1) 1 q(2) 1

1 q( 2) n ...

Another Example
Since n2 n and M has only n states, there must be at least two equal states from q(0) to q (n2). Let q(i) = q(j) be the first repeated state where j-i = m n.
q(i) = q(j) q(n2 ) F The path in M n2 when reading 1

a loop of length m q(0)

By repeating the loop one more time, 1(n2+m) is also accepted by M, which is a contradiction, since (n2+m) cannot be a square (the next square after n2 is (n+1)2 but n2+m < (n+1)2).

Pumping Lemma for Regular Set


If L be a regular language, there is a constant n such that if z is any word in L and |z| n, we can write z = uvw in such a way that |uv| n, |v| 1, and for all i 0, uviw is in L. (This constant n can be the number of states of a DFA accepting L.)

Proof of Pumping Lemma


If L is a regular language, there are DFAs that recognize L. Let n be the number of states in one such DFA (called M) recognizing L. If z is a word in L with |z| = k n:
q(0) z(1) q(1) z(2) q(2) z(3) ... z(k) q(k)

where z(i) is the ith symbol of the string z. Since k n and M has only n states, there must be at least one repeated states from q(0) to q(k). Let q(i) be the first such repeated state.

Proof of Pumping Lemma


q(i)

q(0)

a path in M

q(k) F

Let u be the string obtained by traversing from q(0) to q(i), and v be the string obtained by traversing the loop once (|v|1). In the traversal from q(0) to q(i) and then through the loop once back to q(i), nothing except q(i) repeats, so |uv| n. By traversing the loop 0 or more times, we obtain uviw where i 0. These strings should all be accepted by M since they can all reach q(k) which is a final state in M.

Class Discussion
Prove that the set of all strings over {0,1} such that the number of 1s is one more than the number of 0s is non-regular.

You might also like