Let L be a regular language with
https://omereingold.files.wordpress.com/2019/10/lec3p.pdf
2} {w
Feb 13 2015 1. Q: Let ? = 1a
Dec 4 2015 1. DFAs: Design a DFA for each of the following languages (all over the ... (a) (5 points) {w
Feb 16 2004 (b) {w G {0
Mar 18 2002 {ww starts with 0 and has odd length
{w
1. Give NFAs with the specified number of states recognizing each of the (b) Prove that L has a regular expression where L is the set of strings ...
A Suppose some regular expression of length ????can be converted an NFA for some ?????? B Suppose each regular expression of length ????can be converted an NFA for some ?????? C Suppose each regular expression of length at most k can be converted an NFA for some ?????? D None of the above
{ w w = ? or every odd position in w is a 1 } Transform a DFA for L into a regular expression by removing states and re-labeling the arcs with regular expressions
2 (Sipser problem 1 31) For any string w = w 1w 2 ···w n the reverse of w written as wR is the string w in reverse order w n ···w 2w 1 For any language A let AR = {wR w ? A} Show that if A is regular so is AR [20 points] Solution: One solution is recursively (or inductively) de?ne a reversing operation on regular
{q n+1} if q ?F and c =w n+1 q 0?=q 0 F ?={q n+1} We propose that M ? recognizes L ? Since the first part of ?? follows the same path that w would take through L we know that reading w will terminate at some state q ?F Q? added a single state that is only reachable from the states in F on character w n+1 If there are any
1 0 0 0 1 0;1 c The language fW: W contains an odd number of 1’s or exactly two 0’sg The NFA must have six states: 1 1 0 0 0 0 1 1 " " 1 6 Q: Give regular expressions describing the following languages in which the alphabet is f0;1g: A: a fW: W has length at least 3 and its second symbol is 1g: 1 b fW: Every odd position of W is a 0g
•Lemma (1 55): If L is described by a regular expression R then there exists an NFA that accepts it Proof: For each type of regular expression develop an NFA that accepts it R= a a ?? R= R 1 ?R 2 R 1 R 2 are regular R= ? R= R 1 R 2 R 1 R 2 are regular R=Ø R= R 1 * R 1 is regular CS 310 –Fall 2016 Pacific University Proof