Download presentation
Presentation is loading. Please wait.
Published byClement Thomas Modified over 5 years ago
1
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: ={0,1}, the possible words over are the finite bit strings. A language is a set of words.
2
More about Languages The empty string is the unique string with zero length. Concatenation of two langauges: A•B = { xy | xA and yB } Typical examples: L = { x | x is a bit string with two zeros } L = { anbn | n N } L = {1n | n is prime}
3
A Word of Warning Do not confuse the concatenation of languages with the Cartesian product of sets. For example, let A = {0,00} then A•A = { 00, 000, 0000 } with |A•A|=3, AA = { (0,0), (0,00), (00,0), (00,00) } with |AA|=4
4
Recognizing Languages
Let L be a language S a machine M recognizes L if “accept” if and only if xL xS M “reject” if and only if xL
5
Finite Automaton The most simple machine that is not just a finite list of words. “Read once”, “no write” procedure. Typical is its limited memory. Think cell-phone, elevator door, etc.
6
A Simple Automaton (0) transition rules states starting state
q1 q2 q3 1 0,1 starting state accepting state
7
A Simple Automaton (1) start accept on input “0110”, the machine goes:
q1 q2 q3 1 0,1 start accept on input “0110”, the machine goes: q1 q1 q2 q2 q3 = “reject”
8
A Simple Automaton (2) on input “101”, the machine goes:
q1 q2 q3 1 0,1 on input “101”, the machine goes: q1 q2 q3 q2 = “accept”
9
A Simple Automaton (3) 010: reject 11: accept 010100100100100: accept
q1 q2 q3 1 0,1 010: reject 11: accept : accept : reject : reject
10
Finite Automaton (def.)
A deterministic finite automaton (DFA) M is defined by a 5-tuple M=(Q,,,q0,F) Q: finite set of states : finite alphabet : transition function :QQ q0Q: start state FQ: set of accepting states
11
M = (Q,,,q,F) q1 q2 q3 1 0,1 states Q = {q1,q2,q3}
0,1 states Q = {q1,q2,q3} alphabet = {0,1} start state q1 accept states F={q2} transition function :
12
Recognizing Languages (def)
A finite automaton M = (Q,,,q,F) accepts a string/word w = w1…wn if and only if there is a sequence r0…rn of states in Q such that: 1) r0 = q0 2) (ri,wi+1) = ri+1 for all i = 0,…,n–1 3) rn F
13
Regular Languages The language recognized by a finite automaton M is denoted by L(M). A regular language is a language for which there exists a recognizing finite automaton.
14
THANK YOU THT Prepared By:- Preeti Gupta
Deptt. Of Computer Applications Prepared By:-PP
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.