THEORY OF COMPUTATION

Size: px
Start display at page:

Download "THEORY OF COMPUTATION"

Transcription

1 THEORY OF COMPUTATION UNIT-1 INTRODUCTION Overview This chapter begins with an overview of those areas in the theory of computation that are basic foundation of learning TOC. This unit covers the introduction of TOC with the below topics Sets Functions Relations Languages Principle of Mathematical Induction Recursive definition Objective SETS Definition: To understand the basic concepts of Sets, Functions, Relations To know about what is a Language To learn about Mathematical induction and solving problems To know about Recursive definitions A set is a collection of objects. For example, the collection of four letters a, b, c and d is a set, which is written as L = { a, b, c, d } The objects comprising a set are called its elements or members. A set having only one element is called a singleton. A set with no element at all is called the empty set, which is denoted by ф.it is essential to have a criterion for determining, for any given thing, whether it is or is not a member of the given set. This criterion is called the Membership criterion of the set. There are two common ways to indicate the members of a set: (i) List all the elements, e.g, {a, e, i, o, u}. (ii) Provide some kind of an algorithm or a rule, such as a grammar. Let us now take a look at the notation that is being used to denote sets. (a) To indicate that x is a member of the set S, we write x S. (b) If every element of set A is also an element of set B, we say that A is a subset of B, and write A B.

2 (c) If every element of set A is also an element of set B, but B also has some elements not contained in A, we say that A is a proper subset of B and write A B. (d) We denote the empty set as { } or ф Operations on sets: (a) Union The union of two sets is the set that has objects that are elements of at least one of the two given sets, and possibly both. That is, the union of sets A and B, written A B, is a set that contains everything in A, or in B, or in both. A B = {x :x A or x B} Example: A = {1, 3, 9} B = {3, 5} Therefore, A B = {1, 3, 5, 9} (b) Intersection The intersection of sets A and B, written A B, is a set that contains exactly those elements that are in both A and B. A B = {x : x A and x B} Example: Given A = {1, 3, 9}, B = {3, 5}, C = {a, b, c} A B = {3} A C = { } (c) Set Difference The set difference of set A and set B, written as A B, is the set that contains everything that is in A but not in B. A B = {x : x A and x B} Given A = {1,3,9}, B = {3,5} A B = {1, 9} (d) Complement The complement of set A, written as A is the set containing everything that is not in A. Additional Terminology (a) Disjoint Sets. If A and B have no common element, that is, A B =, then the sets A and B are said to be disjoint. (b) Cardinality. The Cardinality of a set A, written A, is the number of elements in set A.

3 (c) Powerset. The powerset of a set A, written 2A, is the set of all subsets of A; i.e., a set containing n elements has a powerset containing 2n elements. (d) Cartesian Product. Let A and B be two sets. Then the set of all ordered pairs (x, y) where x A and y B is called the Cartesian Product of the sets A and B and is denoted by A B, i.e. A B = {(x, y) : x A and y B} Relations Definition of Relation: A relation on sets S and T is a set of ordered pairs (s, t), where (a) s S (s is a member of S ) (b) t T (c) S and T need not be different (d) The set of all first elements in the domain of the relation, and (e) The set of all second elements is the range of the relation. Example Suppose S is the set {a, b, c, d, e} and set T is {w, x, y, z}. Then a relation on S and T is R = {(a, y), (c, w), (c, z), (d, y)} The four ordered pairs in the relation is represented as shown in Fig. 2.

4 Equivalence Relation: A subset R of A A is called an equivalence relation on A if R satisfies the following conditions: (i) (a, a) R for all a A (R is reflexive) (ii) If (a, b) R, then (b, a) R, then (a, b) R (R is symmetric) (iii) If (a, b) R and (b, c) R, then (a, c) R (R is transitive) Partial Ordering Relations A relation R on a set S is called a Partial ordering or a Partial order, if R is reflexive, antisymmetric and transitive. A set S together with a partial ordering R is called a Partially ordered set or Poset. Example: The relation on the set R of real numbers is reflexive, antisymmetric and transitive. Therefore is a Partial ordering. Partition A Partition P of S is a collection {Ai} of nonempty subsets of S with the properties: (i) Each a S belongs to some Ai, (ii) If Ai Aj Aj, then Ai Aj =. Thus a partition P of S is a subdivision of S into disjoint nonempty sets. If R is an equivalence relation on a set S, for each a in S, let [a] denote the set of elements of S to which a is related under R, i.e. [a] = {x : (a, x) R} Here [a] is the Equivalence class of a in S. Example Given a relation R is circular if (a, b) R and (b, c) R (c, a) R. Show that a relation is reflexive and circular if and only if it is reflexive, symmetric, and transitive. Solution:

5 Functions: Suppose every element of S occurs exactly once as the first element of an ordered pair. In Fig shown, every element of S has exactly one arrow arising from it. This kind of relation is called a function. A function is otherwise known as Mapping. A function is said to map an element in its domain to an element in its range. Every element in S in the domain, i.e., every element of S is mapped to some element in the range. No element in the domain maps to more than one element in the range. Functions as relations A function f :A B is a relation from A to B i.e., a subset of A B, such that each a A belongs to a unique ordered pair (a, b) in f.

6 Kinds of Functions (a) One-to-One Function (Injection): A function f : A B is said to be one-to-one if different elements in the domain A have distinct images in the range. A function f is one-to-one if f (a) = f (a ) implies a = a. (b) Onto function (Surjection): A function f : A B is said to be an onto function if each element of B is the image of some element of A. i.e., f :A B is onto if the image of f is the entire co domain, i.e. if f (A) = B. i.e., f maps A onto B. (c) One-to-one onto Function (Bijection): A function that is both one-to-one and onto is called a Bijection. Such a function maps each and every element of A to exactly one element of B, with no elements left over. Fig. below shows bijection.

