0% found this document useful (0 votes)
4 views5 pages

Flat Exp-1

The document outlines an experiment on constructing a Deterministic Finite Automaton (DFA) using JFLAP, detailing the algorithm, implementation steps, and testing phases. It describes the DFA's structure, including states and transitions based on input symbols, and provides examples of acceptable and non-acceptable strings for various conditions of 0s and 1s. The final output confirms successful implementation with no errors, along with a rubric for evaluation.

Uploaded by

220301120254
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Flat Exp-1

The document outlines an experiment on constructing a Deterministic Finite Automaton (DFA) using JFLAP, detailing the algorithm, implementation steps, and testing phases. It describes the DFA's structure, including states and transitions based on input symbols, and provides examples of acceptable and non-acceptable strings for various conditions of 0s and 1s. The final output confirms successful implementation with no errors, along with a rubric for evaluation.

Uploaded by

220301120254
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Name Of The Experiment : Construction of DFA (Deterministic Finite Automaton) using JFLAP.

*Coding Phase: Pseudo Code / Flow Chart / Algorithm :


Deterministic Finite Automata (DFA) :-
 DFA refers to deterministic finite automata. The finite automata are called
deterministic finite automata if the machine is read an input string one symbol at a
time.
 A deterministic finite automata is a set of five tuples and represented as,

M = (Q , Σ , δ , q0 , F),

o “Q” is finite set of states.


o “Σ” is finite set of the input symbol.
o “δ” is a transition function.
o “q0” is the initial state.
o “F” is the final state.

Where, δ: Q x ∑→Q

Algorithm :-

 Start in the initial state as q0.


 Read input symbol (0 or 1).
 Transition to the next state based on the count of 0s and 1s.
 Accept only if the final state is q0 (even 0s, even 1s).

* Testing Phase: Compilation of Code (error detection):

No Error

As applicable according to the experiment.


Two sheets per experiment (10-20) to be
used.
Applied and Action Learning
*Implementation Phase:Final Output (No Error)
Procedure :-
 Open JFLAP and create a new finite automaton.
 Create four states (q0, q1, q2, q3).
 Define transitions based on input (0 or 1) :-
o 0 flips between even/odd 0s
o 1 flips between even/odd 1s
 For even number of 0s and even number of 1s mark q0 as the start and final state.
 For even number of 0s and odd number of 1s mark q0 as the start state and q2 as the
final state.
 For odd number of 0s and even number of 1s mark q0 as the start state and q1 as the
final state.
 For odd number of 0s and odd number of 1s mark q0 as the start state and q3 as the
final state.
 Test the DFA with various input strings.

Example :-
Construct a deterministic finite automata for , ∑ = {0 , 1} that accept strings
a. Even no of 0 and even no of 1
b. Even no of 0 and odd no of 1
c. odd no of 0 and even no of 1
d. odd no of 0 and odd no of 1

a. The acceptable strings for “Even no of 0 and even no of 1” are :-


L = { ε , 1100 , 1010 , 0011 , 10101010 , 11001100 …………}
The non-acceptable strings for “Even no of 0 and even no of 1” are :
L1 = {0 , 10 , 111 , 101 , 1 …………}
b. The acceptable strings for “Even no of 0 and odd no of 1” are :-
L = { 1 , 001 , 100 , 010 , 11001 , 10100 ……………..}
The non-acceptable strings for “Even no of 0 and odd no of 1” are :-
L1 = {0 , 10 , 011 , 1100 , 11 …………….}
c. The acceptable strings for “odd no of 0 and even no of 1” are :-
L = {0 , 000 , 110 , 101 , 10100 , 11110 ……….}
The non-acceptable strings for “odd no of 0 and even no of 1” are :-
L1 = {1 , 01 , 1011 , 100011 …………}
d. The acceptable strings for “odd no of 0 and odd no of 1” are :-
L = {01 , 10 , 100011 , 000100 ……………}
The non-acceptable strings for “odd no of 0 and odd no of 1” are :-
L1 = {00 , 111 , 1010 , 101 ……………}

As applicable according to the experiment.


Two sheets per experiment (10-20) to be
used.
Applied and Action Learning
* Final Output (No Error) :

 DFA for Even no of 0 and even no of 1 :-

 DFA for “Even no of 0 and odd no of 1” :-

*As
Twoapplicable
sheets per
used.
according to the
experiment experiment.
(10-20) to be
Applied and Action Learning
* Final Output (No Error) :
 DFA for “Odd no of 0 and even no of 1” :-

 DFA for “Odd no of 0 and odd no of 1” :-

Rubrics FULL MARK

Concept 10
Planning and Execution/ 10
Practical Simulation/ Programming
Result and Interpretation 10
Record of Applied and Action 10
Learning
Viva 10
Total 50

Signature of the Student:

*As
Twoapplicable
sheets per
used.
according to the
experiment experiment.
(10-20) to be
Signature of the Faculty:

*As
Twoapplicable
sheets per
used.
according to the
experiment experiment.
(10-20) to be

You might also like