# Compound Finite Automata (FA)

Prerequisite – Finite Automata (FA)

Compound FA is the resultant DFA formed after performing operation (∪, ∩, -) on given DFAs D1 and D2.

D1 = (Q_{1}, ∑, δ, q_{1}, F_{1}) and D2 = (Q_{2}, ∑, δ, q_{2}, F_{2})

Where,

Q_{1} and Q_{2}: Set of finite states of DFA D1 and D2 respectively.

∑: Input alphabet contain finite number of input symbols.

δ: Transition function (δ:Qx∑->Q)

q_{1} and q_{2}: Initial state of D1 and D2 respectively.

F_{1} and F_{2}: Set of final states of DFA D1 and D2 respectively.

**Properties of Compound Finite Automata (FA):**

- Number of states in compound FA (D1XD2) is equal to m*n, where m is the number of states in D1 and n is the number of states D2.
- Initial state of compound FA is combination of initial states of D1 and D2.
- Final state of compound FA depends on the operation performed.

**Example:**

D1 = no. of a's divisible by 2 D2 = no. of b's divisible by 3 D1 ({q_{1}, B}, {a, b}, δ, q_{1}, {q_{1}}), D1 ({q_{2}, A, C}, {a, b}, δ, q_{2}, {q_{2}})

Construct the minimal FA for:

(D1∪D2), (D1∩D2), (D1-D2), (D2-D1)

**Explanation:**

**DFA D1:**

**DFA D2:**

**1. Union (D1∪D2):**

Any string w which is either belong’s to the language of D1 **or** the language of D2 is accepted by resultant compound automata.

__Final state__: If final state of D1 or final state of D2 contain in any of the states of compound FA.

**2. Intersection (D1∩D2):**

Any string w which belong’s to both the language of D1 **and** the language of D2 is accepted by resultant compound automata.

__Final state__: If both final state of D1 and final state of D2 contain in any of the states of compound FA.

**3. Difference (D1 – D2):**

Any string w which is accepted by D1, not by D2.

__Final state__: If final state of D1 and non-final state of D2 contain in any of the states of compound FA.

**4. Difference (D2 – D1):**

Any string w which is accepted by D2, not by D1.

__Final state__: If final state of D2 and non-final state of D1 contain in any of the states of compound FA.

## Recommended Posts:

- TOC | Finite Automata with Output (Set 3)
- TOC | Finite Automata with Output (Set 11)
- TOC | Finite Automata with Output (Set 6)
- TOC | Finite Automata with Output (Set 5)
- TOC | Designing Deterministic Finite Automata (Set 6)
- Practice problems on finite automata
- TOC | Designing Deterministic Finite Automata (Set 10)
- TOC | Designing Deterministic Finite Automata (Set 7)
- TOC | Designing Deterministic Finite Automata (Set 5)
- TOC | Designing Deterministic Finite Automata (Set 8)
- TOC | Designing Deterministic Finite Automata (Set 9)
- TOC | Designing Deterministic Finite Automata (Set 2)
- TOC | Designing Deterministic Finite Automata (Set 1)
- TOC | Designing Non-Deterministic Finite Automata (Set 3)
- TOC | Designing Deterministic Finite Automata (Set 3)

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.