Comp Sci DFA that accepts either ab or ba as substring?

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Computation Dfa
AI Thread Summary
The discussion centers on the design of a DFA that accepts strings containing either "ab" or "ba" as substrings. There is confusion regarding whether the requirement is an inclusive or exclusive condition, leading to the DFA incorrectly accepting "abba." Clarification is provided that if interpreted as inclusive, the DFA is correct, but if exclusive, it needs revision. The participant is encouraged to explore both interpretations and submit their findings. The alphabet in question is confirmed to be {a, b}.
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
I need to create a DFA that contains substrings either ab or ba
Relevant Equations
Deterministic finite automata no equations
Attempt at solution-:

1635769064071.png

Now this dfa will also accept abba which in my inituition it should not accept. But it does accept it. What is going here? Please guide
 
Physics news on Phys.org
The English language statement "contains either the substrings ab or ba" is the issue. If you read this as an "inclusive or" then your DFA looks okay. If you read it as an "exclusive or" then it is not okay. Since you are a student and you recognize this potential ambiguity, figure out the "exclusive or" case. Submit both variations and your professor will be delighted!

Is the alphabet { a, b } ?
 
Last edited:
Back
Top