Professional Documents
Culture Documents
Assignment: 01
Course Name: Finite Automata and computability
Course Id: cse437/csc301
Sec: 01
Group no: 04
NAME ID
Nafiz Fuad 1720542
Create an Finite State Automata that accepts the set of all natural numbers divisible by 4.
A= q0 // Final state. A ε Q.
// The goal will be achieved when the remainder will become 0. And for remainder 0, the state
will be q0 as declared earlier.
F= Mapping, QXI🡪Q
Start state, q0 q0 q1 q2 q3
q1 q2 q3 q0 q1
q2 q0 q1 q2 q3
q3 q2 q3 q0 q1
c) Insert 5 numbers each with minimum length of 6. Show the inputs and Transitions in Tabular
format.
Q= QXI
F (q0, 165832)
F (q1, 65832)
F (q0, 5832)
F (q1, 832)
F (q2, 32)
F (q3, 2)
F (q0, ε)
Here, q0 ε A (Final State), Input string is valid and accepted by the automata.
Q= QXI
F (q0, 256217)
F (q2, 56217)
F (q1, 6217)
F (q0, 217)
F (q2, 17)
Page | 5
F (q1, 7)
F (q1, ε)
Here, q1 does not belong to A (Final State), Input string is invalid and not accepted by the automata.
Q= QXI
F (q0, 356212)
F (q3, 56212)
F (q3, 6212)
F (q0, 212)
F (q2, 12)
F (q1, 2)
F (q0, ε)
Here, q0 ε A (Final State), Input string is valid and accepted by the automata.
Q= QXI
F (q0, 165921)
F (q1, 65921)
F (q0, 5921)
F (q1, 921)
F (q3, 21)
F (q0, 1)
F (q1, ε)
Page | 6
Here, q1 does not belong to A (Final State), Input string is invalid and not accepted by the automata.
Q= QXI
F (q0, 241892)
F (q2, 41892)
F (q0, 1892)
F (q1, 892)
F (q2, 92)
F (q1, 2)
F (q0, ε)
Here, q0 ε A (Final State), Input string is valid and accepted by the automata.
q0 = 0 q0 | 4 q0 | 8 q0 | 12 q0 | 1 q1 | 5 q1 | 9 q1 | 2 q2 | 6 q2 | 10 q2 | 3 q3 | 7 q3 | 11 q3
q0 = 0 | 4 | 8 | 12
q1 = 2 q0 | 6 q0 | 10 q0 | 3 q1 | 7 q1 | 11 q1 | 0 q2 | 4 q2 | 8 q2 | 1 q3 | 5 q3 | 9 q3
q1 = 2 | 6 | 10
q2 = 0 q0 | 4 q0 | 8 q0 | 12 q0 | 1 q1 | 5 q1 | 9 q1 | 2 q2 | 6 q2 | 10 q2 | 3 q3 | 7 q3 | 11 q3
q2 = 0 | 4 | 8 | 12
q3 = 2 q0 | 6 q0 | 10 q0 | 3 q1 | 7 q1 | 11 q1 | 0 q2 | 4 q2 | 8 q2 | 1 q3 | 5 q3 | 9 q3
q3 = 2 | 6 | 10
The End