Open In App

Construct a DFA which accept the language L = {a<sup>n</sup>b<sup>m</sup> | n > =1, (m) mod 3 = 1}

Problem: Construct a DFA which accept the language L = {anbm | n > =1, (m) mod 3 = 1}. Explanation: For constructing the DFA, the following things to be remember:
 which means any no of elements, and
 =  which means any no of elements greater than 1.
Examples:
Input: a a b b b           
Output: NOT ACCEPTED
// n = 2 (>=1), m=3 ((3) mod3 != 1)

Input: a a a b        
Output: ACCEPTED
 // n = 3 (>=1), m = 1 ((1) mod 3= 1)

Input: b b b b        
Output: NOT ACCEPTED
// n = 0(must be >=1), m = 4 ((4) mod 3 = 1) 
Approaches:
It’s construction should contain the following steps:
ACCEPTED

Article Tags :