2. Topics to be covered
Basic concepts and their usage
Basic Grammar
Automata Introduction
a. Deterministic
b. Non-Deterministic
Intro to DFA and NFA
Day 2
3. Basic Concepts in TOC
In theory of computation the few of the most important concepts are:
1. To identify the Language.
[ Σ=(a,b) ] ,
hence w=(aab,bab,aaa,ba…)
2. Concatenation of strings.
If s1= a1
a2
...an
And s2 = b1
b2
...bn
(s1.s2)= a1
a2
...an
b1
b2
...bn
4. Basic Concepts in TOC
In theory of computation the few of the most important concepts are:
3. Length of a string.
If s1= abaaba
Length of s1(|s1|) = 6
|w| = |wR
|
where wR
is the reverse
4. Sub-strings.
If u = abb & v = bab
And w = u.v
w = abbbab
u,v are substrings of w
5. Basic Concepts in TOC
In theory of computation the few of the most important concepts are:
5.1 Empty Strings
Denoted as ‘λ’.
|λ| = 0 & w0
= λ
5.2 Concatenating with
Empty Strings.
w.λ= λ.w = w
6. Proof By Induction
To prove:
Step1: For all a ∈ ∑ and w any string on ∑; Let,
Step2: Take any υ of length n + 1 and
write it as υ = wa
8. Common Denotations
1. L = {an
bn
: n>0}, then L2
= {an
bn
am
bm
: n,m>0}
Ln
means L is concatenated with itself n times.
2. LR
means the reversal of L
If L= abbab, then LR
= babba
3. If ∑ =(a,b)
∑ *
={λ,a,b,ab,ba,. . .} and ∑ +
={a,b,ab,ba,. . .}
9. Grammars
A grammar is defined as a quadruple, G =(V, T, S, P)
where,
V is a finite set of objects called variables,
T is a finite set of objects called terminal symbols,
S ∈ V is a special symbol called the start variable,
P is a finite set of productions.
It will be assumed without further mention that the sets V and T are nonempty and disjoint.
We normally use capital letters for Variables, and small letters for terminals.
10. Grammar Problems
Q. Find grammar that generates L={an
bn+1
: n>=0}
.
.
. G = (V, T, S, P)
= ({S,A},{a,b},S,P)
P = S ---> Ab
A ---> aAb
A ---> λ
11. Grammar Problems
Q. If ∑ = { a, b}, and let na
(w) and nb
(w) denote the number of a’s and b’s in the
string w respectively. Find the grammar for L={w: na
(w) = nb
(w)}
S ---> SS
S ---> λ
S ---> aSb
S ---> bSa
12. Grammar Problems
Q. If Σ={a,b} , find grammar that contains exactly 1 a.
S --->bS | Sb
S ---> a
13. Grammar Problems
Q. If Σ={a,b} , find grammar that contains at least 1 a.
S ---> a
S --->bS | Sb
S ---> SS
14. Grammar Problems
Q. If Σ={a,b} , find grammar that contain not more than 3 a(s).
S ---> aA|Aa|aaA|Aaa|aaaA|Aaaa
S --->A|aAa|aaAa|aAaa
A ---> λ|bA|Ab
15. Grammar Problems
Q. If Σ={a,b} , find grammar that contain at least 3 a(s).
S --->BaBaBaB
B ---> λ|a|b|BB
16. Grammar Problems
Q. For the following grammar, Find the language.
S ---> λ|aSbb
Language (L)= {an
b2n
: n>=0}
17. Grammar Problems
Q. For the following grammar, Find the language.
S ---> aSb
S ---> aaa
Language (L)= {am
bm-3
: n>=0}
18. Grammar Problems
Comment if the two grammars are equal
1.
S ---> aSb|bSa|SS|a
2.
S ---> aSb|bSa|a
The string “aa” can’t be derived by
grammar 2
19. Automata: An Introduction
An automaton is an abstract model of a digital computer. It will be assumed that
the input is a string over a given alphabet, written on an input file, which the
automaton can read but not change.
The input mechanism can also detect the end of the input string (by sensing an
end-of-file condition).
The automaton can produce output of some form.
20. General Automaton This is a general model of
automata. A finite-state control will
be common to all specific cases,
but differences will arise from the
way in which the output can be
produced and the nature of the
temporary storage.
The nature of the temporary storage
governs the power of different types
of automata.
21. Types of Automaton
Deterministic Finite Automata Non-Deterministic Finite Automata
● All transitions are deterministic
○ Each transition leads to only
1 other state
● For each state, transition on all
symbols must be defined.
● Harder to construct as compared
to a NFA
● Some transitions could be
non-deterministic
○ Transition could lead to a
subset of states
● Transition on all symbols need
not be defined for a state.
● Easier to construct as compared
to a DFA
22. Special types of Automaton
Let us see a few types of automaton that are of specific usage.
#Acceptor
An automaton whose
output is restricted to simple
yes/no. It accepts or rejects a
string.
#Applications:
>Automata are used for serial
addition in binary circuits.
>Also used in legal acceptors
to detect if the string is valid.
23. End of Day 2
www.linkedin.com/in/wadkar-rushabh
@RushabhWadkar
Thank you...