Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Limitations - Automata and Complexity Theory - Lecture Slides, Slides of Theory of Automata

Some concept of Automata and Complexity Theory are Administrivia, Closure Properties, Context-Free Grammars, Decision Properties, Deterministic Finite Automata, Intractable Problems, More Undecidable Problems. Main points of this lecture are: Limitations, Finite Automata, Regular Languages, Containing Pattern, Followed, Same Number, Patterns, Prime, Divisible, Design

Typology: Slides

2012/2013

Uploaded on 04/29/2013

juni
juni 🇮🇳

4

(17)

122 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Limitations of finite automata
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Limitations - Automata and Complexity Theory - Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

Limitations of finite automata

Many examples of regular languages

q 0 q

0 1 1 0

(^1 0 )

0, 1 q 0 q 1 q 2 q 3

all strings not containing pattern 010 followed by 101

Is every language regular?

Which are regular?

• How about:

• Let’s try to design a DFA for it

… it appears that we need infinitely many states!

L 1 = {0n 1 m: n, m ≥ 0} = 01, so regular

L 2 = {0n 1 n: n ≥ 0} = {ε, 01, 0011, 000111, …}

A non-regular language

• Theorem

• To prove this, we argue by contradiction:

  • Suppose we have managed to construct a DFA M

for L 2

  • We show something must be wrong with this DFA
  • In particular, M must accept some strings not in L 2

The language L 2 = {0n 1 n: n ≥ 0} is not regular.

A non-regular language

• What happens when we run M on input x =

0 n+1 1 n+1?

  • M better accept, because x ∈ L 2
  • But since M has n states, it must revisit at least one

of its states while reading 0 n+

M

x (^0 0 0 )

0

0 r 1 n+

Pigeonhole principle

• Here, balls are 0 s, bins are states:

Suppose you are tossing n + 1 balls into n

bins. Then two balls end up in the same bin.

If you have a DFA with n states and it reads

n + 1 consecutive 0 s, then it must end up in

the same state twice.

A non-regular language

• The DFA will then also accept strings that go

around the loop multiple times

• But such strings have more 0 s than 1 s, so they

are not in L 2!

M

0 0 0 0

0

0 r 1 n+

General method for showing non- regularity

  • Every regular language L has a property:
  • For every sufficiently long input z in L, there is

a “middle part” in z that, even if repeated several times, keeps the input inside L

z (^) a (^1) … ak ak+1 … an-

an

an+1…am

Proving non-regularity

• If L is regular, then:

• So to prove L is not regular, it is enough to

show:

There exists n such that for every z in L, we

can write z = u v w where |uv| ≤ n, |v| ≥ 1

and

 For every i ≥ 0, the string u v i^ w is in L.

For every n there exists z in L, such that for

every way of writing z = u v w where

|uv| ≤ n and |v| ≥ 1, the string u v i^ w is not

in L for some i ≥ 0.

Proving non regularity

• This is a game between you and an imagined

adversary

For every n there exists z in L, such that for

every way of writing z = u v w where

|uv| ≤ n and |v| ≥ 1, the string u v i^ w is not

in L for some i ≥ 0.

adversary choose n write z = uvw (|uv| ≤ n,|v| ≥ 1)

you choose z ∈ L choose i you win if uv iw ∉ L

1 2

Example

• L 2 = {0n 1 n: n ≥ 0} Σ = {0, 1}

adversary choose n write z = uvw (|uv| ≤ n,|v| ≥ 1)

you choose z ∈ L choose i you win if uv iw ∉ L

1 2

adversary choose n write z = uvw (|uv| ≤ n,|v| ≥ 1)

you z = 0n+1 1 n+ i = 2 uv iw = 0j+2k+l 1 n+ = 0n+1+k 1 n+ ∉ L

1 2 u = 0j, v = 0k, w = 0l 1 n+ j + k + l = n + 1

More examples

L 3 = {1n: n is divisible by 3} L 4 = {1n: n is prime}

L 5 = {x: x has same number of 0s and 1s}

L 6 = {x: x has same number of patterns 01 and 10} L 7 = {x: x has more 0s than 1s} L 8 = {x: x has different number of 0s and 1s}