Docsity

Solving DFA using Python, Study Guides, Projects, Research of Computer Programming

Toggle sidebar
bg1
Department of Computer Science & Applications
SWAMI SARVANAND GIRI REGIONAL CENTRE
PANJAB UNIVERSITY
A BRIEF PROJECT REPORT ON SOLVING
DFA USING PYTHON
for
FOUNDATION PROGRAM 5.0
Submitted to: - Submitted by: -
Prof. Rahul Jassal Rupinder Kaur, Gaurav
(Asst. Professor) Ganger, Jaskaran Singh
Computer Science and Application MCA (2nd Semester)
1627, 1608, 1611
pf3
pf4

Partial preview of the text

Download Solving DFA using Python and more Study Guides, Projects, Research Computer Programming in PDF only on Docsity!

Department of Computer Science & Applications

SWAMI SARVANAND GIRI REGIONAL CENTRE

PANJAB UNIVERSITY

A BRIEF PROJECT REPORT ON SOLVING

DFA USING PYTHON

for

FOUNDATION PROGRAM 5.

Submitted to: - Submitted by: -

Prof. Rahul Jassal Rupinder Kaur, Gaurav

(Asst. Professor) Ganger, Jaskaran Singh

Computer Science and Application MCA (2 nd^ Semester)

1627, 1608, 1611

Solving DFA using Python Programming

DETERMINISTIC FINITE AUTOMATON (DFA)—also known as a deterministic finite acceptor (DFA) and a deterministic finite state machine (DFSM)—is a finite-state machine that accepts and rejects strings of symbols and only produces a unique computation (or run) of the automaton for each input string.

A DFA is defined as an abstract mathematical concept, but is often implemented in hardware and software for solving various specific problems. For example, a DFA can model software that decides whether or not online user input such as email addresses are valid.

Formal definition

A deterministic finite automaton M is a 5-tuple, (Q, Σ, δ, q0, F), consisting of:

 a finite set of states (Q)  a finite set of input symbols called the alphabet (Σ)  a transition function (δ : Q × Σ → Q)  an initial or start state (q0 ∈ Q)  a set of accept states (F ⊆ Q)

Our Work

In the Module I project of the Foundation program 5.0 , we tried to create the program to check whether the input string is accepted by the given automata.

We took the following example:

Figure I - DFA

The program, when supplied with all the DFA’s 5-tuple, can show whether a given string will be accepted by the given Automata.

For ex: In our case when supplied with list:

list( 'abcdabcdabcd' )

Returns False.

But when supplied with list:

list( 'abcdabcdabcd' )

Returns True;