7 (d) Invertible function: A function f : A B is invertible if its inverse relation f 1 is a function from B to A.A function f : A B is invertible if and only it is both one-to-one and onto. Example:1 Find whether the function f (x) = x 2 from the set of integers to the set of integers is one-to-one. Solution The function f (x) = x 2 is not one-to-one as, for example f (1) = f ( 1) = 1, but 1 1. Example:2 Given f is a function f : A B where A = {a, b, c, d} and B = {1, 2, 3} with f (a) = 3, f (b) = 2, f (c) =1, and f(d) = 3. Is the function f an onto function? Solution As all three elements of the co domain are images of elements in the domain, we have f as an onto function. Languages: The general definition of a language will be "the body of words and methods of combining words used and understood by a considerable community." However, this definition is not sufficiently precise for building a mathematical theory of languages; hence we form the definition as A language is any set of sentences over an alphabet. Most languages of interest will contain an infinite number of sentences. Alphabet: An alphabet or vocabulary is any finite set of symbols. Although a unaccountably infinite number of symbols exists, we shall consider only a countable infinite subset from which all finite sets will be drawn. This subset will include digits, the Latin and Greek

8 letters both upper and lower case (possibly with combinations of subscripts, superscripts, underscores, etc.),and special symbols such as #,, and so on. Example: Roman alphabet {a, b,... z}. Binary Alphabet {0, 1} is pertinent to the theory of computation. String/sentence: A string over an alphabet is a finite sequence of symbols from that alphabet, which is usually written next to one another and not separated by commas. (i) If Σa = {0,1} then is a string over Σa. (ii) If Σb = {a, b,, z) then axyrpqstcd is a string over Σb. A sentence over an alphabet is any string of finite length composed of symbols from the alphabet. Synonyms for sentence are string and word. The empty sentence,, is the sentence consisting of no symbols. If V is an alphabet, then V* denotes the set of all sentences composed of symbols of V, including the empty sentence. We use V + to denote the set V* - { }. Thus, if V = {0, 1}, then V* = {e, 0, 1, 00, 01, 10, 11,000,...} and V + = {0, 1, 00,...}. Length of String: The length of a string is its length as a sequence. The length of a string w is written as w. Example: = 5 Empty String: The string of zero length is called the empty string. This is denoted by.the empty string plays the role of 0 in a number system. Substring: z is a substring of w if z appears consecutively within w.as an example, deck is a substring of abcdeckabcjkl. Formal Proofs Structure of proof it is just a series of statements, each one being either An assumption or A conclusion, clearly following from an assumption or previously proved result. Direct Proofs Example: Divisibility is Transitive

9 Conclusion If a and b are two natural numbers, we say that a divides b if there is another natural number k such that b = a k. If a divides b and b divides c then a divides c By our assumptions, and the definition of divisibility, there are natural numbers k1 and k2 such that b = a k1 and c = b k2.consequently, c = b k2 = a k1 k2. Let k = k1 k2. Now k is a natural number and c = a k, so by the definition of divisibility, a divides c. If P, Then Q Most proofs are (and should be) direct proofs. Always try direct proof first, unless you have a good reason not to. If you find a simple proof, and you are convinced of its correctness, then don't be shy about. Many times proofs are simple and short. Proof by Contradiction In a proof by contradiction we assume, along with the hypotheses, the logical negation of the result we wish to prove, and then reach some kind of contradiction. That is, if we want to prove "If P, Then Q", we assume P and Not Q. The contradiction we arrive at could be some conclusion contradicting one of our assumptions, or something obviously untrue like 1 = 0. Converse of a Theorem The Converse of "If P, Then Q" is the assertion "If Q, Then P". For example, the converse of "If it is my car, it's red" is "If the car is red, then its mine." It should be clear from this example that there is no guarantee that the converse of a true statement is true. Proof by Contradiction is often the most natural way to prove the converse of an already proved theorem. Proof by Contra positive Proof by contra positive takes advantage of the logical equivalence between "P implies Q" and "Not Q implies Not P". For example, the assertion "If it is my car, then it is red" is equivalent to "If that car is not red, then it is not mine". So, to prove "If P, Then Q" by the method of contra positive means to prove "If Not Q, Then Not P". Example: An integer x is called even (respectively odd) if there is another integer k for which x = 2k (respectively 2k+1). Two integers are said to have the same parity if they are both odd or both even.

10 For the purpose of this example we will assume as proved that each integer is either even or odd. Theorem. If x and y are two integers for which x+y is even, then x and y have the same parity. Proof. The contra positive version of this theorem is "If x and y are two integers with opposite parity, then their sum must be odd." So we assume x and y have opposite parity. Since one of these integers is even and the other odd, there is no loss of generality to suppose x is even and y is odd. Thus, there are integers k and m for which x = 2k and y = 2m+1. Now then, we compute the sum x+y = 2k + 2m + 1 = 2(k+m) + 1, which is an odd integer by definition. Difference The difference between the Contra positive method and the Contradiction method is subtle. Let's examine how the two methods work when trying to prove "If P, Then Q". Method of Contradiction: Assume P and Not Q and prove some sort of contradiction. Method of Contra positive: Assume Not Q and prove Not P. The method of Contra positive has the advantage that your goal is clear: Prove Not P. In the method of Contradiction, your goal is to prove a contradiction, but it is not always clear what the contradiction is going to be at the start. If and Only If Many theorems are stated in the form "P, if, and only if, Q". Another way to say the same things is: "Q is necessary and sufficient for P". This means two things: "If P, Then Q" and "If Q, Then P". So to prove an "If, and Only If" theorem, you must prove two implications. 1. Prove the if-part: Assume P and prove Q. 2. Prove the only-if-part: Assume Q, prove P. Example Theorem If a is an integer, then a is not evenly divisible by 3 if, and only if, a2-1 is evenly divisible by 3. Proof: Since this is an "If, and Only If" theorem, we must prove two implications. ("If") We must prove "a is not evenly divisible by 3 if a2-1 is evenly divisible by 3". So we assume that 3 evenly divides a2-1 = (a-1)(a+1). Since 3 is a prime number, 3 must evenly divide either a-1 or a+1. In either case, it should be apparent that 3 cannot evenly divide a.

11 ("Only If"). We must prove "a is not evenly divisible by 3 only if a2-1 is evenly divisible by 3." This means "If a is not evenly divisible by 3, then a2-1 is evenly divisible by 3". This is where we use the division algorithm stated above. We can write a = 3q + r, where r = 0, 1 or 2. Our assumption that a is not divisible by 3 implies r cannot be 0. If r =1, then a-1 = 3q and so 3 evenly divides a2-1 = (a- 1)(a+1). A similar argument works if r = 2. Note: The if and only-if parts are converses of each other. One part, say if X then Y," says nothing about whether Y is true when X is false. An equivalent form to if X then Y is if not Y then not X"; the latter is the contra positive of the former. Sometimes you can prove an "If, and Only If" assertion without explicitly dividing the proof into two parts. The next example illustrates how this might be done. Counter Examples Counter examples play an important role in mathematics. Whereas a complicated proof may be the only way to demonstrate the validity of a particular theorem, a single counter example is all that is need to refute the validity of a proposed theorem. For example, numbers in the form 22n + 1, where n is a positive integer, were once thought to be prime. These numbers are prime for n = 1, 2, 3 and 4. But when n = 5, we get = = (641)( ) a composite number. A natural place for counter examples to occur is when the converse of a known theorem comes into question. The converse of an assertion in the form "If P, Then Q" is the assertion "If Q, Then P". Principle of Mathematical Induction Strategy Mathematical Induction works like this: Suppose you want to prove a theorem in the form "For all integers n greater than equal to a, P(n) is true". P(n) must be an assertion that we wish to be true for all n = a, a+1,...; like a formula. You first verify the initial step. That is, you must verify that P(a) is true. Next comes the inductive step. Here you must prove "If there is a k, greater than or equal to a, for which P(k) is true, then for this same k, P(k+1) is true." Since you have verified P(a), it follows from the inductive step that P(a+1) is true, and hence, P(a+2) is true, and hence P(a+3) is true, and so on. In this way the theorem has been proved. Proof of induction is used to show that all elements of an infinite set have a specified property. The proof by induction has two parts, (i) Induction step (ii) Basis Step

12 Example:1 The induction step proves that for each i 1, if P(i) is true, then so is P(i +1). The basis proves that P(1) is true. When both these parts are proved, then for each i, P(i) is proved. Let us illustrate the method of writing a proof by induction. Basis: To prove that P(1) is true. Induction Step: For each i 1, assume that P(i) is true and use this assumption to show that P(i + 1) is true. A binary tree with n leaves has 2n - 1 nodes. Formally, S (T): if T is a binary tree with n leaves, then T has 2n - 1 nodes. Induction is on the size = number of nodes of T. Basis: If T has 1 leaf, it is a one-node tree. 1 =2 1-1 so OK. Induction: Assume S (U) for trees with fewer nodes than T. In particular, assume for the sub trees of T. T must be a root plus two suttees U and V. If U and V have u and v leaves, respectively, and T has t leaves, then u + v = t. By the inductive hypothesis, U and V have 2u - 1 and 2v - 1 node, respectively. Then T has 1 + (2u - 1) + (2v -A 1) nodes. o = 2(u + v) A 1. o = 2t - 1, proving the inductive step. Example:2 Theorem: For any positive integer n, n = n(n+1)/2. Proof: (Proof by Mathematical Induction) Let's let P(n) be the statement " n = (n (n+1)/2." (The idea is that P(n) should be an assertion that for any n is verifiably either true or false.) The proof will now proceed in two steps: the initial step and the inductive step Initial Step: We must verify that P(1) is True. P(1) asserts "1 = 1(2)/2", which is clearly true. So we are done with the initial step.

13 Inductive Step: Here we must prove the following assertion: "If there is a k such that P(k) is true, then (for this same k) P(k+1) is true." Thus, we assume there is a k such that k = k (k+1)/2. (We call this the inductive assumption.) We must prove, for this same k, the formula k + (k+1) = (k+1)(k+2)/ k + (k+1) = k(k+1)/2 + (k+1) = (k(k+1) + 2 (k+1))/2 = (k+1)(k+2)/2. The first equality is a consequence of the inductive assumption. Note: Math induction is of no use for deriving formulas. But it is a good way to prove the validity of a formula that you might think is true. Recurrence formulas are notoriously difficult to derive, but easy to prove valid once you have them. Recursive Definitions A recursive definition (or inductive definition) is used to define an object in terms of itself. A recursive definition of a function defines values of the functions for some inputs in terms of the values of the same function for other inputs. For example, the factorial functions n! is defined by the rules 0! = 1. (n+1)! = (n+1) n!. This definition is valid because, for all n, the recursion eventually reaches the base case of 0. Thus the definition is well-founded. The definition may also be thought of as giving a procedure describing how to construct the function n!, starting from n = 0 and proceeding onwards with n = 1, n = 2, n = 3 etc.. An inductive definition of a set describes the elements in a set in terms of other elements in the set. For example, one definition of the set N of natural numbers is: 1. 0 is in N. 2. If an element n is in N then n+1 is in N. 3. N is the smallest set satisfying (1) and (2). There are many sets that satisfy (1) and (2); clause (3) makes the definition precise by choosing the smallest such set as N. Properties of recursively defined functions and sets can often be proved by an induction principle that follows the recursive definition. For example, the definition of the natural numbers presented here directly implies the principle of mathematical induction for natural numbers: if a property holds of the natural

14 number 0, and the property holds of n+1 whenever it holds of n, then the property holds of all natural numbers Form of recursive definitions Most recursive definition has three foundations: a base case (basis), an inductive clause, and an extremal clause. The difference between a circular definition and a recursive definition is that a recursive definition must always have base cases, cases that satisfy the definition without being defined in terms of the definition itself, and all other cases comprising the definition must be "smaller" (closer to those base cases that terminate the recursion) in some sense. In contrast, a circular definition may have no base case, and define the value of a function in terms of that value itself, rather than on other values of the function. Such a situation would lead to an infinite regress Examples Prime numbers The prime numbers can be defined as consisting of: 2, the smallest prime; Each positive integer which is not evenly divisible by any of the primes smaller than itself. The integer 2 is our base case; checking the primality of any larger integer X requires us to know the primality of every integer between X and 2, but each such integer is closer to our base case of 2 than X is. Non-negative even numbers The even numbers can be defined as consisting of 0 is in the set E of non-negative evens (basis clause) For any element x in the set E, x+2 is in E (inductive clause) Nothing is in E unless it is obtained from the basis and inductive clauses (extremal clause).

