# CS504-Theory of Computation

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 CS504-Theory of Computation Lecture 1: Introduction Waheed Noor Computer Science and Information Technology, University of Balochistan, Quetta, Pakistan Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

2 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

3 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

4 Theory of Computation (3-0) Objective This course is mainly about abstractions of what we can compute. The treatment is mathematical, but the point of view is that of Computer Science. Roughly speaking, the theory of computation can be divided into three overlapping subareas such as formal languages and automata theory, computability theory and complexity theory. In this course: Fundamental capabilities and limitations of computers Mathematical properties of computer hardware and software Relevance to practice, for example, in the design of new programming languages, compilers, string searching, pattern matching, computer security, artificial intelligence, etc. Learn about problem solving through argue, prove, express and abstract Assignments & problem sets after each unit Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

5 Books & Resources Books Michael Sipser, Introduction to Theory of Computation, 2nd Edition, Thomson Course Technology, 2006 [3] Harry Lewis and Christos Papadimitriou, Elements of the Theory of Computation, 2nd Edition, Prentice Hall, 1998 [1] Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

6 Origin Origin Started in 1930 s by mathematicians and logicians in an attempt to understand computation Mainly, to find the answer that all mathematical problems can be solved in a systematic way These research led the computers we know and use today Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

7 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

8 Overview What can be computed? Consider a very simple model of a problem. A problem is a set of strings (often binary strings) that we wish to distinguish. Example One problem might be the set of all binary strings divisible by three. To solve this problem we need to be able to say yes or no to each candidate binary string as to whether it is in the set or not. If we have an algorithm to do this, then we have solved the problem. These kinds of problems are called decidable. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

9 Main Topics Finite Automata and Regular Languages Context-Free Languages Turing Machines Decidable and Undecidable Languages Complexity Theory Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

10 Subareas of Theory of Computation I Definition (Automata Theory) Automata theory deals with the definition, properties and power of different computation models such as finite automata, context-free grammars and Turing machines. Example Finite Automata used for text processing, compiler design and hardware design. Context-free Grammer used in defining programming languages and in AI. Turing Machines used for abstraction of real computers. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

11 Subareas of Theory of Computation II Definition (Computability Theory) Deals with the theoretical models that classify problems as being solvable or unsolvable. These models played fundamental role in the development of real computers. In 1930, Godel, Turing and Church found that some of the mathematical problems are not solvable through computation. Example An arbitrary mathematical statement is true or false Definitely we need to formally what is computer, algorithm and computation. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

12 Subareas of Theory of Computation III Definition (Complexity Theory) Deals in classifying problems based on their level of difficulty with rigorous proofs. The level of difficulty corresponds to the computational efficiency of the solution. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

13 Subareas of Theory of Computation IV Example Easy Problems (Efficiently solvable) Sorting a list of 1 million numbers Computing the fastest path from Quetta to Karachi Hard Problems Time table scheduling of all courses in a large university Factoring a large integer number (say 250 digits) into its prime factors Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

14 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

15 Preliminaries: Mathematical Concepts I Set: A collection of well defined objects Natural Numbers: A set N = {1, 2, 3,...} Integer: A set Z = {..., 2, 1, 0, 1, 2,...} Rational Numbers: A set Q = { m n : m Z, n Z, n 0} Real Numbers: A set R = {x:x is a real number} Empty Set: Denote by φ = {} Subset: If A and B are two sets then A is a subset of B, A B if every element of A is also an element of B. φ is the subset of every set. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

16 Preliminaries: Mathematical Concepts II Power set: if B is a set then power set of B is the set of all subsets of B, P(B) = {A : A B} Note φ P(B) and B P(B) Union: The union of two sets A and B is A B = {x : x A or x B} Intersection: The intersection of two sets A and B is A B = {x : x A and x B} Difference: The difference of two sets A and B is A B or A\B = {x : x A and x / B} Cartesian Product: The product of two sets A and B is A B = {(x, y) : x A and y B} Complement: The complement of a set A is A = {x : x / A} Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

