I\'m doing a homework assignment for my theory of computation class and am a bit confused how to combine 2 DFAs. The book says it uses the \"intersection construction\" to d
The idea is pretty straightforward, although I can see where the confusion comes in. I will give a text/symbolic description of the process for making the intersection (union, difference) machines via the Cartesian Product Machine construction (same thing as you are talking about).
A DFA is a 5-tuple (E, Q, q0, A, f) where
Say we have two machines M' = (E', Q', q0', A', f') and M'' = (E'', Q'', q0'', A'', f''). To make the discussion easier, we assume E' = E''. We will now construct M''' so that L(M''') = L(M') intersect (or union or difference) L(M'').
There you go! Let's now consider two machines: one which accepts a^2n, and one which accepts a^3n (the intersection should be a machine accepting a^6n... right?).
For M', we have...
For M'', we have...
For M''', we get...
And there you go! Please let me know if this needs clarification.
These are: {s∈{a,b,c}∗:every a in s is immediately followed by a b} {s∈{a,b,c}∗:every a in s is immediately followed by a b} and {s∈{a,b,c}∗: every c in s is immediately preceded by a b}
In front and another automaton, you can join states "0" and "2".
and you need to retain that ...
There is a precise way for performing automatons for the crossing of languages. Let AA and BB be the input automatons. The cases of new automaton will be all pairs of states of AA and BB, that is SA∩B=SA×SBSA∩B=SA×SB, the initial state will be iA∩B=⟨iA,iB⟩iA∩B=⟨iA,iB⟩, where iAiA and iBiB are the initial states of AA and BB, and FA∩B=FA×FBFA∩B=FA×FB where FXFX denotes the set of accepting states of XX. Finally, the transition function δA∩BδA∩B is defined as follows for any letter α∈Σα∈Σ and states p1,p2∈SAp1,p2∈SA, q1,q2∈SBq1,q2∈SB:
⟨p1,q1⟩−→−−A∩B α ⟨p2,q2⟩ iff p1−→A α p2andq1−→B α q2 ⟨p1,q1⟩→A∩B α ⟨p2,q2⟩ iff p1→A α p2andq1→B α q2 Please note, that such automaton usually is not minimal (e.g. the intersection might be just an empty language). Also, it might be useful (but it is not necessary) to make input automatons minimal since the output is quadratic in size. // Reference: math.stackexchange.com Happy Coding ...