This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS103 HO#28 Finite Automata II 4/22/11 1 Note: It is important to do the reading in the Sipser text. You should try to understand it line by line. Come to office hours , write us with questions, or talk to your classmates! Suppose L = {w { a , b } *  no two consecutive characters are the same} q 1 a b b a a, b q 2 q 3 q 4 a b last character a, only b OK reject input last character b, only a OK Q = {q 1 , q 2 , q 3 , q 4 } = {a, b} q 1 is the start state F = {q 1 , q 2 , q 3 } a b q 1 q 2 q 3 q 2 q 4 q 3 q 3 q 2 q 4 q 4 q 4 q 4 Suppose L = {w  w = a m b n for m, n > 0} q 1 b a q 2 q 4 q 3 a a b b a, b Suppose L = {w  w is the string representation of a floating point number } d . d +, E d d d d d +, d E +2.0 532.67 0.3E123 1.5006E+270.4E26E8 d stands for any decimal digit (transitions to nonaccepting state for illegal inputs not shown) Let = {a, b, c, d} Let L Missing = {w  there is a symbol from not in w} Start state: all letters missing After one character, the state could be a read, b, c, d still missing b read, a, c, d still missing c read, a, b, d still missing d read, a, b, c still missing After two characters, the state could be any of the previous, or a, b read, c, d still missing a, c read, b, d still missing ... After three characters, ... Some Important Definitions Let M = (Q, , , q , F) be a finite automaton and let w = w 1 , w 2 , ..., w n be a string where each w i . Then m accepts w if there exists a sequence of states r , r 1 , ..., r n in Q such that: 1. r = q , 2. (r i , w i+1 ) = r i+1 for i = 0, 1, ..., n 1, and 3. r n F. q 1 a b b a a, b q 2 q 3 q 4 a b Q = {q 1 , q 2 , q 3 , q 4 } = {a, b} q 1 is the start state : Q Q F = {q 1 , q 2 , q 3 } a b q 1 q 2 q 3 q 2 q 4 q 3 q 3 q 2 q 4 q 4 q 4 q 4 CS103 HO#28 Finite Automata II 4/22/11 2 Some Important Definitions Let M = (Q, , , q , F) be a finite automaton and let w = w 1 , w 2 , ..., w n be a string where each w i . Then m accepts w if there exists a sequence of states r , r 1 , ..., r n in Q such that: 1. r = q , 2. (r i , w i+1 ) = r i+1 for i = 0, 1, ..., n 1, and 3. r n F. We say that M recognizes language A if A = { w  M accepts w } A language is called a regular language if some finite automaton recognizes it. More Important Definitions Let A and B be languages. We define the regular operations union, concatenation, and star as follows: Union : A B = { x  x A or x B } Concatenation : A B = { xy  x A and y B } Star : A * = { x 1 x 2 ... x k  k 0 and each x i...
View
Full
Document
This note was uploaded on 06/01/2011 for the course EE 103 taught by Professor Plummer during the Spring '11 term at Stanford.
 Spring '11
 PLUMMER

Click to edit the document details