DFA Examples

There are many DFA Examples are as given. But you make sure that you have already read or covered the topic of Deterministic Finite Automata (DFA) in TOC. So, different examples of DFA are as follow.

DFA Example: 01

Draw a DFA which accept only input string “a”
Over input alphabets Σ = {a,b,c}

DFA Example 01

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.

At State q1

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.

At State q2

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {a,b,c}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 01

DFA Example: 02

Draw a DFA which accept only input string “b”
Over input alphabets Σ = {a,b,c,d}

DFA Example 02

At State q0

  • For Input b: Transition goes to q1.
  • For Input a: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input d: Transition goes to q2.

At State q1

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input d: Transition goes to q2.

At State q2

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input d: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {a,b,c,d}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 02

DFA Example: 03

Draw a DFA which accept only input string “c”
Over input alphabets Σ = {a,b,c,d}

DFA Example 03

At State q0

  • For Input c: Transition goes to q1.
  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input d: Transition goes to q2.

At State q1

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input d: Transition goes to q2.

At State q2

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input d: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {a,b,c,d}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 03

DFA Example: 04

Draw a DFA which accept only input string “1”
Over input alphabets Σ = {0,1}

DFA Example 04

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q2.

At State q1

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q2.

At State q2

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 04

DFA Example: 05

Draw a DFA which accept only input string “10”
Over input alphabets Σ = {0,1}

DFA Example 05

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q3.

At State q1

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q3.

At State q2

  • For Input 0: Transition goes to q3.
  • For Input 1: Transition goes to q3.

At State q3

  • For Input 0: Transition goes to q3.
  • For Input 1: Transition goes to q3.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q2
  • Dead State = q3

So, DFA Transition Table are also given.

DFA Transition Table 05

DFA Example: 06

Draw a DFA which accept only input string “1110”
Over input alphabets Σ = {0,1}

DFA Example 06

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q5.

At State q1

  • For Input 1: Transition goes to q2.
  • For Input 0: Transition goes to q5.

At State q2

  • For Input 1: Transition goes to q3.
  • For Input 0: Transition goes to q5.

At State q3

  • For Input 0: Transition goes to q4.
  • For Input 1: Transition goes to q5.

At State q4

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

At State q5

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4,q5}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q4
  • Dead State = q5

So, DFA Transition Table are also given.

DFA Transition Table 06

DFA Example: 07

Draw a DFA which accept only input string “bc”
Over input alphabets Σ = {a,b,c}

DFA Example 07

At State q0

  • For Input b: Transition goes to q1.
  • For Input a: Transition goes to q3.
  • For Input c: Transition goes to q3.

At State q1

  • For Input c: Transition goes to q2.
  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.

At State q2

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.
  • For Input c: Transition goes to q3.

At State q3

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.
  • For Input c: Transition goes to q3.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3}
  • Input Alphabet = {a,b,c}
  • Initial State = q0
  • Final State = q2
  • Dead State = q3

So, DFA Transition Table are also given.

DFA Transition Table 07

DFA Example: 08

Draw a DFA which accept only input string “ab”
Over input alphabets Σ = {a,b

DFA Example 08

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q3.

At State q1

  • For Input b: Transition goes to q2.
  • For Input a: Transition goes to q3.

At State q2

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.

At State q3

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3}
  • Input Alphabet = {a,b}
  • Initial State = q0
  • Final State = q2
  • Dead State = q3

So, DFA Transition Table are also given.

DFA Transition Table 08

DFA Example: 09

Draw a DFA which accept only input string “abb”
Over input alphabets Σ = {a,b}

DFA Example 09

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q4.

At State q1

  • For Input b: Transition goes to q2.
  • For Input a: Transition goes to q4.

At State q2

  • For Input b: Transition goes to q3.
  • For Input a: Transition goes to q4.

At State q3

  • For Input a: Transition goes to q4.
  • For Input b: Transition goes to q4.

