Skip to content
Related Articles

Related Articles

Union process in DFA
  • Last Updated : 20 Nov, 2019

Prerequisite – Designing finite automata
Let’s understand the Union process in Deterministic Finite Automata (DFA) with the help of below example.

Designing a DFA for the set of string over {a, b} such that string of the language start and end with different symbols. There two desired language will be formed:

L1 = {ab, aab, aabab, .......}
L2 = {ba, bba, bbaba, .......} 

L1= {starts with a and ends with b } and L2= {starts with b and ends with a}.
Then L= L1 ∪ L2 or L=L1 + L2

State Transition Diagram for the language L1:

This DFA accepts all the string starting with a and ending with b. Here, State A is initial state and state C is final state.

State Transition Diagram for the language L2:

This DFA accepts all the string starting with b and ending with a. Here, State A is initial state and state C is final state.

Now, Taking the union of L1 and L2 language which gives the final result of the language which starts and end with different elements.
State Transition Diagram of L1 ∪ L2:

Thus as we see that L1 and L2 have been combined through union process and this final DFA accept all the language containing strings starting and ending with a different symbols.
Note: From above example we can also infer that regular languages are closed under union(i.e Union of two regular languages is also regular).

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :