×
In real life, there is no such thing as second place. Either you are a winner, or you’re not.

# Note for Automata Theory And Computability - ATC by Mohammad Akbal

• Automata Theory And Computability - ATC
• Note
• Computer Science Engineering
• B.Tech
• 8 Topics
• 1323 Views
Page-2

#### Note for Automata Theory And Computability - ATC by Mohammad Akbal

Topic: / 131

0 User(s)

#### Text from page-2

Lecture Notes | 15CS54 – ATC | Module 1: Finite State Machines 1. Introduction The term "Automata" is derived from the Greek word "αὐτόµατα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled computing device which follows a predetermined sequence of operations automatically. An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State Machine (FSM). 2. Why to study Theory of Computation? Theory of computation is mainly concerned with the study of how problems can be solved using algorithms. It is the study of mathematical properties both of problems and of algorithms for solving problems that depend on neither the details of today's technology nor the programming language. It is still useful in two key ways: • • It provides a set of abstract structures that are useful for solving certain classes of problems. These abstract structures can he implemented on whatever hardware/software platform is available It defines provable limits to what can be computed regardless of processor speed or memory size. An understanding of these limits helps us to focus our design effort in areas in which it can pay off, rather than on the computing equivalent of the search for a perpetual motion machine. The goal is to discover fundamental properties of the problems like: • • • • Is there any computational solution to the problem? 1f not. is there a restricted but useful variation of the problem for which a solution does exist? If a solution exists, can it be implemented using some fixed amount of memory? If a solution exists. how efficient is it? More specifically. how do its time and space requirements grow as the size of the problem grows? Are there groups of problems that are equivalent in the sense that if there is an efficient solution to one member of the group there is an efficient solution to all the others? Applications of theory of computation: • • • Development of Machine Languages: Enables both machine-machine and personmachine communication. Without them, none of today's applications of computing could exist. Example: Network communication protocols, HTML etc. Development of modern programming languages: Both the design and the implementation of modern programming languages rely heavily on the theory of context-free languages. Context- free grammars are used to document the languages syntax and they form the basis for the parsing techniques that all compilers use. Natural language processing: It is a field of computer science, artificial intelligence, and computational linguistics concerned with the interactions between computers and human (natural) languages. Prepared by Harivinod N Page| 2

#### Text from page-3

Lecture Notes | 15CS54 – ATC | Module 1: Finite State Machines • • • • • Automated hardware systems: Systems as diverse as parity checkers, vending machines, communication protocols, and building security devices can be straightforwardly described as finite state machines, which is a part of theory of computation. Video Games: Many interactive video games are use large nondeterministic finite state machines. Security is perhaps the most important property of many computer systems. The undecidability results of computation show that there cannot exist a general-purpose method for automatically verifying arbitrary security properties of programs. Artificial intelligence: Artificial intelligence programs solve problems in task domains ranging from medical diagnosis to factory scheduling. Various logical frameworks have been proposed for representing and reasoning with the knowledge that such programs exploit. Graph Algorithms: Many natural structures, including ones as different as organic molecules and computer networks can be modeled as graphs. The theory of complexity tells us that, is there exist efficient algorithms for answering some important questions about graphs. Some questions are "hard", in the sense that no efficient algorithm for them is known nor is one likely to be developed. 3. Strings Alphabet Definition: An alphabet is any finite set of symbols denoted by Σ (Sometimes also called as characters or symbols). Example: Σ = {a, b, c, d} is an alphabet set where ‘a’, ‘b’, ‘c’, and ‘d’ are symbols. String Definition: A string is a finite sequence of symbols taken from Σ. Example: ‘cabcad’ is a valid string on the alphabet set Σ = {a, b, c, d} 3.1. Functions on Strings Length of a String Definition: It is the number of symbols present in a string. (Denoted by |.|). Examples: If s =‘cabcad’, | s |= 6; Also |11001101| = 7 If | s |= 0, it is called an empty string, denoted by ε. Prepared by Harivinod N |ε| = 0 Page| 3

#### Text from page-4

