# TOC | Designing Finite Automata from Regular Expression (Set 8)

Prerequisite: Finite automata, Regular expressions, grammar and language, Designing finite automata from Regular expression (Set 7)

In the below article, we shall see some Designing of Finite Automata form the given Regular Expression-

**Regular Expression 1:** Regular language,

L1 = {a^{n}| n≥ 1}

The language of the given RE is-

{a, aa, aaa, ..........}

Its finite automata will be like below-

In the above transition diagram, as we can see that initial state ‘Y’ on getting ‘a’ as the input it transits to a final state ‘Z’ and so on for the remaining states. Thus this FA accepting all the strings of the given RE language.

**Regular Expression 2:** Regular language,

L2 = {a^{n}b^{m}| n, m≥ 1}

.

The language of the given RE is-

{ab, aab, abb, aaaabb, ..........}

Its finite automata will be like below-

In the above transition diagram, as we can see that initial state ‘X’ on getting ‘a’ as the input it transits to a

state ‘Y’ and so on for the remaining states. Thus this FA accepting all the strings of the given RE language.

**Regular Expression 3:** Regular language,

L3 = (a+b)*

The language of the given RE is-

{ε, a, aa, aaa, aabbb, ........}

Its finite automata will be like below-

In the above transition diagram, as we can see that initial and final state ‘Z’ on getting either ‘a’ or ‘b’ as the input it remains in the state of itself. Thus this FA accepting all the strings of the given RE language.

**Note:** The below REs are equivalent to each other-

= (a+b)* = (a*+b*)* = (a*b*)* = (a*+b)* = (a+b*)* = a*(ba*)* = b*(ab*)*

**Regular Expression 4:** Regular language,

L4 = {ww^{R}| |w|=2, Σ={a, b}*}

The language of the given RE is-

{aaaa, abba, baab, bbbb}

Its finite automata will be like below-

In the above transition diagram, as we can see that initial state ‘A’ on getting ‘a’ as the input it transits to a state ‘b’ and on getting ‘b’ as the input it transits to a state ‘H’ and so on for the remaining states. Thus this FA accepting all the strings of the given RE language.

**Note:** Below expression is not a Regular expression because length of the string ‘w’ is not bounded.

{ww^{R}| Σ={a, b}*}

## Recommended Posts:

- Theory of Computation | Finite Automata Introduction
- TOC | Designing Finite Automata from Regular Expression (Set 1)
- Regular Expressions, Regular Grammar and Regular Languages
- Theory of Computation | Pushdown Automata
- Construct Pushdown Automata for given languages
- Theory of Computation | Union & Intersection of Regular languages with CFL
- Theory of Computation | Generating regular expression from finite automata
- Pushdown Automata Acceptance by Final State
- Star Height of Regular Expression and Regular Language
- TOC | Designing Non-Deterministic Finite Automata (Set 3)
- Construct Pushdown Automata for all length palindrome
- Practice problems on finite automata
- Practice problems on finite automata | Set 2
- TOC | Designing Deterministic Finite Automata (Set 1)
- TOC | Designing Deterministic Finite Automata (Set 2)

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.