1 / 14

CMSC 203 / 0201 Fall 2002

CMSC 203 / 0201 Fall 2002. Week #15 – 2/4/6 December 2002 Prof. Marie desJardins. MON 12/2 FSMs WITH NO OUTPUT (10.3). Concepts/Vocabulary. Language concatenation Kleene closure A*: concatenation of 0 or more strings from A

ima
Download Presentation

CMSC 203 / 0201 Fall 2002

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Concepts/Vocabulary • Language concatenation • Kleene closure A*: concatenation of 0 or more strings from A • Finite-state automaton (FSA) M=(S,I,f,s0,F): states S, input alphabet I, transition function f: SIS, initial state s0, final states F • “Recognize” a string (series of inputs) that results in a series of transitions starting at s0 and ending in any sF • Nondeterministic FSA M=(S,I,f,s0,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 s0 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. 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: 1 0 s1 Start s2 s0 0 1 0,1

  5. Examples II • Exercise 10.3.21: Find the language recognized by the given nondeterministic FSA: 1 0,1 1 0 s1 Start s2 s0 s3 0 0 0

  6. 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) {1n | n=2, 3, 4, …}

  7. WED 12/4LANGUAGE RECOGNITION (10.4)

  8. 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. 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. 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. FRI 12/6TURING MACHINES (10.5)

  12. Concepts/Vocabulary • Turing machine: general model of computation • Inventor Alan Turing • T=(S,I,f,s0): states S, alphabet I that includes blank symbol B, partial function f: SI  SI{R,L}, and start state s0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. 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. 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 {0n1n | n  1}

More Related