17 Preliminaries: Mathematical Concepts III Binary Relation: The binary relation of two sets A and B is R such that R A B Function: A function f from set A to B is f : A B is a binary relation, R, that contains an ordered pair for each element a A as first element of the pair. Note Function f is also referred as f (a) = b or f maps a to b or image of a is b under f. The set A is called the domain of f. The set {b B : there is an a A with f (a) = b} is called the range of f. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

18 Preliminaries: Mathematical Concepts IV Injective Function: or one-to-one, if for any distinct element a A and a A, we have f (a) f (a ). Surjective Function: or onto, if for each element b B there exist a A such that f (a) = b, i.e., the range of f is the set B. Bijective Function If f is both injective and surjective. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

19 Preliminaries: Mathematical Concepts V Equivalence Relation: A binary relation R A A is equivalence relation if and only if R is reflexive, symmetric, and transitive. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

20 Preliminaries: Mathematical Concepts VI Conditions Reflexive: a A, we have (a, a) R. Symmetric: a, b A, if (a, b) R then (b, a) R. Transitive: a, b, cina, if (a, b) R) and (b, c) R then (a, c) R Example Let A = {a, b, c}, a possible equivalence relation? Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

21 Graph I A graph G consist of pair of a set V and a set E, i.e., G = (V, E), called vertices and edges, respectively. The elements of set of edges E are distinct pairs of vertices connected to each other. For example, in the following figure K 5 is the graph of five vertices and K 3,3 also called complete bipartite graph on = 6 vertices, and 3 = 9 edges. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

22 Graph II Degree of a vertix v denoted by deg(v) of a graph is the number of edges incident to the vertex, where we count the loop twice. Path in a graph is a sequence of connected vertices by edges. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

23 Alphabets, Strings & Languages Definition (Alphabet) An alphabet is a finite set of symbols. For example, letters, digits, and punctuations. The alphabet is usally denoted by Σ Example The set {0, 1} is the binary alphabet. ASCII is an example of alphabet Unicode approximately consist of 100,000 characters from alphabets around the world Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

24 Alphabets, Strings & Languages Definition (Strings) A string is a finite sequence of symbols drawn from the alphabet and that string is called the string over that alphabet. String is also sometimes called word or sentence. The length of a string s is usually written as s and the empty string is denoted by ɛ whose length is zero. Example university is a string of length ten. Concatenation Concatenation is a string operation that simply join/append a string with another string. For example, if s 1 = Balochistan and s 2 = University are two strings, then concatenation denoted by s 1 s 2 = BalcohstanUniversity. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

25 Terms for Parts of Strings Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

26 Alphabets, Strings & Languages Definition (Language) Broadly, a language is any countable set of strings over some fixed alphabet. Here it is not related to the meanings associated to the strings. Example Set of all syntactically well-formed C programs is a language. Set of all grammatically correct English sentences is also a language. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

27 Boolean Values Definition Boolean values are denoted as 1 and 0 representing true and false respectively that are used in logic, specifically connected to boolean algebra, boolean functions, and proposition calculus. The basic boolean operations and the truth table is given bellow Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

28 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

29 Theorem Definition In mathematics, a theorem is a statement that has been proved true on the basis of some previously well established statements. The proof of a theorem is the sequence of mathematical statements that justifies the truth of the theorem. A proof contains axioms (assumptions, premise, considered to be true without proof, fundamental to the subject), hypotheses, and previously proven theorems. A proof of a theorem is a logical argument that deduces the conclusion from the hypothesis. Theorem (Example) If x is odd then x 2 is odd. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

30 Some Terminologies Axiom: A starting point of reasoning, self-evident principle or a statement accepted without proof, e.g., a + b = b + a. They are also considered as assumptions that characterize the area of study. Proposition: A theorem of no particular importance and whose proof is very easy. Lemma: A short theorem that is used as stepping stone for proving some large theorems. Corollary: A theorem that clearly follows from the truth of some other theorem and often requires little or no proof. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

