-1

I have these regular expressions:

a) 0(10)*

b) a(b+c+d)

c) b*(aa*b*+ε)

I created these state diagrams for them:

Solutions

Are they correct?

trincot
  • 317,000
  • 35
  • 244
  • 286
Marnie
  • 21
  • 1
  • 1
    Please post a representation of your problem directly in this forum. People are far to savvy to click on arbitrary links. – mevets Jan 15 '23 at 10:12
  • Couldn't you wait for 16:20 to post this (4:20 pm), would have been nice. Also good that you're charging your phone. Usually asking a question is a way to get an answer, the more information you provide the better the chances for getting an answer. – Buttered_Toast Jan 15 '23 at 11:29

1 Answers1

1

If I deciphered your writing correctly, this is what you wrote:

a) 0(10)*

enter image description here

Correct.

But two remarks:

  • Clearly indicate which state is the starting state. It is common to use an incoming arrow for that, like you did in answer to (c).
  • The rightmost two states are not really needed as they are indistinguishable from the first two states (at the top).

You could simplify to this:

enter image description here

b) a(b+c+d)

enter image description here

Not correct. There are these issues:

  • a is not a valid input, so the second state should not be an accepting state.
  • This first sink state lacks a transition for a. Once that is corrected, it becomes a state that is indistinguishable from the second sink, and so they could be merged
  • And you should indicate which is the starting state

Correction:

enter image description here

c) b*(aa*b*+ε)

enter image description here

Correct!

trincot
  • 317,000
  • 35
  • 244
  • 286