# Help with DFA/NFA

1. Jan 25, 2009

### opt!kal

Hi there, I've been working on DFA's and NFA's in class, and for the most part I get it, but I want to make sure im doing a couple of these right, and maybe you guys can give some insight on how to complete the ones that make no sense to me. With that, on to the first one!

1. The problem statement, all variables and given/known data

For this problem, we'll work over the alphabet $$\Sigma$$= {a, b, c}. Design a DFA to recognize the language: L$$_{}1$$ = {w| if there is a b in w, then there is a c in w}

3. The attempt at a solution
I couldn't think of any other way of posting this, so im just attaching an image (a pretty bad one at that, sorry!):

http://img149.imageshack.us/my.php?image=52818077vp2.jpg

Anyways, does that seem right? I didnt know what to do if b didnt exist since if b->c and b=false, we dont know what c could be right? Any help is greatly appreciated!

Im also having trouble with:
Using the same alphabet, design NFAs for each of the following languages:
L$$_{}4$$= {w| w ends with bac}
L$$_{}5$$= {w||w| mod 2 = 1 or w ends with a}

for the first one I got:
http://img144.imageshack.us/my.php?image=54291944wd1.jpg

But the second I have no idea.