0% found this document useful (0 votes)
40 views17 pages

Lecture 1

Uploaded by

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

Lecture 1

Uploaded by

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

Theory of Computing

Lec-1
Automata
• Automata theory (also known as Theory Of Computation) is a theoretical branch of Computer Science and
Mathematics, which mainly deals with the logic of computation with respect to simple machines, referred to as automata.

• Automata enables scientists to understand how machines compute functions and solve problems.

• Automata originated from the word “Automaton” which is closely related to “Automation”.
Basic terminologies that are important and frequently used in automata
Symbols, Alphabets
Symbols:
Symbols are an entity or individual objects, which can be any letter, alphabet or any picture.
Example:
1, a, b, #
Alphabets:
Alphabets are a finite set of symbols. It is denoted by ∑.
Examples:
1. ∑ = {a, b}
2. ∑ = {A, B, C, D}
3. ∑ = {0, 1, 2}
String
It is a finite collection of symbols from the alphabet. The string is denoted by w.
Example 1:
If ∑ = {a, b}, various string that can be generated from ∑{ab, aa, aaa, bb, bbb, ba, aba.....}.
• A string with zero occurrences of symbols is known as an empty string. It is represented by ε.
• The number of symbols in a string w is called the length of a string. It is denoted by |w|.
Example 2:
w = 010
Number of Sting |w| = 3
Language
Language:

A language is a collection of appropriate string. A language which is formed over Σ can be Finite or Infinite.
Example: 1

L1 = {Set of string of length 2} = {aa, bb, ba, bb} Finite Language

Example: 2

L2 = {Set of all strings starts with 'a'} = {a, aa, aaa, abb, abbb, ababb} Infinite Language

Three basic concepts


Alphabet- a set of symbols
Strings-a sequence of symbols from an alphabet
Language -a set of strings from the same alphabet
Finite Automata
 Finite automata are used to recognize patterns.
 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.
Types of Finite Automata
DFA
• In a DFA, for a particular input character, the machine goes to one state only.
• A transition function is defined on every state for every input symbol. Also in DFA null (or ε) move is not allowed, i.e.,
DFA cannot change state without any input character.
For example, below DFA with Σ = {0, 1} accepts all strings ending with 0.

DFA
Formal Definition of DFA
A finite automaton is a collection of 5-tuple (Q, ∑, δ, q0, F), where:

Q: finite set of states


∑: finite set of the input symbol
q0: initial state
F: final state
δ: Transition function
Formal Definition of DFA

1. Q = {a, b, c},
2. ∑ = {0, 1},
3. q0 = {a}, 5.Transition function δ (Q X Σ --> Q )
as shown by the following table
4. F = {c} and
Exercise
Formal Definition of NFA
Nondeterministic Finite Automata(NFA):
NFA refers to Nondeterministic Finite Automaton. A Finite Automata(FA) is said to be non-
deterministic if there is more than one possible transition from one state on the same input
symbol. c
A non-deterministic finite automata is also a set of five tuples and represented as,
NFA
NFA is similar to DFA except following additional features:

1.Null (or ε) move is allowed i.e., it can move forward without reading symbols.
2.Ability to transmit to any number of states for a particular input.

NFA

One important thing to note is, in NFA, if any path for an input string leads to a final state, then the input
string is accepted. For example, in the above NFA, there are multiple paths for the input string “00”. Since one of the paths
leads to a final state, “00” is accepted by the above NFA.
DFA vs NFA
 What is one difference between NFA and DFA?
Ans: In NFA, each input symbol has zero or more transitions from any
state. In DFA, however, each input symbol has precisely one transition
from each state.

 Every dfa is nfa. justify this statement. ***


Assignment-1

Every DFA is NFA. justify this statement. ***

You might also like