15 Introduction to TOC Objectives of TOC Understand the inherent capabilities of computing/machines Understand the essence of computing through abstract models Apply these models in practice to solve problems Understand the limitations of computing Identifying the resources needed to solve a computational problem such as time, space, communication, and number of processors What is TOC? Theory of Computation is the study of the inherent capabilities and limitations of computers Theory of Computation aims at studying How and how much efficiently decided whether a given string belongs to a language or not? Abstract Model is a theoretical model of a computer hardware or software system Often used in identifying computability of a problem, analyzing complexity of algorithms. Automata theory is the study of abstract machines and problems they are able to solve Formal Languages A formal language is a set of words, i.e. finite strings of letters, symbols, or tokens The set from which these letters are taken is called the alphabet over which the language is defined A formal language L over an alphabet Σ is just a subset of Σ*, that is, a set of words over that alphabet Examples Set of all strings from { 0, 1 } Set of all strings from { a, b,... z }

16 Fig Differences among FA, PDA and Turing Machine Chomsky s Hierarchy of formal languages The Chomsky Hierarchy, as originally defined by Noam Chomsky, comprises four types of languages and their associated grammars and machines.

17 Context-Sensitive Language A context-sensitive Language is a language generated by a context sensitive grammar. Definition 1: A context-sensitive grammar is one whose productions are all of the form xay xvy where A v and x, v, y (V T )*. Context-sensitive implies the fact that the actual string modification is given by A v, while the x and y provide the context in which the rule may be applied. Definition 2: A context-sensitive grammar is one whose productions are all of the form x y where x, y (V T )+, and x y. This type of grammar is called Non-contracting as the derivation steps never decrease the length of the sentential form. This definition given above is mostly used. The two kinds of grammar are almost equivalent generating the same languages with only the exception: One kind of grammar permits languages to contain the empty

18 string, while the other doesn t. A language L is context-sensitive if there exists a context sensitive grammar G such that either L = L(G) or L = L(G) {λ}. Example Show that the language L = {a n b n c n n 1} is a context-sensitive language Solution Let us prove this by showing a context-sensitive grammar for the language. Regular Languages Most restricted, and the simplest in the Noam Chomsky Hierarchy Described using regular expressions Recognized by Finite Automata in deterministic or non deterministic form Generated by regular grammar Every finite language is regular Advantages of Regular languages Scan for virus signatures Search for information using Google Access information in digital libraries Reading text enclosed by markup language tags Search-and-replace in a word processors Validate data-entry fields like dates, , URL, credit card, IP addresses Recognizing identifiers, integers, decimal, keywords, operators in programming languages

19 Reading comments in programming languages Describing Regular languages Linear Bounded Automata A Turing machine has an infinite supply of blank tape. A linear-bounded automaton is a Turing machine whose tape is only an squares long, where n is the length of the input string and a is a constant associated with the particular linear-bounded automaton. Theorem: For every context-sensitive language L there exists a linear-bounded automaton M such that L = L(M), i.e., M accept exactly the strings of L. Theorem : For every language L accepted by a linear-bounded automaton that produces exactly L or L {λ}, depending on the definition of context sensitive grammar. Relationship among the Grammars Theorem: Every context-free language is context-sensitive.

20 Proof: The productions of a context-free language have the form A v. The productions of a context-sensitive language have the form xay xvy, where x and y are permitted to be λ. Hence the result. Theorem: There exists a context-sensitive language that is not context-free. Proof: The language {a n b n c n n 0} is not context-free (which could be proved using a pumping lemma). It can be shown that it is context-sensitive by providing an appropriate grammar. The productions of one such grammar is given here. Theorem Every context-sensitive language is recursive. Proof: A context-sensitive grammar is no contracting. Moreover, for any integer n there are only a finite number of sentential forms of length n. Therefore, for any string w we could set a bound on the number of derivation steps required to generate w, hence a bound on the number of possible derivations. The string w is in the language if and only if one of these derivations produces w. Extending Chomsky Hierarchy So far we have discussed about other types of languages besides those in the classical Chomsky hierarchy. For example, we noted that deterministic pushdown automaton were less powerful than nondeterministic pushdown automata. The table below shows a table of some of the language classes we have covered that fit readily into the hierarchy.

21 It should be noted that not all language classes fit into a hierarchy. When linear languages are considered, they fit neatly between the regular languages and the contextfree languages. However there are languages that are linear but not deterministic contextfree, and there are languages that are deterministic context-free but not linear. Language recognizers The language recognizers are the automaton which can work on a particular language. The following table describes different automaton for the formal languages

22 Summary This chapter covers the basic concepts of Sets, Relations and Functions and the operations performed with them. Various formal proofs including Deductive, If-then, If and only if, Proof by contradiction, Proof by contra positive, Proof by counter example and Mathematical induction have been discussed. The basics of TOC and Chomsky hierarchy of languages are discussed. Key Terms Set: Collection of objects Singleton: Set having only one element. Empty set: Set with no element Complement: Set containing everything not contained in the base set. Cardinality: Number of elements in a set. Power set: Set having n elements have a power set having 2n elements. Relation: A relation on two sets is a set of ordered pair. Poset: Partially ordered set. Mapping: A function is otherwise called Mapping. Injection (one-to-one function): Function is one-to-one if different elements in domain of one set have distinct images in the range. Surjection (onto function): A function is onto function if each element of a set is the image of some element of the other set. Bijection (one-to-one onto function): Function that is both one-to-one and onto Invertible function: Function is invertible if and only if it is both one-to-one and onto. Alphabet: Finite set of symbols. String: Finite sequence of symbols from an alphabet. Lexicographic ordering: Dictionary ordering, except that shorter strings precede longer strings. Language: Any set of strings over an alphabet. Kleene star: Set of all strings obtained by concatenating zero or more strings from a language. Boolean logic: System built with two values True and False. Negation: Means NOT operation Conjunction: Means AND operation Disjunction: Means OR operation. Exclusive-OR: 1 if either but not both of its operands are 1. Mathematical Induction: Has two parts (a) Induction step (b) Basis. Pigeon-hole principle: If an attempt is made to pair off the elements of A ( the pigeons ) with elements of B (the pigeon holes ), sooner or later we will have to put more than one pigeon in a pigeon hole. Context sensitive language: Language generated by a context-sensitive grammar. Context-sensitive grammar: It is one whose productions are of the form xay xvy where A V and x, v, y (V T )*. Linear Bounded automata (LBA): It is a TM whose tape is only αn squares long, where n is the length of input string and α is a constant associated with the LBA.

