Professional Documents
Culture Documents
Finite Automata: Finite number of states, exactly one of them will be the initial state, zero
or more will be final state.
For every RE there exist at least one FA and for every FA there exist at least one RE.
1. ʰФ
É É
I 2. a
sse I
a
yyffIfÉ
Is
a
3 There3. a + one
showbe b finalstate a,b
2 b 4 byone
Eliminatethestates one
anda excepttheinitialandthefinal
4. a . b sa a b
node
2. a a
or
3. a + b a,b
and
4. a . b a b
b
a
a ab abb
6. ab*
a
n ab abab ababab
7. (ab)* b
a
b
b n ab ba abbabaab abbaabba
8. (ab + ba)* a
1. A finite set of states at least one of which is designated as the start state (→) and some (maybe
2. An alphabet ∑ of possible input letters from which input strings are formed.
3. A finite set of transitions that show how to go from one state to another based on reading
ab a b aba
aa bb ab ba
Eaab
Dr. Irfan 2/11/2024 6
Examples
a,b
a,b
a a
ab
ab a,b
a
a
b
b
a,b
ab
Dr. Irfan 2/11/2024 7
Kleen’s Theorem
Any language that can be defined by
regular expression
or finite automaton
or transition graphII A
This theorem is the most important and fundamental result in the Theory of Finite
Automata.
This means that we present a procedure that starts out with an FA, transition graph and
ends up with a regular expression that defines the same language.
є
Converted to
THE
Converted to
є
3. The final state should be one (if there’s exist more than one final state, should be reduced to
one)
+ є
Converted to
є +
+
є
+
State Elimination: Remove states 1 by 1 (other than the initial and final state) and you will
get target RE.
Example:
a,b,c
+
OR RE = a + b + c
a+b+c
+
Example:
ab
+ RE = ab
ab*c
+
RE = ab*c
are i
ii In
r.I.rs m ryo.rs nra lrs rutrs
a b C
= 𝑟 𝑟∗ 𝑟 + 𝑟 𝑟∗ 𝑟 + 𝑟 𝑟 𝑟 ∗
= 𝑟 𝑟 ∗ (𝑟 + 𝑟 + 𝑟 )
Dr. Irfan 2/11/2024 15
Examples
Example: Convert the FA in the below Figure into RE?
affiliation
ME
i iñ i
butcanbal
can
Iffarabas
fffht
i
Dr. Irfan 2/11/2024 19
Conversion of FA RE
Example: Example:
b 2
+
0 a c
I
IN
A B
1
y +
d
µ
+
A B b
A B y y s L IN
sM
s 0 13 s Y paths
as y IN
010T y
albted
µ
Dr. Irfan 2/11/2024 24
Conversion of FA RE
Example: c
b
d +
A B C
C
a
A d sc
s b 13 d e
b
13 d e
blatant'd
s c
Dr. Irfan 2/11/2024 25
Conversion of FA RE
Example: c d
a
A B
we b
if Bd c y if p.de y
act
n e
s s u s ta 1 e
g y
u
ac 1 c y a I
actdtab't cadtbeat
y Dr. Irfan y 2/11/2024 26
Conversion of FA RE
do Example: 0 0
1
A B
1
s no
A B
j
10
s A g y
u
o
s 11 0 y
Dr. Irfan 2/11/2024 27
Conversion of FA RE
Example:
0 0
0
1 1
A B C
I 0 0 0 1 3
is remove a y
4101
y u
2 611041 y
Remove B s cÑ
5 a B e
sy
b
bra e
s s y
sea e g
balbtabt.at
y Dr. Irfan 2/11/2024 29
Conversion of FA RE
do Define RE for FA = b Accept EVEN
b numbers of a’s
a
A B
a
b
if p
yᵗ
s a
say
fara
A s Y
btabt.at
s y Dr. Irfan 2/11/2024 30
Conversion of FA RE
Define RE for FA = b should be END
do b with a.
a
A b B
5 B e
sy
bra BÑ e
s g y
Ubra
pinnate
bra y
b.albtbb.at
s y
Dr. Irfan 2/11/2024 31
Convert FA to RE (Solve)
2/9/2024 33