L1

Reviews
Shared by: Honey Singh
Categories
Tags
Stats
views:
54
rating:
not rated
reviews:
0
posted:
11/12/2007
language:
pages:
0
General Topics • Automata Theory • Grammars and Languages • Complexities Why Automata Theory? To study abstract computing devices which are closely related to today‟s computers. A simple example of finite state machine: 1 start off on 1 There are many different kinds of machines. Another Example 1 0 start off 0 off on 0 1 1 When will this be on? Try 100, 1001, 1000, 111, 00, … Grammar and Languages Grammars and languages are closely related to automata theory and are the basis of many important software components like: – – – – Compilers and interpreters Text editors and processors Text searching System verification Complexities Study the limits of computations. What kinds of problems can be solved with a computer? What kinds of problems can be solved efficiently? Can you write a program in C which can check if another C program will terminate? Preliminaries • • • • Alphabets Strings Languages Problems Alphabets • An alphabet is a finite set of symbols. • Usually, use  to represent an alphabet. • Examples:  = {0,1}, the set of binary digits.  = {a, b, … , z}, the set of all lower-case letters.  = {(, )}, the set of open and close parentheses. Strings • A string is a finite sequence of symbols from an alphabet. • Examples: – 0011 and 11 are strings from  = {0,1} – abc and bbb are strings from  = {a, b, … , z} – (()(())) and )(() are strings from  = {(, )} Strings • • • • • Empty string:  Length of string: |0010| = 4, |aa| = 2, ||=0 Prefix of string: aaabc, aaabc, aaabc Suffix of string: aaabc, aaabc, aaabc Substring of string: aaabc, aaabc, aaabc Strings • • • • Concatenation: =abd, =ce, =abdce Exponentiation: =abd, 3=abdabdabd, 0= Reversal: =abd, R = dba k = set of all k-length strings formed by the symbols in  e.g., ={a,b}, 2={ab, ba, aa, bb}, 0={} Strings • Kleene Closure * = 012… = k0 k e.g., ={a, b}, * = {, a, b, ab, aa, ba, bb, aaa, aab, abb, … } is the set of all strings formed by a‟s and b‟s. • + = 123… = k>0 k i.e., * without the empty string. Languages • A language is a set of strings over an alphabet. • Examples: – ={(, )}, L1={(), )(, (())} is a language over . The set L2 of all strings with balanced left and right parentheses is also a language over . – ={a, b, c, … , z}, the set L of all legal English words is a language over . – The set {} is a language over any alphabet. What is the difference between  and {}? Languages • Other Examples: – ={0, 1}, L={0n1n | n1} is a language over  consisting of the strings {01, 0011, 000111, … } – ={0, 1}, L = {0i1j | ji0} is a language over  consisting of the strings with some 0‟s (possibly none) followed by at least as many 1‟s. Problems • In automata theory, a problem is to decide whether a given string is a member of some particular language. • This formulation is general enough to capture the difficulty levels of all problems. Finite Automata ( or Finite State Machines) • This is the simplest kind of machine. • We will study 3 types of Finite Automata: – Deterministic Finite Automata (DFA) – Non-deterministic Finite Automata (NFA) – Finite Automata with -transitions (-NFA) Deterministic Finite Automata (DFA) We have seen a simple example before: 1 start off 1 on There are some states and transitions (edges) between the states. The edge labels tell when we can move from one state to another. Definition of DFA A DFA is a 5-tuple (Q, , , q0, F) where Q is a finite set of states  is a finite input alphabet  is the transition function mapping Q   to Q q0 in Q is the initial state (only one) F  Q is a set of final states (zero or more) Definition of DFA For example: start off 1 1 on Q is the set of states: {on, off}  is the set of input symbols: {1}  is the transitions: off  1  on; on  1  off q0 is the initial state: off F is the set of final states: {on} Definition of DFA Another Example: 1 start q0 0 0 q1 q2 0 1 1 We use double circle to specify a final state. What are Q, , , q0 and F in this DFA? Transition Table We can also use a table to specify the transitions. For the previous example, the DFA is (Q,,,q0,F) where Q = {q0,q1,q2},  = {0,1}, F = {q2} and  is such that Inputs States q0 q1 q2 0 q1 q2 q1 1 q0 q0 q0 Note that there is one transition only for each input symbol from each state. DFA Example Consider the DFA M=(Q,,,q0,F) where Q = {q0,q1,q2,q3},  = {0,1}, F = {q0} and  is: Inputs States q0 q1 q2 q3 0 q2 q3 q0 q1 1 Start OR q0 0 0 q2 q1 q0 q3 q2 1 1 q1 0 0 1 1 q3 We can use a transition table or a transition diagram to specify the transitions. What input can take you to the final state in M? Language of a DFA Given a DFA M, the language accepted (or recognized) by M is the set of all strings that, starting from the initial state, will reach one of the final states after the whole string is read. For example, the language accepted by the previous example is the set of all 0 and 1 strings with even number of 0‟s and 1‟s. Class Discussion 0 Start q0 0 1 1 q1 0 Start 0 Start q0 q0 1 1 0 1 q1 0,1 1 q1 0 q2 What are the languages accepted by these DFA? Class Discussion Construct a DFA that accepts a language L over  = {0, 1} such that: (a) L is the set of all strings which starts with „0‟ and ends with 1‟s. (b) L is the set of all strings ending with “101”. (c) L is the set of all strings containing no consecutive “1”s nor consecutive “0”s.

Shared by: Honey Singh
About
Honey is a zealous web and graphics designer (currently working with media redefined ) having a creative and devouring gumption with an experience of over 3 years in Interactive Designing , Blogging and Web technologies.
Other docs by Honey Singh
What Mr.Buffett learned from Graham
Views: 1288  |  Downloads: 134
Warren Buffett_27s Invisible Empire
Views: 1120  |  Downloads: 90
Under Warren Buffett_27s Big Top
Views: 732  |  Downloads: 47
The Warren Buffett You Don_27t Know
Views: 991  |  Downloads: 103
The Best Advice I ever Got
Views: 6479  |  Downloads: 375
9 investing secrets of Warren Buffett[2]
Views: 1130  |  Downloads: 148
UNIX[3]
Views: 907  |  Downloads: 44
Thinking in java 2nd edition
Views: 1280  |  Downloads: 69
network programming
Views: 705  |  Downloads: 37
Kevs-php-mysql[1]
Views: 12678  |  Downloads: 65
Googles Backdoor
Views: 451  |  Downloads: 19
Google Hacking 101
Views: 14542  |  Downloads: 337
Google Hackers Guide
Views: 8465  |  Downloads: 260
Google Anatomy
Views: 1578  |  Downloads: 195
Beej_27s Guide to Network Programming
Views: 505  |  Downloads: 19
Related docs
L1 Visa
Views: 10  |  Downloads: 0
l1 low noise amplifier
Views: 1  |  Downloads: 0
Essentials of L1 Acquisition
Views: 20  |  Downloads: 0
Report L1
Views: 7  |  Downloads: 0
L1 Visa Number
Views: 0  |  Downloads: 0
L1 Visa Status
Views: 24  |  Downloads: 1
Immigration L1 Visa
Views: 25  |  Downloads: 1
Introduction to ArcGIS - L1
Views: 17  |  Downloads: 4
Volkswagen L1 Concept
Views: 74  |  Downloads: 6
L1 Visa Us
Views: 2  |  Downloads: 1
Course Outline – MS Word 2003 (L1 – L3)
Views: 4  |  Downloads: 1
L1 - Internal Energy
Views: 1  |  Downloads: 0