23 Chomsky hierarchy: Has 4 types of languages, (a) Regular language (b) Context-free language (c) Context-sensitive language (d) Recursively enumerable language. Unrestricted grammar: Production of the form α β where α,β are arbitrary strings of grammar symbols, with α λ forms unrestricted grammar. Review Questions 1. Define the following terms: (a) Set (b) Union (c) Intersection 2. Define the following terms: (a) set difference (b) Complement Explain with examples. 3. What have you understood by the following: (a) Idem potency (b) Commutatively (c) Associatively in respect of sets. 4. Define the following w.r.t. sets: (a) Distributivity (b) Absorption (c) DeMorgan s laws 5. Stand prove DeMorgan s Laws. 6. Define the following terms w.r.t. sets: (a) Disjoint sets (b) Cardinality (c) Power set (d) Cartesian product. 7. Define a relation. Explain with an example. 8. What is an equivalence relation? Give an example. 9. Explain the terms: (a) Partial ordered set/poset (b) Partition of a relation 10. What do you mean by equivalence class? 11. Define function as a relation. 12. What are the kinds of functions? 13. Explain the following with an example for each: (a) One-to-one function (b) Onto function (c) One-to-one onto function (d) Invertible function. 14. Differentiate between Injection, Surjection and bijection with examples. 15. How will you define the following: (a) string (b) alphabet in languages. 16. How do you define the length of a string? 17. Define the following in respect of languages. (a) Empty string (b) Reverse string (c) Substring (d) Concatenation 18. What do you mean by lexicographic ordering of strings? 19. What do you mean by prefix and suffix of a string?

24 20. Define a language with an example. 21. Define concatenation of strings with an example. 22. Define kleene star, with an example. 23. What are the kinds of fundamental proof techniques? 24. Explain the following with an example (in Boolean logic) (a) Negation (b) Conjunction (c) Disjunction (d) Exclusive-OR (e) Equality (f) Implication 25. State and explain the principle of Mathematical Induction with an example. 26. What do you mean by a context-sensitive grammar? 27. What do you mean Linear bounded automata? 28. Prove: Every context-free language is context-sensitive. 29. Prove: There exists a context-sensitive language that is not context-free. 30. Prove: Every context-sensitive language is recursive. 31. Given an example for (a) Context-sensitive language (b) Recursively enumerable language. 32. What are the machines corresponding to each of the following? (a) Recursively enumerable language (b) Context sensitive language (c) Context-free language (d) Regular language. 33. What do you mean by unrestricted grammar? 34. What do you mean by a random access machine?

25 Exercises

26

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be

More information

CS402 - Theory of Automata Glossary By

CS402 - Theory of Automata Glossary By CS402 - Theory of Automata Glossary By Acyclic Graph : A directed graph is said to be acyclic if it contains no cycles. Algorithm : A detailed and unambiguous sequence of instructions that describes how

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 3. Set Theory. 3.1 What is a Set? Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any

More information

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory Proof Techniques Alphabets, Strings, and Languages Foundations of Computer Science Theory Proof By Case Enumeration Sometimes the most straightforward way to prove that a property holds for all elements

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Decision Properties for Context-free Languages

Decision Properties for Context-free Languages Previously: Decision Properties for Context-free Languages CMPU 240 Language Theory and Computation Fall 2018 Context-free languages Pumping Lemma for CFLs Closure properties for CFLs Today: Assignment

More information

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia Gabriel Robins Please start solving these problems immediately, and work in study groups. Please prove

More information

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which: P R O B L E M S Finite Autom ata. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which: a) Are a multiple of three in length. b) End with the string

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

To illustrate what is intended the following are three write ups by students. Diagonalization

To illustrate what is intended the following are three write ups by students. Diagonalization General guidelines: You may work with other people, as long as you write up your solution in your own words and understand everything you turn in. Make sure to justify your answers they should be clear

More information

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN Lecture 1: Introduction Introduction to the course 2 Required Text Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, BY MICHAEL

More information

Discrete Mathematics Lecture 4. Harper Langston New York University

Discrete Mathematics Lecture 4. Harper Langston New York University Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a

More information

Power Set of a set and Relations

Power Set of a set and Relations Power Set of a set and Relations 1 Power Set (1) Definition: The power set of a set S, denoted P(S), is the set of all subsets of S. Examples Let A={a,b,c}, P(A)={,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}

More information

Slides for Faculty Oxford University Press All rights reserved.

Slides for Faculty Oxford University Press All rights reserved. Oxford University Press 2013 Slides for Faculty Assistance Preliminaries Author: Vivek Kulkarni vivek_kulkarni@yahoo.com Outline Following topics are covered in the slides: Basic concepts, namely, symbols,

More information

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1 Introduction to Automata Theory BİL405 - Automata Theory and Formal Languages 1 Automata, Computability and Complexity Automata, Computability and Complexity are linked by the question: What are the fundamental

More information

Learn Smart and Grow with world

Learn Smart and Grow with world Learn Smart and Grow with world All Department Smart Study Materials Available Smartkalvi.com TABLE OF CONTENTS S.No DATE TOPIC PAGE NO. UNIT-I FINITE AUTOMATA 1 Introduction 1 2 Basic Mathematical Notation

More information

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ). MATH 139 W12 Review 1 Checklist 1 Exam Checklist 1. Introduction to Predicates and Quantified Statements (chapters 3.1-3.4). universal and existential statements truth set negations of universal and existential

More information

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31 Sets MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Sets Fall 2014 1 / 31 Outline 1 Sets Introduction Cartesian Products Subsets Power Sets Union, Intersection, Difference

