170 likes | 250 Views
Lecture no. 4. FINITE AUTOMATA. Review Languages Operations on languages Automata FA-Finite Automata DFA. Languages. ∑* is the se t of all strings on ∑. Denoted by. E.g : ∑={ a,b,c } ∑*={ λ , a, b, c, aa , ab , ac, ba , …} ∑ + is the set of all strings except ?
E N D
Lecture no. 4 FINITE AUTOMATA Naveen Z Quazilbash
Review • Languages • Operations on languages • Automata • FA-Finite Automata • DFA Naveen Z Quazilbash
Languages • ∑* is the set of all strings on ∑. • Denoted by. • E.g: ∑={ a,b,c} • ∑*={ λ, a, b, c, aa, ab, ac, ba, …} • ∑+is the set of all strings except ? • Note: ∑* and ∑+ are infinite. Naveen Z Quazilbash
A language is a subset of ∑*, usually denoted by L. • It may be finite or infinite. • Examples: • { a, ba, abc} • {λ, a, aa, aaa, …} • Φ • If a string w is in L, we say that w is a sentence of L. Naveen Z Quazilbash
Operations on Languages • Union • Intersection • Difference • Complementation • Reverse • Concatenation • Power • Star Closure • Positive Closure Naveen Z Quazilbash
Automata • An “Automaton” is an abstract model of a computer, which accepts some input (a string), produces output (yes/no or a string) and may have internal storage (usually a stack or a tape) • An automaton operatse in a distcrete time frame( like a real computer). Naveen Z Quazilbash
Some definitions related to Automata • A particular state of the automaton including the state of the CU, input and storage is called a Configuration. • The transaction from a configuration to the next one is a Move. • If the output is yes/no, the automaton is an Acceptor. • If the output is a string, the automaton is a Transducer. Naveen Z Quazilbash
FA-Finite Automata Naveen Z Quazilbash
DEFINITION Resource: Introduction To Computer Theory by Denial Cohen A finite automaton is a collection of three things: 1. A finite set of states, one of which is designated as the initial state, called the start state, and some (maybe none) of which are designated as final states. 2. An alphabet ∑ of possible input letters, from which are formed strings, that are to be read one letter at a time. 3. A finite set of transitions that tell for each state and for each letter of the input alphabet which state to go to next.
FOR EXAMPLE Resource: Introduction To Computer Theory by Denial Cohen 1. From state x and input a go to state y. 2. From state x and input b go to state z. 3. From state y and input a go to state x. 4. From state y and input b go to state z. 5. From state z and any input stay at state z.
Transition Table Resource: Introduction To Computer Theory by Denial Cohen Lets make The transition table for the FA we have described.
FA Resource: Introduction To Computer Theory by Denial Cohen
FA for language defined over ∑={a,b} of all strings starting with ‘b’. Resource: Virtual University of Pakistan
Different FA’s FA for language defined over ∑={a,b} of all strings ending in ‘a’. FA for language of all words starting with a. FA for language of all words ending with b. FA for language of all words of even length.
Languages starting with ‘b’. Languages of all words having Even length. Languages of all words ending in ‘a’.
DFA- Deterministic Finite Automata/Acceptor • An automata without internal storage, gives yes/no output. • States • Initial state • Final state • Transition function • Extended transition function Naveen Z Quazilbash
DFA • Formal definition: • It’s a five tuple: • Q= set of states. • ∑= input alphabet. • δ= transition function. • q0= initial state. • F= set of final states. Naveen Z Quazilbash