31 How to Prove a Theorem? I It is related to question How to solve a problem?. There is not specific way of proofing something but following tips may be helpful[2]. Read and completely understand the statement of the theorem to be proved. Most often this is the hardest part. Sometimes, theorem contains theorems inside them. For example, Property A is and only if property B, we may need to show two statements. 1 If property A is true then property B is true, i.e., A B 2 If property B is true then property A is true, i.e., B A Question Set A is equal to set B Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

32 How to Prove a Theorem? II Try to work out a few simple cases of the theorem just to get a grip on it, For example, Sum of cubes of success natural numbers (positive integers) is a square. Try to write down the proof once you have it. This is to ensure the correctness of your proof. Often, mistakes are found at the time of writing. Finding proofs takes time, we do not come prewired to produce proofs. Be patient, think, express and write clearly and try to be precise as much as possible. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

33 Proofing Techniques Some generic proofing strategies that we will study in this course are as followed: Direct Proof Constructive Proof Nonconstructive Proof Proof by Contradiction Proof by Induction Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

34 Direct Proof Definition In direct proof, we often approach the theorem directly by showing its truth or falsehood by directly combining well established facts. This strategy is often applicable to prove propositions, since the proposition are often so obviously true. In direct proof Take the original statement (hypothesis), say p. Assume it to be true. Show directly that another statement (conclusion), say q, is true. I.e., p q. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

35 Direct Proof: Examples Theorem If n is an odd positive integer then n 2 is odd as well. Proof. Assume that n is an odd positive integer that can be written as, n = 2k + 1, where k is any positive integer such that k 0. Then n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 since 2 is a common factor, we will have n 2 = 2(2k 2 + 2k) + 1 since the term 2(2k 2 + 2k) is even, and even plus one is odd, therefore we conclude that n 2 is odd. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

36 Direct Proof: Examples Theorem Let a, b and c be integers and if a divides b and a divides c then a also divides b + c. Proof. Let a, b and c be integers and assume that a divides b and a divides c, then by definition b = ak and c = al, where k and l are also integers, and then b + c = ak + al, since, a is a common factor, then we can write and since k + l is an integer, hence a divides b + c b + c = a(k + l), Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

37 Direct Proof: Examples Theorem (Class Activity) If m and n are odd integers then mn is also an odd integer. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

38 Direct Proof: Examples Theorem Let G = (V, E) be a graph, then the sum of the degrees of all vertices, deg(v), is an even integer. v V Tip: First try on some graphs. Proof. Assume G be a graph with the set of vertices V and set of edges E, then since, each edge is incident on two distinct vertices, and since, by definition, degree of a vertex is the number edges incident on that vertex, therefore, each edge will contribute 2 to the summation, hence, the sum of the degrees of all vertices is an even integer. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

39 Direct Proof: Class Work Theorem Let G = (V, E) be a graph, then the sum of the degrees of all vertices is equal to twice the number of edges, i.e, deg(v) = 2 E. Theorem v V if n is an even integer then 7n + 4 is an even integer. Theorem if m is an even integer and n is an odd integer then m + n is an odd integer. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

40 Outline 1 Course Description 2 Overview 3 Preliminaries 4 Proof Techniques 5 Quiz 1 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

41 Quiz 1 Q1 : Let m and n are integers and if m and n are perfect squares then mn is also perfect square. Q2 : If m is an even integer and n is an odd integer then mn is an even integer. Q3 : If m and n are odd integers then mn is also an odd integer. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

42 Constructive Proofs Definition A technique of proofing that shows the existence of a mathematical object by creating or providing a way for creating the object. It is also called constructive proof of existence. The structure for such theorems and proofs are as followed: Theorem There exists x, i.e., x U x and x have P(x) Proof. Let x = a (where a is a specific element in U x ) Verify that the property P(x) is true. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

43 Constructive Proofs: Example Theorem Prove that there exists an integer n such that m 7 2m+4 = 5. Comment: Often time we need to do the real work before writing the proof of a theorem. Here, we must first derive some integer value for m that satisfy the property/equation. Proof. Set m = 3, then m 7 2m+4 = 3 7 2( 3)+4 = 10 2 = 5 Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

44 Constructive Proof: Example Theorem There exists are real number x such that x 2 +3x 3 2x+3 = 1. Proof. Set x = 2, then x 2 +3x 3 2x+3 = = 7 7 = 1. You can also set x = 3 and prove. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