More information

Turing Machine Languages

Turing Machine Languages Turing Machine Languages Based on Chapters 23-24-25 of (Cohen 1997) Introduction A language L over alphabet is called recursively enumerable (r.e.) if there is a Turing Machine T that accepts every word

More information

CT32 COMPUTER NETWORKS DEC 2015

CT32 COMPUTER NETWORKS DEC 2015 Q.2 a. Using the principle of mathematical induction, prove that (10 (2n-1) +1) is divisible by 11 for all n N (8) Let P(n): (10 (2n-1) +1) is divisible by 11 For n = 1, the given expression becomes (10

More information

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability) MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability) Last modified: September 16, 2004 Reference: Apostol, Calculus, Vol. 2, section 13.19 (attached). The aim

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA TABLE OF CONTENTS SNo DATE TOPIC PAGE NO UNIT-I FINITE AUTOMATA 1 Introduction 1 2 Basic Mathematical Notation Techniques 3 3 Finite State systems 4 4 Basic Definitions 6 5 Finite Automaton 7 6 DFA NDFA

More information

Summary of Course Coverage

Summary of Course Coverage CS-227, Discrete Structures I Spring 2006 Semester Summary of Course Coverage 1) Propositional Calculus a) Negation (logical NOT) b) Conjunction (logical AND) c) Disjunction (logical inclusive-or) d) Inequalities

More information

2 Review of Set Theory

2 Review of Set Theory 2 Review of Set Theory Example 2.1. Let Ω = {1, 2, 3, 4, 5, 6} 2.2. Venn diagram is very useful in set theory. It is often used to portray relationships between sets. Many identities can be read out simply

More information

Theory of Programming Languages COMP360

Theory of Programming Languages COMP360 Theory of Programming Languages COMP360 Sometimes it is the people no one imagines anything of, who do the things that no one can imagine Alan Turing What can be computed? Before people even built computers,

More information

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N Mathematical Preliminaries Read pages 529-540 1. Set Theory 1.1 What is a set? A set is a collection of entities of any kind. It can be finite or infinite. A = {a, b, c} N = {1, 2, 3, } An entity is an

More information

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur Finite Automata Dr. Nadeem Akhtar Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur PhD Laboratory IRISA-UBS University of South Brittany European University

More information

Solutions to Homework 10

Solutions to Homework 10 CS/Math 240: Intro to Discrete Math 5/3/20 Instructor: Dieter van Melkebeek Solutions to Homework 0 Problem There were five different languages in Problem 4 of Homework 9. The Language D 0 Recall that

More information

Theory of Computation

Theory of Computation Theory of Computation For Computer Science & Information Technology By www.thegateacademy.com Syllabus Syllabus for Theory of Computation Regular Expressions and Finite Automata, Context-Free Grammar s

More information

r=1 The Binomial Theorem. 4 MA095/98G Revision

r=1 The Binomial Theorem. 4 MA095/98G Revision Revision Read through the whole course once Make summary sheets of important definitions and results, you can use the following pages as a start and fill in more yourself Do all assignments again Do the

More information

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions. THREE LECTURES ON BASIC TOPOLOGY PHILIP FOTH 1. Basic notions. Let X be a set. To make a topological space out of X, one must specify a collection T of subsets of X, which are said to be open subsets of

More information

Formal languages and computation models

Formal languages and computation models Formal languages and computation models Guy Perrier Bibliography John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman - Introduction to Automata Theory, Languages, and Computation - Addison Wesley, 2006.

More information

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

STABILITY AND PARADOX IN ALGORITHMIC LOGIC STABILITY AND PARADOX IN ALGORITHMIC LOGIC WAYNE AITKEN, JEFFREY A. BARRETT Abstract. Algorithmic logic is the logic of basic statements concerning algorithms and the algorithmic rules of deduction between

More information

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata Solved Subjective From Midterm Papers Dec 07,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 MIDTERM SPRING 2012 Q. Point of Kleen Theory. Answer:- (Page 25) 1. If a language can be accepted

More information

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms Chapter Summary Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms Section 5.1 Sec.on Summary Mathematical Induction Examples of Proof by Mathematical Induction Mistaken

More information

A Characterization of the Chomsky Hierarchy by String Turing Machines

A Characterization of the Chomsky Hierarchy by String Turing Machines A Characterization of the Chomsky Hierarchy by String Turing Machines Hans W. Lang University of Applied Sciences, Flensburg, Germany Abstract A string Turing machine is a variant of a Turing machine designed

More information

Theory of Computation, Homework 3 Sample Solution

Theory of Computation, Homework 3 Sample Solution Theory of Computation, Homework 3 Sample Solution 3.8 b.) The following machine M will do: M = "On input string : 1. Scan the tape and mark the first 1 which has not been marked. If no unmarked 1 is found,

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information

MA651 Topology. Lecture 4. Topological spaces 2

MA651 Topology. Lecture 4. Topological spaces 2 MA651 Topology. Lecture 4. Topological spaces 2 This text is based on the following books: Linear Algebra and Analysis by Marc Zamansky Topology by James Dugundgji Fundamental concepts of topology by Peter

More information

Decidable Problems. We examine the problems for which there is an algorithm.

Decidable Problems. We examine the problems for which there is an algorithm. Decidable Problems We examine the problems for which there is an algorithm. Decidable Problems A problem asks a yes/no question about some input. The problem is decidable if there is a program that always

More information

1. [5 points each] True or False. If the question is currently open, write O or Open.

1. [5 points each] True or False. If the question is currently open, write O or Open. University of Nevada, Las Vegas Computer Science 456/656 Spring 2018 Practice for the Final on May 9, 2018 The entire examination is 775 points. The real final will be much shorter. Name: No books, notes,

