0% found this document useful (0 votes)
11 views14 pages

02 Toc

The document outlines the hierarchy of languages, detailing the classifications of languages such as non-recursively enumerable, recursively enumerable, recursive, context-free, and regular languages. It provides a formal definition of a Deterministic Finite Automaton (DFA) and compares it with Non-Deterministic Finite Automata (NFA), emphasizing the transition functions and state definitions. Additionally, it includes examples of DFAs for various language patterns, illustrating their structure and acceptance criteria.

Uploaded by

sinhaaaryankumar
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)
11 views14 pages

02 Toc

The document outlines the hierarchy of languages, detailing the classifications of languages such as non-recursively enumerable, recursively enumerable, recursive, context-free, and regular languages. It provides a formal definition of a Deterministic Finite Automaton (DFA) and compares it with Non-Deterministic Finite Automata (NFA), emphasizing the transition functions and state definitions. Additionally, it includes examples of DFAs for various language patterns, illustrating their structure and acceptance criteria.

Uploaded by

sinhaaaryankumar
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/ 14

Hierarchy of languages

Non-Recursively Enumerable Languages

Recursively Enumerable Languages

Recursive Languages

Context-Free Languages

Regular Languages

1
Finite Automata

• DFA
• NFA

DFA  NFA  Regular Expression

DFA ( Deterministic FA)


NFA (Non- Deterministic FA)
Formal Definition of a DFA
• A DFA is a five-tuple:

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

Q A finite set of states


Σ A finite input alphabet/symbols
q0 The initial/starting state, q0 is in Q
F A set of final/accepting states, which is a subset of Q
δ A transition function, which is a total function from Q x Σ to Q

δ: (Q x Σ) –> Q δ is defined for any q in Q and s in Σ, and


δ(q,s) = q’ is equal to some state q’ in Q, could be q’=q

Intuitively, δ(q,s) is the state entered by M after reading symbol s while in state q.

Only 1 initial state but 0 or more final states

3
𝛿: 𝑄 × Σ → 𝑄
• From each state and every input, there is exactly one transition.

Example:
0
1 𝛿= 0 1
0,1
𝑞1 𝑞2 1 𝑞3 𝑞1 𝑞1 𝑞2
0

𝑞2 𝑞1 𝑞3

𝑞3 𝑞3 𝑞3
DFA NFA
All states with all i/p exactly once Optional
• Multuple

a a
a
a
Mention explicitly the dead state permanently or May or May not
rejecting state or trap state
Every DFA is NFA May or May not
0 0,1
𝑞1 𝑞2 DFA
𝑞1 1
DFA
0,1

0,1 𝑞2
𝑞1
𝑞1 Not DFA DFA

0,1
0,1
1
0 𝑞2
0 𝑞1 Not DFA
𝑞1 𝑞2 Not DFA
0,1
0
0 0 0

0 1 𝑞2
𝑞1 𝑞2 Not DFA 𝑞1 DFA

1 1
1. L accepting nothing , Σ={a,b}
a,b

𝑞1

2. L accepting everything, Σ={a,b}

0,1
𝑞3
3. All strings where everything starts with a, Σ={a,b}

a,b
𝑞2 a 𝑞3
b
a,b
𝑞4
4. All strings ending with b.

a b

b 𝑞2
𝑞1

a
4. All strings starting with a and ending with b

a b

a b
𝑞1 𝑞2 𝑞3

b
a
a,b
𝑞4
• All strings of 0 and 1 where every string contains a duplicate bit.

L={00,11,00x,x00,11x,x11,……..}

0 𝑞2
0
0,1
𝑞1 0 1 𝑞4

1 𝑞3 1
• All strings of 0 and 1 where every string ends with a duplicate bit.

(0+1)*(00+11)

0
0 𝑞2
0
𝑞1 0 1

1
1
1
• All strings of 0 and 1 where starting and ending symbol is same

0(0+1)*0+1(0+1)*1
1

0 0
0 𝑞2 𝑞4

1
𝑞1

1 𝑞3 𝑞5
1
0

0
• All strings of a and b where length of each string is exactly 3

You might also like