0% found this document useful (0 votes)
100 views

Assignment-2: Finite Automata

This document is a student assignment on finite automata. It includes: 1) A diagram of a deterministic finite automaton (DFA) with 3 states (A, B, C) and alphabet {a, b} that accepts strings containing zero or more a's or strings containing one or more b's followed by an a. 2) An analysis of the DFA including its transition table and accepted/rejected sample inputs. 3) A regular expression (a*|a*b+a) that describes the language accepted by the DFA. 4) References cited at the end in APA format.

Uploaded by

Molalegn Tamiru
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)
100 views

Assignment-2: Finite Automata

This document is a student assignment on finite automata. It includes: 1) A diagram of a deterministic finite automaton (DFA) with 3 states (A, B, C) and alphabet {a, b} that accepts strings containing zero or more a's or strings containing one or more b's followed by an a. 2) An analysis of the DFA including its transition table and accepted/rejected sample inputs. 3) A regular expression (a*|a*b+a) that describes the language accepted by the DFA. 4) References cited at the end in APA format.

Uploaded by

Molalegn Tamiru
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

Bahir Dar University

Bahir Dar Institute of Technology


Faculty of Computing
Department of Computer Science
Natural Language Processing(CoSc5262)

“ Assignment Two : Finite Automata”

Name: Molalegn Tamiru ID: BDU1300608

Submitted To: Dr. Milion M. (PHD).

May 24, 2021

Addis Ababa, Ethiopia


Write down two words that this machine accepts, and two words that it does not accept.

Fig 1.1 : DFA Diagram for The Machine


1 Automata :- We consider an automaton M over an alphabet A to be a device
(with a finite description) that reads input strings over A from a tape, and accepts some
of them; the language of M, which is denoted by L(M), consists of those strings that are
accepted[1].
 Automata : - It takes the string of symbol as input and changes its state accordingly. When the
desired symbol is found, then the transition occurs. At the time of transition, the automata can
either move to the next state or stay in the same state. Finite automata have two states, Accept
state or Reject state. When the input string is processed successfully, and the automata reached
its final state, then it will accept.
 There are two Types of Finite Automata i.e DFA(deterministic finite automata) aand NFA(non-
deterministic finite automata)
 Deterministic Finite Automata :- is a finite state machine that accepts/rejects finite strings of
symbols and only produces a unique computation (or run) of the automaton for each input
string. 'Deterministic' refers to the uniqueness of the computation (or run) of the automaton for
each input string. 'Deterministic' refers to the uniqueness of the computation[2].
 A DFA has a start state (denoted graphically by an arrow coming in from nowhere) where
computations begin, and a set of accept states (denoted graphically by a double circle) which
help define when a computation is successful.
 Deterministic Finite Automata Have the following Feature
 Q is a finite set of states,
 q0 is an element of Q, called the initial state,
 F ⊆ Q is the set of final states, and
 δ is a total function, called the transition function, from Q × Σ to Q.
 Transition Table :-Instead of explicitly giving all the components of the quintuple of a DFA, we
may simply point out the initial state and the flnal states of the DFA in the table of transition
function, called transition table[3].

State Input
ε a b
A A B
A
B 0 C B
0 0 0
C
Table 1.1 : Transition Table for The DFA Diagram
 in Fig 1.1(Above Graph) Set of state = {A,B,C} [4].
 the initial State is State {A} which is directed by an Arrow(-→) ; The final State is {A , C}
which is described by double circle in the diagram. For instance, we use an arrow to point the
initial state and we encircle all the final states.[3].
 set of input {ε , a , b}
(1) A deterministic finite automaton which accepts the empty string ε
(2) any occurrence of “a’s” will be accepted since the initial and final state found at the state “A”
(3) any occurrence of “b” and at last “a” will be accepted since state “C” is final state

(4) generally ε any occurrence of “a’s” or any occurrence of “a’s” followed by any occurrence of
“b’s” at lease one followed by “a” at once will be accepted by the machine.
(5) Regular Expression which is determined by the above graph(fig 1.1) which is accepted word are
expressed as followed.
(a*|a*b+a) -------------- eq.1
which either of empty string ε a* or a*b+a will be executed successfully based on the input
inserted on the machine.
 A finite automaton accepts a language L iff it accepts every word in L and no other word. If a
finite automaton M accepts a language L, we say that L is the language accepted by M. L(M)
denotes the language accepted by the finite automaton M[4].
Check By Depth First Search
Two words Accepted By The Machine Two words not Accepted By The Machine
Input 1 : Input 2 : Input 3: Input 4 :
aaaabbbbbba aaaaaaaaaaba aaaaaaaaaabaaaa bbbbbbbbbbbaa
A,aaaabbbbbba A,aaaaaaaaaaba A,aaaaaaaaaabaaaa A,bbbbbbbbbbaa

A,aaabbbbbba A,aaaaaaaaaba A,aaaaaaaaabaaaa B,bbbbbbbbbaa

A,aabbbbbba A,aaaaaaaaba A,aaaaaaaabaaaa B,bbbbbbbbaa

A,abbbbbba A,aaaaaaaba A,aaaaaaabaaaa B,bbbbbbbaa

A,bbbbbba A,aaaaaaba A,aaaaaabaaaa B,bbbbbbaa

B,bbbbba A,aaaaaba A,aaaaabaaaa B,bbbbbaa

B,bbbba A,aaaaba A,aaaabaaaa B,bbbbaa

B,bbba A,aaaba A,aaabaaaa B,bbbaa

B,bba A,aaba A,aabaaaa B,bbaa

B,ba A,aba A,abaaaa B,baa

B,a A,ba A,baaaa B,aa

C,_ B,a B,aaaa C,a


Success(Accepted By the Fail(not Accepted By the
Machine Since State C is C,_ C,aaa Machine Since State C is
Success(Accepted By the Fail(not Accepted By the
Final State) Final State there is
Machine Since State C is Machine Since State C is
remaining input)
Final State) Final State there is
remaining input)
References
[1] K. V. N. Sunitha and N. Kalyani, Formal languages and automata theory, no. November.
2010.
[2] M. Bell, “Automata Theory,” Comput. J., vol. 10, no. 2, pp. 171–171, 1967, doi:
10.1093/comjnl/10.2.171.
[3] D. Goswami and K. V Krishna, “Formal Languages and Automata Theory,” 2010.
[4] A. Pettorossi, “Alberto Pettorossi Automata Theory and Formal Languages.”

You might also like