Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Tutorial 02

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

INSTITUTE OF TECHNOLOGY UNIVERSITY OF MORATUWA

Course : NDT Semester IV-2020


Module : IS2402 Industrial Statistics and Modelling Computation
Section : Modelling Computation
Tutorial 02: Finite Sate Machines

1) Design a DFA that accepts sets of all strings over alphabet {0,1} of length 2.
2) Construct a DFA that accepts all strings over {a,b} that contains the string 𝑎𝑎𝑏𝑏 in it.
3) Construct a DFA that accepts any string over {a,b} that does not contain the string 𝑎𝑎𝑏𝑏
in it.
4) Construct a NFA that accepts any string that end with 0
5) Construct a NFA that accepts sets of all the strings over {0,1} of length 2
6) Construct a NFA that accepts all the strings that ends with 1
7) Construct a NFA that accepts all the strings that contain 0
8) Construct a NFA that accepts all the strings that starts with ‘10’
9) Construct a NFA that accepts all the strings that contain ‘01’
10) Construct a NFA that accepts all the strings that ends with ‘11’
11) Construct the state diagram for the finite-state machine with the following state tables.
12) Construct a Moore machine for the following state table
Present State Next State Output
Input =0 Input =1
 A B C 𝑋2

B B D 𝑋1

C C D 𝑋2

D D D 𝑋3

13) Design a Mealy machine accepting the language of stings over Σ = {0,1} and the strings
that end with aa or bb.

1
14) Construct the state table for the following state diagrams.
a). b).

c).

15) The state table shown in the following table describes a finite-state machine with S =
{s0, s1, s2, s3}, I = {0, 1}, and O = {0, 1}. The values of the transition function f are
displayed in the first two columns, and the values of the output function g are
displayed in the last two columns. Construct the state diagram.
State f g

Input output

0 1 0 1

S0 S1 S0 1 0

S1 S3 S0 1 1

2
S2 S1 S2 0 1

S3 S2 S1 0 0

16) Construct the state diagram for the finite-state automaton M = (S, I, f, s0, F), where S
= {s0, s1, s2, s3}, I = {0, 1}, F = {s0, s3}, and the transition function f is given in the
following table.

State f

Input

0 1

S0 S0 S1

S1 S0 S2

S2 S0 S0

S3 S2 S1

17) Construct DFA that recognize each of these languages.


a). The set of all strings that start with 0
b). The set of bit strings that begin with two 0s
c). The set of bit strings that contain two consecutive 0s
d). The set of bit strings that do not contain two consecutive 0s
e). The set of bit strings that end with two 0s
f). The set of bit strings that contain at least two 0s
g). The set of all bit strings beginning with 01
h). The set of all bit strings that end with 10
i). The set of all bit strings that contain the string 101
j). The set of all bit strings that do not contain three consecutive 0s.

3
18) Construct the state table for the finite-state machine with the state diagram shown in
the following figure.

You might also like