Lecture Notes | 15CS54 – ATC | Module 1: Finite State Machines Concatenation of strings: The concatenation of two strings s and t, written s||t or simply st, is the string formed by appending t to s. For example, if x = good and y = bye, then xy = goodbye. So |xy| = |x| + |y|. The empty string, e, is the identity for concatenation of strings. (xe = ex = x). Concatenation, as a function defined on strings is associative. (st)w = s (tw). String Replication For each string w and each natural number i, the string wi is defined as: Example: a3 = aaa, (bye)2 = byebye, a0b3 = bbb String Reversal: For each string w, the reverse of w, written as wR, is defined as: 3.2. Relations on strings Substring: A string s is a substring of a string of t iff s occurs contiguously as part of t. For example: aaa is a substring of aaabbbaaa, aaaaaa is not a substring of aaabbbaaa Proper Substring: A string r is a proper substring of a string t, iff t is a substring of t and s ≠ t. Every string is a substring (although not a proper substring) of itself. The empty string. e. is a substring of every string. . A string s is a proper prefix of a string Prefix: A string s is a prefix of t, iff ∃ ∈ ∑∗ t iff s is a prefix of t and s≠t. Every string is a prefix (although not a proper prefix) of itself. The empty string ε, is a prefix of every string. For example. the prefixes of abba are: ε, a, ab, abb, abba. Prepared by Harivinod N Page| 4

#### Text from page-5

Lecture Notes | 15CS54 – ATC | Module 1: Finite State Machines Suffix: A string s is a suffix of t, iff ∃ ∈ ∑∗ . A string s is a proper suffix of a string t iff s is a suffix of t and s≠t. Every string is a suffix (although not a proper suffix) of itself. The empty string ε, is a suffix of every string. For example. the prefixes of abba are: ε, a, ba, bba, abba. 4. Languages A language is a (finite or infinite) set of strings over a finite alphabet ∑. When we are talking about more than one language, we will use the notation ∑ , to mean the alphabet from which the strings in the language L are formed. Let ∑ = {a, b}. ∑* = {ε, a, b, aa, ab , ba, bb, aaa, aab .... }. Some examples of languages over ∑ are: Φ, {ε}, {a, b}, {ε, a, aa, aaa, aaaa, aaaaa}, {ε, a, aa, aaa, aaaa, aaaaa, . . . . } 4.1. Techniques for Defining Languages There are many ways. Since languages are sets. we can define them using any of the setdefining techniques Ex-1: All a's Precede All b's, L = {w ϵ {a,b}*: an a's precede all b's in w}. The strings ε, a, aa, aabbb, and bb are in L . The strings aba, ba, and abc are not in L. Ex-2: Strings that end in ‘a’ L = {x : ∃y ϵ {a, b}*, (x = ya)}. The strings a, aa, aaa, bbaa and ba are in L. The strings ε, bab, and bca are not in L. L consists of all strings that can be formed by taking some string in {a, b}* and concatenating a single a onto the end of it. Ex-3: Empty language L = { } = Φ, the language that contains no strings. Note: L = { ε } the language that contains a single string, ε. Note that L is different from Φ. Ex-4: Strings of all ‘a’ s containing zero or more ‘a’s Let L = { an : n ≥ 0}. L = (ε, a, aa, aaa, aaaa, aaaaa, ... ) Ex-5: We define the following languages in terms of the prefix relation on strings: L1 = {wϵ{a, b}* : no prefix of w contains b}= { e , a, aa, aaa, aaaa, aaaaa, aaaaaa, ... } . L2 ={wϵ {a, b}*: no prefix of w starts with b}={w ϵ{a,b}*: the first character of w is a }U{ε}. L3= {wϵ {a, b}*; every prefix of w starts with b} =Φ. L3 is equal to Φ because ε is a prefix of every string. Since ε does not start with b, no strings meet L3 's requirement. Languages are sets. So, a computational definition of a language can be given in two ways; • a language generator, which enumerates (lists) the elements of the language, or • a language recognizer, which decides whether or not a candidate string is in the language and returns True if it is and False if it isn't. For example, the logical definition. L = {x: ∃y ϵ{a, b}* (x = ya)} can be turned into either a language generator (enumerator) or a language recognizer. Prepared by Harivinod N Page| 5