At State q4

  • For Input a: Transition goes to q4.
  • For Input b: Transition goes to q4.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4}
  • Input Alphabet = {a,b}
  • Initial State = q0
  • Final State = q3
  • Dead State = q4

So, DFA Transition Table are also given.

DFA Transition Table 09

DFA Example: 10

Draw a DFA which accept only input string “1010”
Over input alphabets Σ = {0,1}

DFA Example 10

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q5.

At State q1

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q5.

At State q2

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q3.

At State q3

  • For Input 0: Transition goes to q4.
  • For Input 1: Transition goes to q5.

At State q4

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

At State q5

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4,q5}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q4
  • Dead State = q5

So, DFA Transition Table are also given.

DFA Transition Table 10

DFA Example: 11

Draw a DFA which accept only input string “0101”
Over input alphabets Σ = {0,1}

DFA Example 11

At State q0

  • For Input 0: Transition goes to q1.
  • For Input 1: Transition goes to q5.

At State q1

  • For Input 1: Transition goes to q2.
  • For Input 0: Transition goes to q5.

At State q2

  • For Input 0: Transition goes to q3.
  • For Input 1: Transition goes to q5.

At State q3

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q4.

At State q4

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

At State q5

  • For Input 0: Transition goes to q5.
  • For Input 1: Transition goes to q5.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4,q5}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q4
  • Dead State = q5

So, DFA Transition Table are also given.

DFA Transition Table 11

DFA Example: 12

Draw a DFA which accept only input string “11101”
Over input alphabets Σ = {0,1}

DFA Example 12

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q6.

At State q1

  • For Input 1: Transition goes to q2.
  • For Input 0: Transition goes to q6.

At State q2

  • For Input 1: Transition goes to q3.
  • For Input 0: Transition goes to q6.

At State q3

  • For Input 0: Transition goes to q4.
  • For Input 1: Transition goes to q6.

At State q4

  • For Input 0: Transition goes to q6.
  • For Input 1: Transition goes to q5.

At State q5

  • For Input 0: Transition goes to q6.
  • For Input 1: Transition goes to q6.

At State q6

  • For Input 0: Transition goes to q6.
  • For Input 1: Transition goes to q6.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4,q5,q6}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q5
  • Dead State = q6

So, DFA Transition Table are also given.

DFA Transition Table 12

DFA Example: 13

Draw a DFA which accept only input string “a(a+b)*”
Over input alphabets Σ = {a,b}

DFA Example 13

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q2.

At State q1

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q1.

At State q2

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {a,b}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 13

DFA Example: 14

Draw a DFA which accept only input string “b(b+a)*”
Over input alphabets Σ = {a,b}

DFA Example 14

At State q0

  • For Input b: Transition goes to q1.
  • For Input a: Transition goes to q2.

At State q1

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q1.

At State q2

  • For Input a: Transition goes to q2.
  • For Input b: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {a,b}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 14

DFA Example: 15

Draw a DFA which accept only input string “a(a+b)*a”
Over input alphabets Σ = {a,b}

DFA Example 15

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q3.

At State q1

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q2.

At State q2

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q2.

At State q3

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q3.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3}
  • Input Alphabet = {a,b,c,d}
  • Initial State = q0
  • Final State = q1
  • Dead State or Trap State = q3

So, DFA Transition Table are also given.

DFA Transition Table 15

DFA Example: 16

Draw a DFA which accept only input string “1(1+0)*”
Over input alphabets Σ = {0,1}

DFA Example 16

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q2.

At State q1

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q1.

At State q2

  • For Input 1: Transition goes to q2.
  • For Input 0: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 16

DFA Example: 17

Draw a DFA which accept only input string “0(0+1)*”
Over input alphabets Σ = {0,1}

DFA Example 17

At State q0

  • For Input 0: Transition goes to q1.
  • For Input 1: Transition goes to q2.

At State q1

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q2.

At State q2

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q2.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q1
  • Dead State = q2

So, DFA Transition Table are also given.

DFA Transition Table 17