More information

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES * ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES * Pradip Peter Dey, Mohammad Amin, Bhaskar Raj Sinha and Alireza Farahani National University 3678 Aero Court San Diego, CA 92123 {pdey, mamin,

More information

Functions. How is this definition written in symbolic logic notation?

Functions. How is this definition written in symbolic logic notation? functions 1 Functions Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207 Name: 1 a 20 b 20 c 20 d 20 e 20 f 20 g 20 2 10 3 30 4 12 5 15 Total 207 CS 341 Practice Final Exam 1. Please write neatly. You will lose points if we cannot figure out what you are saying. 2. Whenever

More information

Computation Engineering Applied Automata Theory and Logic. Ganesh Gopalakrishnan University of Utah. ^J Springer

Computation Engineering Applied Automata Theory and Logic. Ganesh Gopalakrishnan University of Utah. ^J Springer Computation Engineering Applied Automata Theory and Logic Ganesh Gopalakrishnan University of Utah ^J Springer Foreword Preface XXV XXVII 1 Introduction 1 Computation Science and Computation Engineering

More information

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition. 18.433 Combinatorial Optimization Matching Algorithms September 9,14,16 Lecturer: Santosh Vempala Given a graph G = (V, E), a matching M is a set of edges with the property that no two of the edges have

More information

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar Code No: R05310501 Set No. 1 III B.Tech I Semester Regular Examinations, November 2008 FORMAL LANGUAGES AND AUTOMATA THEORY (Computer Science & Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE

More information

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2 2.2 Set Operations 127 2.2 Set Operations Introduction Two, or more, sets can be combined in many different ways. For instance, starting with the set of mathematics majors at your school and the set of

More information

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus) Math 30 Introduction to Proofs via Number Theory Robert Jewett (with small modifications by B. Ćurgus) March 30, 009 Contents 1 The Integers 3 1.1 Axioms of Z...................................... 3 1.

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 11 Ana Bove April 26th 2018 Recap: Regular Languages Decision properties of RL: Is it empty? Does it contain this word? Contains

More information

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and Computer Language Theory Chapter 4: Decidability 1 Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

More information

2.1 Sets 2.2 Set Operations

2.1 Sets 2.2 Set Operations CSC2510 Theoretical Foundations of Computer Science 2.1 Sets 2.2 Set Operations Introduction to Set Theory A set is a structure, representing an unordered collection (group, plurality) of zero or more

More information

Discrete mathematics , Fall Instructor: prof. János Pach

Discrete mathematics , Fall Instructor: prof. János Pach Discrete mathematics 2016-2017, Fall Instructor: prof. János Pach - covered material - Lecture 1. Counting problems To read: [Lov]: 1.2. Sets, 1.3. Number of subsets, 1.5. Sequences, 1.6. Permutations,

More information

Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama

Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand all of

More information

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall c Dr Oksana Shatalov, Fall 2014 1 2. Sets 2.1&2.2: Sets and Subsets. Combining Sets. Set Terminology and Notation DEFINITIONS: Set is well-defined collection of objects. Elements are objects or members

More information

DISCRETE MATHEMATICS

DISCRETE MATHEMATICS DISCRETE MATHEMATICS WITH APPLICATIONS THIRD EDITION SUSANNA S. EPP DePaul University THOIVISON * BROOKS/COLE Australia Canada Mexico Singapore Spain United Kingdom United States CONTENTS Chapter 1 The

More information

Reflection in the Chomsky Hierarchy

Reflection in the Chomsky Hierarchy Reflection in the Chomsky Hierarchy Henk Barendregt Venanzio Capretta Dexter Kozen 1 Introduction We investigate which classes of formal languages in the Chomsky hierarchy are reflexive, that is, contain

More information

Fundamental mathematical techniques reviewed: Mathematical induction Recursion. Typically taught in courses such as Calculus and Discrete Mathematics.

Fundamental mathematical techniques reviewed: Mathematical induction Recursion. Typically taught in courses such as Calculus and Discrete Mathematics. Fundamental mathematical techniques reviewed: Mathematical induction Recursion Typically taught in courses such as Calculus and Discrete Mathematics. Techniques introduced: Divide-and-Conquer Algorithms

More information

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 The entire examination is 925 points. The real final will be much shorter. Name: No books, notes, scratch paper, or calculators. Use pen

More information

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function TAFL 1 (ECS-403) Unit- V 5.1 Turing Machine 5.2 TM as computer of Integer Function 5.2.1 Simulating Turing Machine by Computer 5.2.2 Simulating Computer by Turing Machine 5.3 Universal Turing Machine 5.4

More information

Figure 1.1: This is an illustration of a generic set and its elements.

Figure 1.1: This is an illustration of a generic set and its elements. Chapter 1 Mathematical Review et theory is now generally accepted as the foundation of modern mathematics, and it plays an instrumental role in the treatment of probability. Unfortunately, a simple description

More information

Material from Recitation 1

Material from Recitation 1 Material from Recitation 1 Darcey Riley Frank Ferraro January 18, 2011 1 Introduction In CSC 280 we will be formalizing computation, i.e. we will be creating precise mathematical models for describing

More information

Name: Finite Automata

Name: Finite Automata Unit No: I Name: Finite Automata What is TOC? In theoretical computer science, the theory of computation is the branch that deals with whether and how efficiently problems can be solved on a model of computation,

More information

The Language of Sets and Functions

The Language of Sets and Functions MAT067 University of California, Davis Winter 2007 The Language of Sets and Functions Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (January 7, 2007) 1 The Language of Sets 1.1 Definition and Notation

More information

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Definition 1.1. Let X be a set and T a subset of the power set P(X) of X. Then T is a topology on X if and only if all of the following

More information

CIT3130: Theory of Computation. Regular languages

CIT3130: Theory of Computation. Regular languages ƒ CIT3130: Theory of Computation Regular languages ( M refers to the first edition of Martin and H to IALC by Hopcroft et al.) Definitions of regular expressions and regular languages: A regular expression

More information

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16 Review of Sets Review Philippe B. Laval Kennesaw State University Current Semester Philippe B. Laval (KSU) Sets Current Semester 1 / 16 Outline 1 Introduction 2 Definitions, Notations and Examples 3 Special

More information

CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia

CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia Gabriel Robins Please start solving these problems immediately, and work in study groups.

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

ECS 120 Lesson 16 Turing Machines, Pt. 2

ECS 120 Lesson 16 Turing Machines, Pt. 2 ECS 120 Lesson 16 Turing Machines, Pt. 2 Oliver Kreylos Friday, May 4th, 2001 In the last lesson, we looked at Turing Machines, their differences to finite state machines and pushdown automata, and their

More information

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3, 4}, what is the value of 2 A 2 B? Answer: 2 A 2 B = 2 A 2 B = 2 A 2 B = 8 16 = 128 Exercises Question 2: Is it true for all sets

