0408-notes

0408-notes - CPSC 121 Lecture 36 April 8 2009 Menu April 8...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CPSC 121 Lecture 36 April 8, 2009 Menu April 8, 2009 Topics: Example: NFA to DFA Conversion Final Reading List Learning Goals Summary The End! Reminders: On-line Quiz 12 deadline 5:00pm TODAY Teaching evaluation survey now available on-line — deadline 23:00 April 12 Review session (Steve): Thu April 9, 9:00, DMP 310 Review session (Bob): Thu April 16, 14:00, DMP 110 Final exam Friday, April 17, 7:00pm, SRC A READ the WebCT Vista course announcements board Example: NFA to DFA Conversion The proof given in Lecture 35 that NFAs are not more powerful than DFAs shows explicitly how to construct a DFA corresponding to any given NFA. Let’s demonstrate that construction for the specific example of the decimal number NFA (also first given in Lecture 35). The “slides” version of the lecture animates the construction, step by step. The figure given here in the “with notes” version shows only the final result. The steps, however, are described in words. Recall the NFA... Recall: Decimal Number NFA int dot real S S 1 0-9 0-9 0-9 0-9 The NFA has five (named) states: s , s 1 , int , dot and real . Two of the states, s and s 1 , are initial states. Two of the states, int and real , are accepting states. Each state in the DFA corresponds to an element of the power set of the sets of states in the NFA. Thus, our DFA (potentially) has 2 5 = 32 states. Fortunately, as is the case in our example, not all states in the resulting DFA always are reachable. (Non reachable states are eliminated in the construction). We name each state in the DFA explicitly, using set notation, according to which element it is in the power set of the sets of states in the NFA. For example, the state in the DFA corresponding to the states s 1 and int in the NFA is named { s 1 , int } We begin with the start state of the DFA and continue adding reachable states until the entire DFA is constructed. 1. The start state of the DFA is the state corresponding to the subset of all start states in the NFA. The start states in the NFA are s and s 1 . Thus, the start state in the DFA is { s , s 1 } . Create this as a state in the DFA and label it accordingly. (This is shown as the first step in the “slides” version animation). 2. We now consider possible next states when the DFA is in state { s , s 1 } . That is, we consider possible next states when the NFA is in either state s or in state s 1 . For input- 9 and the NFA in state s or s 1 , the next states are either s 1 or int . Create a state in the DFA named { s 1 , int } and add the associated labelled arc from the start state. The state { s 1 , int } in the DFA is designated as an accepting states since one of its members, int , is an accepting state in the NFA....
View Full Document

{[ snackBarMessage ]}

Page1 / 9

0408-notes - CPSC 121 Lecture 36 April 8 2009 Menu April 8...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online