I'm trying to solve a problem where I have to create a DFA for the union of two languages.
These are: {s is {a, b, c}*| every "a" in s is immediately followed by a "b"} and
{ s is {a, b, c}*| every "c" in s is immediately preceeded by a "b"}
I think I am on the right track, but not sure if it is totally correct. Could someone have a look please?
Here's a similar post that explains how to find the union of two DFAs.
The key to understand is that you have to run the two DFAs simultanously, or in general you have to maintain the states of both DFAs in the union DFA.
Edit:
The reason you are getting the incorrect result is because your DFAs are not deterministic and because they do not actually decide the languages you described. I think your calculation of the Union is correct, but you should fix your DFAs before proceeding further.