27
Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory http://www.utdallas.edu/ ~pervin Thursday: EXAMINATION 1 Tuesday: Context-free Languages Tuesday 9-30-14

Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

Embed Size (px)

Citation preview

Page 1: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

Erik Jonsson School of Engineering and Computer Science

FEARLESS Engineering

CS 5349 – 001 CS 4384 – 001

Automata Theory

http://www.utdallas.edu/~pervin

Thursday: EXAMINATION 1

Tuesday: Context-free LanguagesTuesday 9-30-14

Page 2: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

TA

S. S. [email protected] 2.103B1 (West side Open Lab/ TI)MW 1:30-3:30 and other hours possible

2

Page 3: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

Extra AssignmentOnly for CS 5349 Students!

3

Page 4: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

4

Page 5: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

The Pumping Lemma Game

We play against an opponent. Our goal is to win the game by establishing a contradiction to the PL, while the opponent tries to foil us. There are four moves in the game.

1) The opponent picks p.2) Given p we pick a string s(p) in L of length ≥ p. 3) The opponent chooses the decomposition xyz subject

to |xy| ≤ p, |y| ≥ 1. We have to assume that the opponent makes the choice that will make it harder for us to win the game.

4) We pick i so that the pumped string is not in L.

5Don't forget! It will be on the comprehensive final exam!

Page 6: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

6

Page 7: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

7

Page 8: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

8

Page 9: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

9

In class I pointed out that intersecting with the regular language a* makes the problem slightly easier because one would have to pick the s_p we used above.

Page 10: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

10

Theorem: Let M be a DFA with p states.

(i) L(M) is not empty iff M accepts a string z with |z| < p.

(ii) L(M) has an infinite number of members iff M accepts a string z with p <= |z| < 2p.

In each case we used the Pumping Lemma to pump “down” to show that the smallest member of the language cannot be of length (i) greater or equal to p; (ii) greater or equal to 2p.

Decision Procedures

Page 11: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

11Slightly modified

Page 12: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

12M&S P. 84 #2.20(4)

_

Page 13: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

13M&S Problem 2.21

See M&S P. 85 #2.26-2.28

Page 14: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

14

Page 15: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

15

Page 16: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

16Martin, P.120 #6.8b

Page 17: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

17Linz, P. 89 #9b

Page 18: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

18Du, P. 53, Example 9.3

Page 19: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

19M&S, P. 64

a*b[(b + ab*a)a*b]*

BOOK:

Page 20: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

20

In class, on the board, I considered the language L = {ww^R | w \in {a,b}*}. (Where w^R is the word w reversed.) I suggested s(p) = a^pbba^p would work for the Pumping Lemma since the two b’s must be and the end of w and the beginning of w^R so our opponent must choose y consisting only of a’s and the b’s would still indicate the middle of the pumped string.

Page 21: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

21

Page 22: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

22

Page 23: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

23

Example: Sudkamp 2-22The set of strings over {a,b} with an even number of a’s and an even number of b’s.

Slide #16 from first class!

Page 24: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

24

Page 25: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

25

Page 26: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

Left-Linear Grammars26

Page 27: Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 5349 – 001 CS 4384 – 001 Automata Theory pervin

27