My goal was to create a Deterministic finite automaton that handled the regular language (00010 + 1101 + 1010)* and had a parity bit at the end to make sure 0's where even.
To clarify what I mean by even parity bit, once the finite automaton loops through all possible choices, it determines if the DFA has an even amount of 0's, if there is it will add a 0 to the end of the message, else it will add a 1.
E.G. the machine will accept 000101 but not 00010/ 10110 but not 1011
I designed an M1 that's a bit complicated so i have a picture
And my M2 of the language I also drew for the purpose of this question, which is meant to add a 0 if there is an odd amount of 0's and a 1 if there is an even amount of 0's at the end of every message.
I have combined the two, but I'm still getting the wrong acceptance of binary strings. I believe M2 too be my problem but I'm not sure.
Please give advice as to where I'm going wrong.
Thank you.



DFAs do not add symbols to the input string. You clearly want to read an input string and determine whether it is composed of a string from your given regular language plus a single parity bit at the end.
To do so, you first need to construct a new DFA that accepts strings that satisfy the above requirements, except that the last bit need not be a parity bit. But the new DFA must still enforce exactly one extra bit. Then you construct a second DFA that accepts only binary strings that have correct parity. Then from both DFAs you construct a DFA that accepts the intersection of both languages, and you're done.