DFA Example: 18

Draw a DFA which accept only input string “1(1+0)*1”
Over input alphabets Σ = {0,1}

DFA Example 18

At State q0

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q3.

At State q1

  • For Input 1: Transition goes to q1.
  • For Input 0: Transition goes to q2.

At State q2

  • For Input 0: Transition goes to q2.
  • For Input 1: Transition goes to q1.

At State q3

  • For Input 0: Transition goes to q3.
  • For Input 1: Transition goes to q3.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3}
  • Input Alphabet = {0,1}
  • Initial State = q0
  • Final State = q1
  • Dead State or Trap State = q3

So, DFA Transition Table are also given.

DFA Transition Table 18

DFA Example: 19

Draw a DFA which accept only input string “abacba”
Over input alphabets Σ = {a,b,c}

DFA Example 19

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q7.
  • For Input c: Transition goes to q7.

At State q1

  • For Input b: Transition goes to q2.
  • For Input c: Transition goes to q2.
  • For Input a: Transition goes to q7.

At State q2

  • For Input a: Transition goes to q3.
  • For Input b: Transition goes to q7.
  • For Input c: Transition goes to q7.

At State q3

  • For Input c: Transition goes to q4.
  • For Input a: Transition goes to q7.
  • For Input b: Transition goes to q7.

At State q4

  • For Input b: Transition goes to q5.
  • For Input a: Transition goes to q7.
  • For Input c: Transition goes to q7.

At State q5

  • For Input a: Transition goes to q6.
  • For Input b: Transition goes to q7.
  • For Input c: Transition goes to q7.

At State q6

  • For Input a: Transition goes to q7.
  • For Input b: Transition goes to q7.
  • For Input c: Transition goes to q7.

At State q7

  • For Input a: Transition goes to q7.
  • For Input b: Transition goes to q7.
  • For Input c: Transition goes to q7.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q4,q5,q6,q7}
  • Input Alphabet = {a,b,c}
  • Initial State = q0
  • Final State = q6
  • Dead State = q7

So, DFA Transition Table are also given.

DFA Transition Table 19

DFA Example: 20

Draw a DFA which accept only input string “abcd”
Over input alphabets Σ = {a,b,c,d,e}

DFA Example 20

At State q0

  • For Input a: Transition goes to q1.
  • For Input b: Transition goes to q5.
  • For Input c: Transition goes to q5.
  • For Input d: Transition goes to q5.
  • For Input e: Transition goes to q5.

At State q1

  • For Input b: Transition goes to q2.
  • For Input a: Transition goes to q5.
  • For Input c: Transition goes to q5.
  • For Input d: Transition goes to q5.
  • For Input e: Transition goes to q5.

At State q2

  • For Input c: Transition goes to q3.
  • For Input a: Transition goes to q5.
  • For Input b: Transition goes to q5.
  • For Input d: Transition goes to q5.
  • For Input e: Transition goes to q5.

At State q3

  • For Input d: Transition goes to q4.
  • For Input a: Transition goes to q5.
  • For Input b: Transition goes to q5.
  • For Input c: Transition goes to q5.
  • For Input e: Transition goes to q5.

At State q4

  • For Input a: Transition goes to q5.
  • For Input b: Transition goes to q5.
  • For Input c: Transition goes to q5.
  • For Input d: Transition goes to q5.
  • For Input e: Transition goes to q5.

At State q5

  • For Input a: Transition goes to q5.
  • For Input b: Transition goes to q5.
  • For Input c: Transition goes to q5.
  • For Input d: Transition goes to q5.
  • For Input e: Transition goes to q5.

Explanation:

Hence, the more explanation of the above DFA are as given.

  • States = {q0,q1,q2,q3,q4,q5}
  • Input Alphabet = {a,b,c,d,e}
  • Initial State = q0
  • Final State = q4
  • Dead State = q5

So, DFA Transition Table are also given.

DFA Transition Table 20

"Your Support, Our Priority"

"We Make It Easy"