More information

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C. 219 Lemma J For all languages A, B, C the following hold i. A m A, (reflexive) ii. if A m B and B m C, then A m C, (transitive) iii. if A m B and B is Turing-recognizable, then so is A, and iv. if A m

More information

Discrete Mathematics. Kruskal, order, sorting, induction

Discrete Mathematics.   Kruskal, order, sorting, induction Discrete Mathematics wwwmifvult/~algis Kruskal, order, sorting, induction Kruskal algorithm Kruskal s Algorithm for Minimal Spanning Trees The algorithm constructs a minimal spanning tree as follows: Starting

More information

Variants of Turing Machines

Variants of Turing Machines November 4, 2013 Robustness Robustness Robustness of a mathematical object (such as proof, definition, algorithm, method, etc.) is measured by its invariance to certain changes Robustness Robustness of

More information

Theory Bridge Exam Example Questions Version of June 6, 2008

Theory Bridge Exam Example Questions Version of June 6, 2008 Theory Bridge Exam Example Questions Version of June 6, 2008 This is a collection of sample theory bridge exam questions. This is just to get some idea of the format of the bridge exam and the level of

More information

EDAA40 At home exercises 1

EDAA40 At home exercises 1 EDAA40 At home exercises 1 1. Given, with as always the natural numbers starting at 1, let us define the following sets (with iff ): Give the number of elements in these sets as follows: 1. 23 2. 6 3.

More information

Theory of Languages and Automata

Theory of Languages and Automata Theory of Languages and Automata Chapter 3- The Church-Turing Thesis Sharif University of Technology Turing Machine O Several models of computing devices Finite automata Pushdown automata O Tasks that

More information

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from Discrete Mathematics and It's Applications Kenneth H.

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

LECTURE NOTES THEORY OF COMPUTATION

LECTURE NOTES THEORY OF COMPUTATION LECTURE NOTES ON THEORY OF COMPUTATION P Anjaiah Assistant Professor Ms. B Ramyasree Assistant Professor Ms. E Umashankari Assistant Professor Ms. A Jayanthi Assistant Professor INSTITUTE OF AERONAUTICAL

More information

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1}

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1} CSE 5 Homework 2 Due: Monday October 6, 27 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in

More information

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY KARL L. STRATOS Abstract. The conventional method of describing a graph as a pair (V, E), where V and E repectively denote the sets of vertices and edges,

More information

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures Lamé s Theorem Gabriel Lamé (1795-1870) Recursively Defined Sets and Structures Lamé s Theorem: Let a and b be positive integers with a b Then the number of divisions used by the Euclidian algorithm to

More information

Recursively Defined Functions

Recursively Defined Functions Section 5.3 Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps. BASIS STEP: Specify the value of the function at zero. RECURSIVE STEP: Give

More information

Ambiguous Grammars and Compactification

Ambiguous Grammars and Compactification Ambiguous Grammars and Compactification Mridul Aanjaneya Stanford University July 17, 2012 Mridul Aanjaneya Automata Theory 1/ 44 Midterm Review Mathematical Induction and Pigeonhole Principle Finite Automata

More information

CS525 Winter 2012 \ Class Assignment #2 Preparation

CS525 Winter 2012 \ Class Assignment #2 Preparation 1 CS525 Winter 2012 \ Class Assignment #2 Preparation Ariel Stolerman 2.26) Let be a CFG in Chomsky Normal Form. Following is a proof that for any ( ) of length exactly steps are required for any derivation

More information

Integers and Mathematical Induction

Integers and Mathematical Induction IT Program, NTUT, Fall 07 Integers and Mathematical Induction Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology TAIWAN 1 Learning Objectives Learn about

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

More information

Recursive Definitions Structural Induction Recursive Algorithms

Recursive Definitions Structural Induction Recursive Algorithms Chapter 4 1 4.3-4.4 Recursive Definitions Structural Induction Recursive Algorithms 2 Section 4.1 3 Principle of Mathematical Induction Principle of Mathematical Induction: To prove that P(n) is true for

More information

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject.

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject. Turing Machines Transducers: A transducer is a finite state machine (FST) whose output is a string and not just accept or reject. Each transition of an FST is labeled with two symbols, one designating

More information

A Reduction of Conway s Thrackle Conjecture

A Reduction of Conway s Thrackle Conjecture A Reduction of Conway s Thrackle Conjecture Wei Li, Karen Daniels, and Konstantin Rybnikov Department of Computer Science and Department of Mathematical Sciences University of Massachusetts, Lowell 01854

More information

Theory of Computations Spring 2016 Practice Final Exam Solutions

Theory of Computations Spring 2016 Practice Final Exam Solutions 1 of 8 Theory of Computations Spring 2016 Practice Final Exam Solutions Name: Directions: Answer the questions as well as you can. Partial credit will be given, so show your work where appropriate. Try

More information

Formal Languages and Automata

Formal Languages and Automata Mobile Computing and Software Engineering p. 1/3 Formal Languages and Automata Chapter 3 Regular languages and Regular Grammars Chuan-Ming Liu cmliu@csie.ntut.edu.tw Department of Computer Science and

More information

Multiple Choice Questions

Multiple Choice Questions Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Formal Language and Automata Theory Subject Code: CS 402 Multiple Choice Questions 1. The basic limitation of an FSM

More information

UNIT I PART A PART B

UNIT I PART A PART B OXFORD ENGINEERING COLLEGE (NAAC ACCREDITED WITH B GRADE) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS YEAR/SEM: III/V STAFF NAME: Dr. Sangeetha Senthilkumar SUB.CODE: CS6503 SUB.NAME:

More information

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1 Graph fundamentals Bipartite graph characterization Lemma. If a graph contains an odd closed walk, then it contains an odd cycle. Proof strategy: Consider a shortest closed odd walk W. If W is not a cycle,

More information