This was the second last lecture. There were a lot of things going on, and I would like to review them carefully. 1. We recalled the concept of Finite State Automaton (DFSA). This can be thought of as a simple machines that define a language over a certain alphabet. - An DFSA will ACCEPT or REJECT each of the possible inputs, which are Sigma^*. - The language associated with an DFSA is the set of inputs that the DFSA accepts. - The way an DFSA work is in steps. At each step, the DFSA reads one character from the input, and move between STATES. - The initial state is a special state called q_0. - The transition function delta determine how to move from a state to the next state. - The final state, after reading all the string will determine if the string should be accepted or not. This depends on whether that last state is in F, the set of accepting states. things to think about: what happens if F is the empty set? what can be said about the language defined by such an DFSA? what if F is the whole set of states Q? How can we tell whehther the empty string be inthe language or not? We then considered the trnsition function, delta, and its extension the get a state and a string. The definition of delta* is inductive (induction on strings): delta*(q,epsilon) = q delta*(q, xa ) delta( delta*(q,x), a) (remember: strings can be defined inductively as follows "a string is epsilon, the empty string, or it is a string with an additional symbol, that is xa where x is a string, a a symbol in the alphabet) 2. We saw examples to three languages L1 = {x in {0,1}* : |x| is even } L2 = {x in {0,1}* : x starts with 01 } L3 = {x in {0,1}* : x contains 011 } and found DFSA for each on of them. Let me just remind you the very simple example for M1, the DFSA for which L(M1) = L1. M1 has two states, q0, q1. The transition is that whatever character read by M1 it changes state. Further, F = {q0}. To prove that indeed, L(M1) = L1, we show inductively on strings that delta*(q0,x) = q0 if |x| is even and q1 if |x| is odd. Showing this is easy, and this implies what we want, because it shows that the terminal state is q0 if x is in L and q1 if not, and since F = {q0} we get L(M1)= L1. Please review the other machines for L2 and L3 that I presented in class. 3. We saw that all three languages above can be expressed using regular expressions. Specifcially, L1 = L( ((0+1)(0+1))* ) L2 = L( 01 (0+1)* ) L3 = ( (0+1)* 011 (0+1)* ) This is not a conincidence. What do I mean by that? There is a theorem that says that every language that is accepted by a DFSA has a regular expression defining it and vice versa. Let's say it more carefully. DEFINITION: A language L is called a "regular language" if there is a DFSA M such that L = L(M) THM: A language L is regular if and only if there is a regular expression R such that L = L(R) 4. A notion that seems a little strange at first, and is partly motivated by its usefulness in proving the important theorem above is the notion of NONDETERMINISTIC Finite State Automaton, or NFSA for short. An NFSA is defined in a similar way to FSA, accept that the transition function may "choose" to move to any one of several possible states. More precisely, given a state q and a symbol a, delta(q,a) is a set of possible states, rather than just one state as in the case with FSA. We saw that it can be useful to design an NFSA to certain languages. For instance, for language L3 above, one could have a machine that at any point may "try" to find the pattern 001, but doesnt have to. Refer to the diagram I drew in class. Please go over the examples in section 7.4 of the text. We will see in the last class that this notion of NFSA is equivalent to FSA, in the sense that a lanugage is accepted by some FSA if it is accepted by some NFSA.