45 Constructive Proof: Class Activity Theorem There exists distinct positive integers m, n, and r such that each is perfect square and m = n + r. Theorem If f (x) = x 3 + x 5, then there exists a positive real number k such that f (k) = 7. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

46 Non-Constructive Proof Definition A proof that indirectly shows a mathematical object exists with out providing an example or way of creating it. Sometime, in this type of proof, we may use contradiction, which we will study shortly. Constructive, and non-constructive proof are also called proof of existence. In calculus, there are very popular example of non-constructive proof of existence such as intermediate value theorem and mean value theorem. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

47 Non-constructive Proof: Example Theorem Let f (x) = x 3 3x 2 + 2x 4, there exists a real number r such that 2 < r < 3 and f (r) = 0. Proof. Note that f (2) = 2 3 3(2 2 ) + 2(2) 4 = 4 and f (3) = 3 3 3(3 2 ) + 2(3) 4 = 2. Thus f (2) < 0 < f (3), since f is continuous function and by intermediate value theorem, there is a real number r such that 2 < r < 3 and f (r) = 0. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

48 For All Proof: Example Theorem For all positive real number x, x + 4 x 4 Comment: Some time doing proof backward is helpful but definitely you should present it in the forward manner, i.e., assuming the hypothesis and then concluding P(x). Proof. Let x be a positive real number, then clearly, (x 2) 2 0, since the square of a real number is always positive and expanding will give us x 2 4x + 4 0, and by assumption x is positive, so, dividing by x will preserve the inequality and we will get x x 0, finally, x + 4 x 4. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

49 Proof by Cases: Example Sometime, the hypothesis is broken into simpler cases that are investigated separately. Theorem If x is real number such that x 2 1 x+2 > 0, then either x > 1 or 2 > x < 1. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

50 Proof by Cases: Example Theorem For every real number a, lim x a (x 1) sin x x 2 x exists. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

51 Proof by Contradiction Definition In this technique we assume the hypotheses are true while the conclusion is false and try to reach at the contradiction. If theorem states that a statement S is true, then by contradiction we assume that the statement S is false. That is, we need to show S false is true. And if we show this false then we are at the contradiction. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

52 Proof by Contradiction: Example Theorem Let x and y be real numbers. if 5x + 25y = 1723, then x or y are not an integer. Proof. Assume x and y be real numbers such that 5x + 25y = 1723, Now, assume that both x and y are integers. Using the distributive law the expression will become 5(x + 5y) = Since, x and y are integers this implies that 1723 is divisible by 5. However, 1723 is clearly not divisible by 5. Hence, this contradiction establishes the result that x or y is not integer. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

53 Proof by Contradiction: Example Theorem For all positive real numbers a, b, and c, if ab = c, then a c or b c. Proof. Suppose, a, b, and c are positive real numbers such that ab = c, and suppose a > c and b > c, note that the c is the positive square root and by order property of real numbers, b > c ab > a c, since a > 0, and a > c a c > c. c = c, since c > 0. Thus ab > a c > c. c = c implies ab > c. But since ab = c, hence ab is not greater than c, a contradiction. This proves that our assumption a > c and b > c can not be true when a, b, and c are positive real numbers such that ab = c. Therefore, a c or b c. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

54 Proof by Contradiction: Class Activity Theorem Let n be a positive integer. If n 2 is even, then n is even. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

55 Proof by Induction Principle of Mathematical Induction Definition It is a method of proof that is used to show a given statement P(n) is true for all natural numbers n. It normally consists of two steps, base case or basis and inductive step, where the base case is to prove the given statement for first natural number, while the inductive step shows the statement is true for the next natural number. We infer, from these two steps, that the statement is true for all natural numbers. This kind of proof takes the form: Basis: Show that P(1) is true. Induction Hypothesis: Assume that for some fixed but arbitrary n 1, P(n) is true. Induction Inductive Step: Using the induction hypothesis, we show that the P(n + 1). Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

