Accept consequent ab string - Finite State Automata

507 Views Asked by At

I have a problem that goes like this

Create a finite-state machine which accepts strings whose characters are in {a,b,c} and produce output strings of T s and F s. The machine outputs a T once the character pair ab (the characters must be adjacent) is encountered in the string. Before this occurrence, it should output F s. Indicate the the starting state, and label the states and transitions. Give a diagram, not a state table.

I just started learning this and here is my first attempt. I haven't labeled the output states ( T and F's) but I'm assuming I would only have T when I move from S1 to S2. The starting state is S0 and the accepting state is S2.

Heres a close picture enter image description here

I'm not really sure about my approach so I would like to know if I am on the right track and if I'm not, what I am doing wrong. Thanks

1

There are 1 best solutions below

2
On

The transition $s_1 \xrightarrow{a} s_0$ should be changed to a loop $s_1 \xrightarrow{a} s_1$.