Вы находитесь на странице: 1из 8

‫ﺑﺳم ﷲ اﻟرﺣﻣن اﻟرﺣﯾم‬

Lesson1
Deterministic Finite Automata
(DFA)
AbuFatimah
PhD student in computer science

1/23/17 AbuFatimah 1
Theory of Computation ‫اﻟﻨﻈﺮﯾﺔ اﻟﺤﺴﺎﺑﯿﺔ‬
• Languages ‫اﻟﻠﻐـــﺎت‬
• Regular Languages ‫اﻟﻠﻐﺎت اﻟﻣﻧﺗظﻣﺔ‬
• Deterministic Finite Automata (DFA)
• We use these methods to recognize regular languages

1/23/17 AbuFatimah 2
What is a Language?
• A language is a set of strings over an alphabet.
• For example, alphabet {0, 1}
• Language L1 = {1, 0, 11, 00}
• Language L2 = {01, 111, 000}
• Language L3 = {ε} the empty string
• Language L4 = ∅ , the empty language, with no strings

1/23/17 AbuFatimah 3
What is a Regular Language?‫اﻟﻠﻐﺎت اﻟﻤﻨﺘﻈﻤﺔ‬
• Regular language is one that can be recognized by a
• Deterministic Finite Automata (DFA), or
• Non-Deterministic Finite Automat (NFA), or
• Regular Expressions (Regex).
• For example:
• L1 = {strings that end with 1}, e.g. {01, 11, 10101, 100001, …}
• L2 = {strings that start and end with 0}, e.g. {0, 00, 010, 011110, …}
• L3 = {strings that have even number of 1’s},
• e.g. {11, 101, 1010, 1111,… }

1/23/17 AbuFatimah 4
Deterministic Finite Automata (DFA)
What is the formal description of M1?
• Example 1: M1
• This DFA is a 5-tuple: (Q, å, d, q0, F)
1. Q = set of states = {q0, q1}
2. å = alphabet = {0, 1}
3. d = transition function = (state
diagram/table)
4. q0 = first state = q0
5. F = set of final states = {q1}.

1/23/17 AbuFatimah 5
Deterministic Finite Automata (DFA)
• Example 1: M1
• d = transition function
• State Diagram (figure)
• Transition Table
0 1
q0 q0 q1
*q1 q0 q1

1/23/17 AbuFatimah 6
Deterministic Finite Automata (DFA)
• Transition Table
0 1
q0 q0 q1
*q1 q0 q1
• What is the language
recognized/accepted by M1?
• e.g {01, 011, 0101, 01011, 1, 11, 101,
1001…}
• L1 = {over (0, 1)|strings that end with 1}
1/23/17 AbuFatimah 7
The End ‫اﻟﻨﮭﺎﯾﺔ‬
• Languages ‫اﻟﻠﻐـــﺎت‬
• Regular Languages ‫اﻟﻠﻐﺎت اﻟﻣﻧﺗظﻣﺔ‬
• Deterministic Finite Automata (DFA)
• Used to recognized regular languages.
• This DFA is a 5-tuple: (Q, å, d, q0, F)
• d = transition function = (state diagram, or transition table)
• L1 = {over (0, 1)|strings that end with 1}

1/23/17 AbuFatimah 8

Вам также может понравиться