56 Proof by Induction: Example Theorem For any n 0, n = n2 +n 2 Proof. Basis Step, Let n = 0, then the sum on left is zero. Induction Hypothesis, Assume that for some n > 0, m = m2 +m 2, where m n. Induction Step, n + (n + 1) = ( n) + (n + 1) = n2 +n 2 + (n + 1) = n2 +n+2n+2 2 = (n+1)2 +(n+1) 2 Hence, proved. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

57 Homework Reading Read the contrapositive proof, show the proof of the following theorem. Hint: You can first try by direct proof, however it will be difficult therefore if you fail try the contrapositive proof. Theorem For all integers m and n, if the product mn is even, then m is even or n is even. Prove the following theorem by contradiction and direct proof. Theorem For all positive real numbers a, b, and c, if a 2 + b 2 = c 2, then a + b c. Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

58 References I Harry Lewis and Christos Papadimitriou. Elements of the Theory of Computation. Prentice Hall, 2nd edition, G. Polya. How to Solve It: A New Aspect of Mathematical Methods. Princeton University Press, 2nd edition, Michael Sipser. Introduction to the Theory of Computation. Thomson Course Technology, 2nd edition, Waheed Noor (CS&IT, UoB, Quetta) CS504-Theory of Computation March / 57

### Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

### 2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try.

2. METHODS OF PROOF 69 2. Methods of Proof 2.1. Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. Trivial Proof: If we know q is true then

### The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

The Foundations: Logic and Proofs Chapter 1, Part III: Proofs Rules of Inference Section 1.6 Section Summary Valid Arguments Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments

### 3. Mathematical Induction

3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

### Mathematical Induction. Lecture 10-11

Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach

### Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

### Introduction to Theory of Computation

Introduction to Theory of Computation Prof. (Dr.) K.R. Chowdhary Email: kr.chowdhary@iitj.ac.in Formerly at department of Computer Science and Engineering MBM Engineering College, Jodhpur Tuesday 28 th

### Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Section 2.5 Cardinality (another) Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted A = B, if and only if there is a bijection from A to B. If there is an injection

### CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

CHAPTER 3 Methods of Proofs 1. Logical Arguments and Formal Proofs 1.1. Basic Terminology. An axiom is a statement that is given to be true. A rule of inference is a logical rule that is used to deduce

### Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

### Lecture 16 : Relations and Functions DRAFT

CS/Math 240: Introduction to Discrete Mathematics 3/29/2011 Lecture 16 : Relations and Functions Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT In Lecture 3, we described a correspondence

### Lecture 17 : Equivalence and Order Relations DRAFT

CS/Math 240: Introduction to Discrete Mathematics 3/31/2011 Lecture 17 : Equivalence and Order Relations Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last lecture we introduced the notion

### CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

### Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

### CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

### Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing

### This chapter is all about cardinality of sets. At first this looks like a

CHAPTER Cardinality of Sets This chapter is all about cardinality of sets At first this looks like a very simple concept To find the cardinality of a set, just count its elements If A = { a, b, c, d },

### Regular Languages and Finite Automata

Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

### Solutions for Practice problems on proofs

Solutions for Practice problems on proofs Definition: (even) An integer n Z is even if and only if n = 2m for some number m Z. Definition: (odd) An integer n Z is odd if and only if n = 2m + 1 for some

### Automata and Formal Languages

Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

### Basic Proof Techniques

Basic Proof Techniques David Ferry dsf43@truman.edu September 13, 010 1 Four Fundamental Proof Techniques When one wishes to prove the statement P Q there are four fundamental approaches. This document

### CS 441 Discrete Mathematics for CS Lecture 5. Predicate logic. CS 441 Discrete mathematics for CS. Negation of quantifiers

CS 441 Discrete Mathematics for CS Lecture 5 Predicate logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x)

### Section 6-2 Mathematical Induction

6- Mathematical Induction 457 In calculus, it can be shown that e x k0 x k k! x x x3!! 3!... xn n! where the larger n is, the better the approximation. Problems 6 and 6 refer to this series. Note that

### Cartesian Products and Relations

Cartesian Products and Relations Definition (Cartesian product) If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) :(a A) and (b B)}. The following points are worth special

### Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

### INTRODUCTORY SET THEORY

M.Sc. program in mathematics INTRODUCTORY SET THEORY Katalin Károlyi Department of Applied Analysis, Eötvös Loránd University H-1088 Budapest, Múzeum krt. 6-8. CONTENTS 1. SETS Set, equal sets, subset,

### Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the

### Mathematical Induction

Mathematical Induction (Handout March 8, 01) The Principle of Mathematical Induction provides a means to prove infinitely many statements all at once The principle is logical rather than strictly mathematical,

### 1 if 1 x 0 1 if 0 x 1

Chapter 3 Continuity In this chapter we begin by defining the fundamental notion of continuity for real valued functions of a single real variable. When trying to decide whether a given function is or

### SECTION 10-2 Mathematical Induction

73 0 Sequences and Series 6. Approximate e 0. using the first five terms of the series. Compare this approximation with your calculator evaluation of e 0.. 6. Approximate e 0.5 using the first five terms

### Introduction to Automata Theory. Reading: Chapter 1

Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a

### SCORE SETS IN ORIENTED GRAPHS

Applicable Analysis and Discrete Mathematics, 2 (2008), 107 113. Available electronically at http://pefmath.etf.bg.ac.yu SCORE SETS IN ORIENTED GRAPHS S. Pirzada, T. A. Naikoo The score of a vertex v in

### Applications of Methods of Proof

CHAPTER 4 Applications of Methods of Proof 1. Set Operations 1.1. Set Operations. The set-theoretic operations, intersection, union, and complementation, defined in Chapter 1.1 Introduction to Sets are

### 136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

136 TER 4. INDUCTION, GRHS ND TREES 4.3 Graphs In this chapter we introduce a fundamental structural idea of discrete mathematics, that of a graph. Many situations in the applications of discrete mathematics

### MA651 Topology. Lecture 6. Separation Axioms.

MA651 Topology. Lecture 6. Separation Axioms. This text is based on the following books: Fundamental concepts of topology by Peter O Neil Elements of Mathematics: General Topology by Nicolas Bourbaki Counterexamples

### Computability Theory

CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

### Mathematical Induction. Mary Barnes Sue Gordon

Mathematics Learning Centre Mathematical Induction Mary Barnes Sue Gordon c 1987 University of Sydney Contents 1 Mathematical Induction 1 1.1 Why do we need proof by induction?.... 1 1. What is proof by

### 13 Infinite Sets. 13.1 Injections, Surjections, and Bijections. mcs-ftl 2010/9/8 0:40 page 379 #385

mcs-ftl 2010/9/8 0:40 page 379 #385 13 Infinite Sets So you might be wondering how much is there to say about an infinite set other than, well, it has an infinite number of elements. Of course, an infinite

### Midterm Practice Problems

6.042/8.062J Mathematics for Computer Science October 2, 200 Tom Leighton, Marten van Dijk, and Brooke Cowan Midterm Practice Problems Problem. [0 points] In problem set you showed that the nand operator

### PART I. THE REAL NUMBERS

PART I. THE REAL NUMBERS This material assumes that you are already familiar with the real number system and the representation of the real numbers as points on the real line. I.1. THE NATURAL NUMBERS

### 6.3 Conditional Probability and Independence

222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

### Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

### CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

### Announcements. CompSci 230 Discrete Math for Computer Science Sets. Introduction to Sets. Sets

CompSci 230 Discrete Math for Computer Science Sets September 12, 2013 Prof. Rodger Slides modified from Rosen 1 nnouncements Read for next time Chap. 2.3-2.6 Homework 2 due Tuesday Recitation 3 on Friday

### Discrete Mathematics: Solutions to Homework (12%) For each of the following sets, determine whether {2} is an element of that set.

