Presentation is loading. Please wait.

Presentation is loading. Please wait.

September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins.

Similar presentations


Presentation on theme: "September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins."— Presentation transcript:

1 September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins

2 September1999 MON 12/2 FSMs WITH NO OUTPUT (10.3)

3 September1999 October 1999 Concepts/Vocabulary  Language concatenation  Kleene closure A*: concatenation of 0 or more strings from A  Finite-state automaton (FSA) M=(S,I,f,s 0,F): states S, input alphabet I, transition function f: S  I  S, initial state s 0, final states F  “Recognize” a string (series of inputs) that results in a series of transitions starting at s 0 and ending in any s  F  Nondeterministic FSA M=(S,I,f,s 0,F): transition function f: S  I  P(S) [power set of S]  “Recognizes” a string that can result in some series of transitions starting at s 0 and ending in any s  F  For any language recognized by a nondeterministic FSA, there is a deterministic FSA that recognizes the same language

4 September1999 October 1999 Examples  Exercise 10.3.5: Describe the elements of the set A* for the followingvalues of A:  (a) {10}  (c) {0, 01}  (d) {1, 101}  Exercise 10.3.15: Find the language recognized by the given deterministic FSA: Start s0s0 s1s1 s2s2 1 01 0 0,1

5 September1999 October 1999 Examples II  Exercise 10.3.21: Find the language recognized by the given nondeterministic FSA: Start s0s0 s1s1 s2s2 1 0 0 0,1 0 0 1 s3s3

6 September1999 October 1999 Examples III  Exercise 10.3.27/28: Find a deterministic FSA that recognizes each of the following sets, and a nondeterministic FSA that recognizes the set, and has fewer states than the dFSA (if possible)  (a) {0}  (b) {1, 00}  (c) {1 n | n=2, 3, 4, …}

7 September1999 WED 12/4 LANGUAGE RECOGNITION (10.4)

8 September1999 October 1999 Concepts/Vocabulary  Regular expressions: , = { }, x  I = {x}, (AB) [concatenation], (A  B) [union], and A* [Kleene closure]  Regular set: Any set that can be represented by a regular expression  Can be recognized using (deterministic) finite-state automata (Kleene’s Theorem)  “if” part proved by “constructive induction”  “only if” part left as **exercise 20  Regular set = regular (type 3) grammar!  (More powerful automata: Pushdown automaton, linear bounded automata)

9 September1999 October 1999 Examples  Exercise 10.4.3: Express each of the following sets using a regular expression:  (a) the set of strings of one or more 0s followed by a 1  (c) the set of strings with either no 1 preceding a 0 or no 0 preceding a 1  (d) the set of strings containing a string of 1s so that the number of 1s equals 2 modulo 3, followed by an even number of 0s  Construct a FSA for (d) above

10 September1999 October 1999 Examples II  Exercise 10.4.8: Construct a nondeterministic FSA that recognizes the language generated by the regular grammar G=(V,T,S,P) where V={0,1,S,A,B}, T={0,1}, S is the start symbol, and the set of productions is:  (b) S  1A, S  0, S , A  0B, B  1B, B  1

11 September1999 FRI 12/6 TURING MACHINES (10.5)

12 September1999 October 1999 Concepts/Vocabulary  Turing machine: general model of computation  Inventor Alan Turing  T=(S,I,f,s 0 ): states S, alphabet I that includes blank symbol B, partial function f: S  I  S  I  {R,L}, and start state s 0  S  Control unit has states S; read/write tape is infinite in both directions; single read/write head takes input from the tape, writes to the tape, and moves left or right  Specify as 5-tuples (s, x, s’, x’, d): in state s, if you read x, transition to state s’, output x’, and then move one step in direction d

13 September1999 October 1999 Concepts/Vocabulary II  Halting and language recognition  T halts if f is undefined (i.e., no 5-tuple) for (s, x)  A final state is a state that no 5-tuple begins with (i.e., no transitions are defined from the state)  A string is recognized if T halts in a final state  A string is not recognized if T doesn’t halt, or halts in a state that isn’t final  Any problem that can be solved, or algorithm that can be written, with a digital computer, can also be solved with a Turing machine, despite its simplicity!  Church-Turing thesis: Any problem that can be solved with an effective algorithm can be solved with a Turing machine

14 September1999 October 1999 Examples  Example 10.5.2: Find a Turing machine that recognizes the set of bit strings that have a 1 as their second bit (that is, the regular set (0  1)1(0  1)*).  Example 10.5.3: FInd a Turing machine that recognizes the set {0 n 1 n | n  1}


Download ppt "September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins."

Similar presentations


Ads by Google