
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Conversion of Regular Expression to DFA
We know the concept of deterministic finite automata (DFA) from the very basics of automata theory. We also learnt the concept of regular expressions and their properties. In this chapter, you will learn how to convert a given regular expression to its equivalent finite automata.
Conversion Rules of Regular Expressions to Finite Automata
Here we will highlight some basic rules of regular expressions that we use in different expressions. Let us see the rules and corresponding DFA drawing.
Expression: a + b (a union b)
If you have an expression of the form "A + B", you need two states. Let's call them state A and state B. The state A will transition to state B upon receiving input 'a'. Similarly, state A will transition to state B upon receiving input 'b'.

Alternatively, you can represent it using one transition line for both inputs. This means that the state will transition to the next state upon receiving either input 'a' or input 'b'.
Expression: ab (a followed by b)
When dealing with expressions of the form AB, you need three states: A, B, and C. State A transitions to state B on input 'a', and state B transitions to state C on input 'b'.
Unlike the previous case, where the transition to the next state could be triggered by either input, here the transitions are sequential. State A will transition to state B only on input 'a', and state B will transition to state C only on input 'b'.
So, for expressions of this form, you need separate transitions for each input −
- State A transitions to state B on input 'a'.
- State B transitions to state C on input 'b'.

Expression: a* (closure of a)
For expressions involving the closure of A, represented as A*, the representation is straightforward. You create a state that loops back to itself on input 'a'. This means the state can accept any number of 'a's, including zero.
To summarize, for A* − State A transitions to itself on input 'a', allowing any number of 'a's.

These are three essential rules to remember when designing finite automata from given regular expressions.
Examples of Regular Expression to DFA
We have seen the rules. Now we will use these rules to solve the expressions and convert them to finite state diagrams
Example 1: B a* b
The strings accepted by this regular expression are of the form B, followed by zero or more A's, and ending with a B. For instance, BB, BAB, BAAB, and so on.
To design the finite automata −
- Start with state A (initial state).
- State A transitions to state B on input 'b'.
- State B has a self-loop on input 'a' (closure).
- State B transitions to state C on another input 'b' (final state).
So, for B A* B −
- State A transitions to state B on input 'b'.
- State B transitions to itself on input 'a'.
- State B transitions to state C on input 'b'.

This design will accept strings like BB, BAB, BAAB, etc.
Example 2: a + b followed by c
Here, we have a union operation followed by an 'and' operation. The regular expression is A + B followed by C. This means A or B, followed by C.
To design the finite automata −
- Start with state A (initial state).
- State A transitions to state B on input 'a'.
- State A also transitions to state B on input 'b'.
- State B transitions to state C on input 'c' (final state).
So, for A + B followed by C −
- State A transitions to state B on input 'a' or 'b'.
- State B transitions to state C on input 'c'.

This design will accept strings like AC and BC.
Example 3: a (bc)*
In this expression, A is followed by zero or more repetitions of the sequence BC.
To design the finite automata −
- Start with state A (initial state).
- State A transitions to state B on input 'a'.
- State B transitions to state C on input 'b'.
- State C transitions back to state B on input 'c'.
- State B (also final state) ensures that the string is accepted when ending with C.
So, for A (BC)* −
- State A transitions to state B on input 'a'.
- State B transitions to state C on input 'b'.
- State C transitions back to state B on input 'c'.

This design will accept strings like A, ABC, ABBC, ABBCC, and so on.
Example 4: (a | b)*(abb| a + b)
This is little complex expression. Here we can divide the whole expression into separate parts. (a | b)* and (abb | a + b) are concatenated together, as we can see.
From the previous knowledge, we can draw the diagram directly which will be similar like the one shown below −

Conclusion
In this chapter, you learnt how to convert regular expressions to finite automata by following some simple strategies. By understanding and applying these rules, you can convert regular expressions to their equivalent finite automata.
We highlighted three primary forms: the A + B (union), AB (concatenation), and the A* (closure). These rules form the foundation for designing finite automata from regular expressions.