Discrete Mathematics: Solutions to Homework 2 1. (12%) For each of the following sets, determine whether {2} is an element of that set. (a) {x R x is an integer greater than 1} (b) {x R x is the square

### Foundations of Logic and Mathematics

Yves Nievergelt Foundations of Logic and Mathematics Applications to Computer Science and Cryptography Birkhäuser Boston Basel Berlin Contents Preface Outline xiii xv A Theory 1 0 Boolean Algebraic Logic

### Handout #1: Mathematical Reasoning

Math 101 Rumbos Spring 2010 1 Handout #1: Mathematical Reasoning 1 Propositional Logic A proposition is a mathematical statement that it is either true or false; that is, a statement whose certainty or

### 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

### Reading 13 : Finite State Automata and Regular Expressions

CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

### Sample Induction Proofs

Math 3 Worksheet: Induction Proofs III, Sample Proofs A.J. Hildebrand Sample Induction Proofs Below are model solutions to some of the practice problems on the induction worksheets. The solutions given

### Mathematical induction. Niloufar Shafiei

Mathematical induction Niloufar Shafiei Mathematical induction Mathematical induction is an extremely important proof technique. Mathematical induction can be used to prove results about complexity of

### Mathematics for Computer Science

Mathematics for Computer Science Lecture 2: Functions and equinumerous sets Areces, Blackburn and Figueira TALARIS team INRIA Nancy Grand Est Contact: patrick.blackburn@loria.fr Course website: http://www.loria.fr/~blackbur/courses/math

### Examination paper for MA0301 Elementær diskret matematikk

Department of Mathematical Sciences Examination paper for MA0301 Elementær diskret matematikk Academic contact during examination: Iris Marjan Smit a, Sverre Olaf Smalø b Phone: a 9285 0781, b 7359 1750

### Class One: Degree Sequences

Class One: Degree Sequences For our purposes a graph is a just a bunch of points, called vertices, together with lines or curves, called edges, joining certain pairs of vertices. Three small examples of

### Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics An Introductory Single Variable Real Analysis: A Learning Approach through Problem Solving Marcel B. Finan c All Rights

### Introduction. Appendix D Mathematical Induction D1

Appendix D Mathematical Induction D D Mathematical Induction Use mathematical induction to prove a formula. Find a sum of powers of integers. Find a formula for a finite sum. Use finite differences to

### APPLICATIONS OF THE ORDER FUNCTION

APPLICATIONS OF THE ORDER FUNCTION LECTURE NOTES: MATH 432, CSUSM, SPRING 2009. PROF. WAYNE AITKEN In this lecture we will explore several applications of order functions including formulas for GCDs and

### Appendix F: Mathematical Induction

Appendix F: Mathematical Induction Introduction In this appendix, you will study a form of mathematical proof called mathematical induction. To see the logical need for mathematical induction, take another

### Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called

### We now explore a third method of proof: proof by contradiction.

CHAPTER 6 Proof by Contradiction We now explore a third method of proof: proof by contradiction. This method is not limited to proving just conditional statements it can be used to prove any kind of statement

### Math 223 Abstract Algebra Lecture Notes

Math 223 Abstract Algebra Lecture Notes Steven Tschantz Spring 2001 (Apr. 23 version) Preamble These notes are intended to supplement the lectures and make up for the lack of a textbook for the course

### 1. Prove that the empty set is a subset of every set.

1. Prove that the empty set is a subset of every set. Basic Topology Written by Men-Gen Tsai email: b89902089@ntu.edu.tw Proof: For any element x of the empty set, x is also an element of every set since

### Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs Kousha Etessami U. of Edinburgh, UK Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 6) 1 / 13 Overview Graphs and Graph

### 1.1 Logical Form and Logical Equivalence 1

Contents Chapter I The Logic of Compound Statements 1.1 Logical Form and Logical Equivalence 1 Identifying logical form; Statements; Logical connectives: not, and, and or; Translation to and from symbolic

### THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER JASPER DEANTONIO Abstract. This paper is a study of the Turing Degrees, which are levels of incomputability naturally arising from sets of natural numbers.

### The Halting Problem is Undecidable

185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

### 6.2 Permutations continued

6.2 Permutations continued Theorem A permutation on a finite set A is either a cycle or can be expressed as a product (composition of disjoint cycles. Proof is by (strong induction on the number, r, of

### Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011 A. Miller 1. Introduction. The definitions of metric space and topological space were developed in the early 1900 s, largely

### (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

### The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

The Prime Numbers Before starting our study of primes, we record the following important lemma. Recall that integers a, b are said to be relatively prime if gcd(a, b) = 1. Lemma (Euclid s Lemma). If gcd(a,

### MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

MATHEMATICAL INDUCTION MIGUEL A LERMA (Last updated: February 8, 003) Mathematical Induction This is a powerful method to prove properties of positive integers Principle of Mathematical Induction Let P

### MATH10040 Chapter 2: Prime and relatively prime numbers

MATH10040 Chapter 2: Prime and relatively prime numbers Recall the basic definition: 1. Prime numbers Definition 1.1. Recall that a positive integer is said to be prime if it has precisely two positive

### You know from calculus that functions play a fundamental role in mathematics.

CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.

### Graph Theory Problems and Solutions

raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

### Homework until Test #2

MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

### Answer Key for California State Standards: Algebra I

Algebra I: Symbolic reasoning and calculations with symbols are central in algebra. Through the study of algebra, a student develops an understanding of the symbolic language of mathematics and the sciences.

### 2 Complex Functions and the Cauchy-Riemann Equations

2 Complex Functions and the Cauchy-Riemann Equations 2.1 Complex functions In one-variable calculus, we study functions f(x) of a real variable x. Likewise, in complex analysis, we study functions f(z)

### 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### Math212a1010 Lebesgue measure.

Math212a1010 Lebesgue measure. October 19, 2010 Today s lecture will be devoted to Lebesgue measure, a creation of Henri Lebesgue, in his thesis, one of the most famous theses in the history of mathematics.

### Degree Hypergroupoids Associated with Hypergraphs

Filomat 8:1 (014), 119 19 DOI 10.98/FIL1401119F Published by Faculty of Sciences and Mathematics, University of Niš, Serbia Available at: http://www.pmf.ni.ac.rs/filomat Degree Hypergroupoids Associated

### Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

### C H A P T E R Regular Expressions regular expression

7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun

### CHAPTER 2: METHODS OF PROOF

CHAPTER 2: METHODS OF PROOF Section 2.1: BASIC PROOFS WITH QUANTIFIERS Existence Proofs Our first goal is to prove a statement of the form ( x) P (x). There are two types of existence proofs: Constructive

### Theory of Computation Lecture Notes

Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked

### Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014 3.4: 1. If m is any integer, then m(m + 1) = m 2 + m is the product of m and its successor. That it to say, m 2 + m is the

### Introduction to Theory of Computation. School of Computer Science Carleton University Ottawa Canada

Introduction to Theory of Computation Anil Maheshwari Michiel Smid School of Computer Science Carleton University Ottawa Canada {anil,michiel}@scs.carleton.ca April 11, 2016 ii Contents Contents Preface

### PROBLEM SET 7: PIGEON HOLE PRINCIPLE

PROBLEM SET 7: PIGEON HOLE PRINCIPLE The pigeonhole principle is the following observation: Theorem. Suppose that > kn marbles are distributed over n jars, then one jar will contain at least k + marbles.

### Introduction to Graph Theory

Introduction to Graph Theory Allen Dickson October 2006 1 The Königsberg Bridge Problem The city of Königsberg was located on the Pregel river in Prussia. The river divided the city into four separate

### WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

### k, then n = p2α 1 1 pα k

Powers of Integers An integer n is a perfect square if n = m for some integer m. Taking into account the prime factorization, if m = p α 1 1 pα k k, then n = pα 1 1 p α k k. That is, n is a perfect square

### Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

### Week 5: Binary Relations

1 Binary Relations Week 5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

### 3515ICT Theory of Computation Turing Machines

Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation

### The last three chapters introduced three major proof techniques: direct,

CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

### MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.

MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on

### Problem Set I: Preferences, W.A.R.P., consumer choice

Problem Set I: Preferences, W.A.R.P., consumer choice Paolo Crosetto paolo.crosetto@unimi.it Exercises solved in class on 18th January 2009 Recap:,, Definition 1. The strict preference relation is x y

### Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction