Lecture 2 : Propositions DRAFT

Similar documents
Bases for Vector Spaces

Lecture 3: Equivalence Relations

Parse trees, ambiguity, and Chomsky normal form

2.4 Linear Inequalities and Interval Notation

p-adic Egyptian Fractions

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

List all of the possible rational roots of each equation. Then find all solutions (both real and imaginary) of the equation. 1.

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

A study of Pythagoras Theorem

Mathematics Number: Logarithms

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Homework 3 Solutions

Convert the NFA into DFA

Bridging the gap: GCSE AS Level

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Chapter 9 Definite Integrals

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Surface maps into free groups

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

Linear Systems with Constant Coefficients

Linear Inequalities. Work Sheet 1

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Fast Boolean Algebra

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

The Regulated and Riemann Integrals

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

MATH 573 FINAL EXAM. May 30, 2007

20 MATHEMATICS POLYNOMIALS

Calculus Module C21. Areas by Integration. Copyright This publication The Northern Alberta Institute of Technology All Rights Reserved.

Nondeterminism and Nodeterministic Automata

Math 4310 Solutions to homework 1 Due 9/1/16

Quadratic Forms. Quadratic Forms

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Boolean algebra.

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

Introduction to Algebra - Part 2

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

1B40 Practical Skills

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

MAA 4212 Improper Integrals

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE

Homework Solution - Set 5 Due: Friday 10/03/08

Finite Automata-cont d

Chapter 6 Techniques of Integration

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

Handout: Natural deduction for first order logic

Section 6.1 INTRO to LAPLACE TRANSFORMS

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

CS 330 Formal Methods and Models

CM10196 Topic 4: Functions and Relations

First Midterm Examination

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Review of Gaussian Quadrature method

Name Ima Sample ASU ID

First Midterm Examination

Lecture 2e Orthogonal Complement (pages )

Coalgebra, Lecture 15: Equations for Deterministic Automata

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

An Overview of Integration

CSE396 Prelim I Answer Key Spring 2017

Is there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them!

expression simply by forming an OR of the ANDs of all input variables for which the output is

1 Nondeterministic Finite Automata

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

1 Probability Density Functions

Designing finite automata II

6.2 The Pythagorean Theorems

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

Math 8 Winter 2015 Applications of Integration

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Chapter 8.2: The Integral

8. Complex Numbers. We can combine the real numbers with this new imaginary number to form the complex numbers.

set is not closed under matrix [ multiplication, ] and does not form a group.

MA123, Chapter 10: Formulas for integrals: integrals, antiderivatives, and the Fundamental Theorem of Calculus (pp.

Section 4: Integration ECO4112F 2011

Infinite Geometric Series

Lecture 08: Feb. 08, 2019

Chapter 0. What is the Lebesgue integral about?

7. Indefinite Integrals

KNOWLEDGE-BASED AGENTS INFERENCE

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Things to Memorize: A Partial List. January 27, 2017

7.1 Integral as Net Change and 7.2 Areas in the Plane Calculus

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

Special Numbers, Factors and Multiples

T 1 T 2 T 3 T 4 They may be illustrated by triangular patterns of numbers (hence their name) as shown:

Minimal DFA. minimal DFA for L starting from any other

More on automata. Michael George. March 24 April 7, 2014

THE NUMBER CONCEPT IN GREEK MATHEMATICS SPRING 2009

2 b. , a. area is S= 2π xds. Again, understand where these formulas came from (pages ).

10. AREAS BETWEEN CURVES

Section 6: Area, Volume, and Average Value

Transcription:

CS/Mth 240: Introduction to Discrete Mthemtics 1/20/2010 Lecture 2 : Propositions Instructor: Dieter vn Melkeeek Scrie: Dlior Zelený DRAFT Lst time we nlyzed vrious mze solving lgorithms in order to illustrte some of the techniques covered in this course. We did not expect you to understnd everything from tht lecture. We did not prove everything s formlly s we should hve, either. From now on, we will e more rigorous, nd you should sk question whenever you don t understnd something. 2.1 Propositions nd Proofs Rememer tht the gol of this course is to tech you how to reson out discrete structures in rigorous mnner. To tht end, we discuss propositions in this lecture. Propositions re cler sttements tht re either true or flse. Definition 2.1. A proposition is sttement tht is either true or flse. Definition 2.2. A proof of proposition is chin of logicl deductions ending in the proposition nd strting from some xioms. We mke few remrks out Definition 2.2. First, think of logicl deductions s steps tht re logiclly sound. Second, xioms re sttements we tke for grnted nd, therefore, don t need to prove. The set of xioms depends on the re we work in. For exmple, when we tlk out Eucliden geometry, there re five sic xioms. The first xiom of Eucliden geometry sttes tht we cn drw stright line segment connecting ny two points. 2.1.1 Proofs By Picture A common proof technique is to cpture proposition using descriptive pictures nd then reson out the pictures. This is very powerful technique s it llows us to use our intuition. It is sid tht picture is worth thousnd words ; however, e wrned tht in some cses our intuition my led us stry. Wenowgivesomeproofsypicturesexmples. OurfirstexmpleisproofofthePythgoren Theorem. Our second exmple is proof y picture tht leds to n incorrect conclusion. c Figure 2.1: A right tringle with sides of length,, nd c Proposition 2.3 (Pythgoren Theorem). In right tringle where the hypotenuse hs length c nd the other two sides hve lengths nd, we hve 2 + 2 = c 2. 1

2.1. Propositions nd Proofs Proof. Consider right tringle like the one in Figure 2.1. We tke four copies of the tringle nd rrnge them in two different wys. First, form squre with the hypotenuse s the side. Its re is c 2. We show this rrngement in Figure 2.2. The four copies of the right tringle re shded in drk gry. The spce shded light gry inside the squre in Figure 2.2 is squre of side length. c () An rrngement of four copies of the right tringle from Figure 2.1. There is squre in the middle. () A rerrngement of Figure 2.2. Figure 2.2: Two rrngements of four tringles nd squre. Now rerrnge the five pieces differently, s shown in Figure 2.2. The thick lue lines indicte tht we cn view this rrngement s two squres of sides nd plced next to ech other. The squre on the right hs length is, so the re of tht squre is 2. The squre on the left hs side length, so its re is 2, nd the totl re is, therefore, 2 + 2. Since we otined the second picture from the first one y rerrnging, they hve the sme re, which completes the proof tht 2 + 2 = c 2. Nowlet ssee proof offlsesttement. ItlooksverysimilrtotheproofofthePythgoren Theorem we just did, ut hs mistke in it. Tke the next exmple s wrning tht you hve to e creful when you write proofs. Incorrect proof tht 1 = 2. Two right tringles with sides 10 nd 11 form rectngle with re 10 11 = 110. The sitution is shown in Figure 2.3. Tke out smll pieces from the corners. As we cn see from the picture, they re right tringles whose two shorter sides oth hve length 1. Now slide the two remining prts of the tringles together so tht they form rectngle gin. The new rectngle hs side lengths 10 nd 11, nd, thus, n re of 10 11 = 110. We lso hve two extr pieces with totl re of 1. This is shown in Figure 2.3. Since we otined Figure 2.3 from Figure 2.3, oth pictures hve the sme re, which implies tht 110 = 111. Sutrcting 109 from oth sides gives us 1 = 2. The issue is tht we drew misleding picture in Figure 2.3. The picture looks like squre, which mde us think tht the two shorter sides of our smll tringles we were cutting out oth hd length 1. But tht is not true. When one side hs length 1, the other side hs length either 11/10 or 10/11. 2

2.1. Propositions nd Proofs () Arrows show how to slide the remining prts of our two tringles fter cutting out the shded corner pieces. () A rerrngement of the picture from Figure 2.3. Figure 2.3: A picture for n incorrect proof tht 1 = 2. 2.1.2 More on Propositions Recll from Definition 2.1 tht proposition is sttement tht is either true or flse. Let us see some exmples of propositions. Exmple 2.1: P 1 : Mdison is the cpitl of Wisconsin. - this is true proposition P 2 : The Yhr river flows into Lke Michign. - this is flse proposition Now let s see some sttements tht re not propositions Exmple 2.2: Wht is the cpitl of Wisconsin? - This is question, not sttement. Is Mdison the cpitl of Wisconsin? - Tht s little etter. This is yes/no question; nonetheless, it is still question nd not sttement. This sentence is not true. - This is not vlid proposition. We cnnot ssign truth vlue to this sttement. The lst sentence is sttement to which we cnnot ssign truth vlue. Assume the sentence were true. Then the sttement would sy tht the sentence is flse, which is contrdiction ecuse we sid it ws true. On the other hnd, suppose the sttement were flse. Then the sentence would e true, nd we hve contrdiction gin. The lst sentence is self-referentil sttement tht is contrdictory. It is lso connected to the hlting prolem, nd we my sy something out tht lter in the course. We will not del with sttements like this sentence is flse in this course. Let s look t some sttements tht we re ctully going to see in this course. Exmple 2.3: 3

2.2. Opertions on Propositions G: Every even integer lrger thn 2 cn e expressed s the sum of two primes. Recll tht primes re positive integers greter thn one tht re only divisile y 1 nd themselves. The first few primes re 2,3,5,7,11,... In order to rgue tht the sttement G is flse, we would need to find n even integer tht cnnot e written s sum of two primes. To show tht this sttement is true, we would need to rgue out infinitely mny integers. It is ctully not known whether G is true sttement or not. It is clled Goldch s conjecture. People hve tried to find proof s well s counterexmple, ut hve not succeeded yet. To strt verifying Goldch s conjecture, we could strt writing even numers nd finding two primes for ech of them. For exmple, 4 = 2+2, 6 = 3+3, nd 8 = 3+5. (Note tht the sttement doesn t sy nything out repeting primes, which is why we cn write 4 = 2+2.) But there re infinitely mny even integers greter thn 2, so we would never complete such proof. Now consider the following modifiction of G: Every integer greter thn 3 cn e expressed s sum of two primes. This is flse sttement. It my not seem tht wy t first ecuse it holds for ll integers up to 10. But we cnnot write 11 s sum of two primes. Notice tht 11 is n odd numer. If we wnt to rek ny odd numer n into two integers tht dd up to n, one of the two integer pieces must e even nd the other one must e odd ecuse tht s the only wy how we cn get n odd integer s sum of two integers. Since we wnt oth of the integer pieces to e prime, the even piece must e 2 ecuse 2 is the only even prime. But if we wnt the two pieces to dd up to 11, this forces the other piece to e 9, which is not prime. Hence, we cnnot write 11 s sum of two primes, nd our modifiction of G is flse. 2.2 Opertions on Propositions By n opertion on propositions, we men tht we tke one or more propositions nd comine them to get new proposition. In English, we use words such s not, nd, or, if...then to do so. The mthemticl symols for these re,, nd, respectively. In progrmming lnguge, we would use the symols!, &&,, nd if sttements, respectively. We need to e creful when going from English to the lnguge of mthemtics or to progrmming lnguge, however. The word or don t trnslte exctly into. For exmple, when we sy you cn hve cke or you cn hve ice crem, we usully give the person we tlk to n option to tke one or the other, ut not oth. Tht is, the mening is exclusive. But to mthemticin, or is not exclusive, so mthemticin could tke oth cke nd ice crem. There is similr issue with the if-then construct. Suppose fther tells his son: If you grdute with 4.0 GPA, I will uy you cr. The intended mening is tht the son will get the cr only if he gets 4.0. As we will see, child who is mthemticin cn hope to get cr even without 4.0 GPA. 2.2.1 Overview of Opertions First let s view the word not s the mthemticl opertion. If P is proposition, we red P s not P. No mtter wht P is, P is true when P is flse, nd P is flse when P is true. We cpture this notion in the form of truth tle. See the truth tle of the opertor in Tle 2.1. In ll tles elow, T stnds for true nd F stnds for flse. Now let s see the menings of nd, or, nd if...then in the lnguge of mthemtics. If P nd Q re propositions, we red P Q s P nd Q, P Q s P or Q, nd P Q s P 4

2.2. Opertions on Propositions P P T F F T Tle 2.1: The truth tle of not ( ) implies Q. In the impliction P Q, we cll P the premise nd Q the consequence. We list the truth tles of the three opertors we just discussed together in Tle 2.2. P Q P Q P Q P Q T T T T T T F F T F F T F T T F F F F T Tle 2.2: Truth tles of nd ( ), or ( ), nd implies ( ). We see from the truth tle of why mthemticin cn get oth cke nd ice crem. The row in the truth tle of P Q where P nd Q re oth true hs truth vlue of T. Hence, if P stnds for you get cke nd Q stnds for you get ice crem, tking oth mkes the sentence you get cke or you get ice crem true, which mens tking oth is vlid option. Now let s see why children who study mthemtics cn hope to get cr even if they don t get 4.0 GPA. We see from the truth tle tht the only wy the sttement P Q cn e flse is if the premise you hve 4.0 GPA is true nd the consequence you get cr is flse. Thus, if the premise is flse, the consequence cn e either true or flse for the impliction to e true. 2.2.2 More Exmples of Implictions Let s recll some propositions we stted erlier in this lecture. P 1 : Mdison is the cpitl of Wisconsin. P 2 : The Yhr river flows into Lke Michign. G: Every even integer lrger thn 2 cn e expressed s the sum of two primes. Exmple 2.4: Consider the impliction G P 1. In English, this sys If Goldch s conjecture is true, then Mdison is the cpitl of Wisconsin. This is true proposition. We would e tempted to sy tht the proposition is flse ecuse we don t know whether G holds or not. But we know tht Mdison is the cpitl of Wisconsin, nd oth rows of the truth tle of n impliction where the consequence is true hve T s the truth vlue (see Tle 2.2 with P = G nd Q = P 1 ). Thus, regrdless of the truth of Goldch s conjecture, the impliction G P 1 is true. Exmple 2.5: Consider the following proposition: If P 2 then 1 = 2. This is true proposition. The premise P 2 is flse nd the consequence is flse, so the impliction is true. Exmple 2.6: If P 1 then 1 = 2 is flse proposition. The premise is true, the consequence is flse, nd the truth tle of the impliction for this cse sys flse. Let us stress once gin tht this is the only wy in which n impliction cn e flse. 5

2.2. Opertions on Propositions In the spirit of the lst exmple, we my e tempted to prove Goldch s conjecture y sying tht If 1 = 2 then Goldch s conjecture holds. However, this does not constitute vlid proof. This only gives us true impliction. For proof to e vlid, it does not suffice to give true impliction. We lso need to show tht the premise of tht impliction is true in order to get vlid proof. We will discuss this in more detil lter. 2.2.3 Comining Propositions Once we hve opertors, we cn strt comining them to otin propositionl formuls such s (P ( P Q)). Definition 2.4. A propositionl formul is proposition otined y pplying finite numer of opertors (,,, ) to propositionl vriles (P,Q,...). 2.2.4 Logicl Equivlence It my e the cse tht multiple propositionl formuls re the sme. Definition 2.5. Let F 1 nd F 2 e two propositionl formuls. We sy F 1 nd F 2 re logiclly equivlent if they hve the sme truth vlue for ll possile settings of the vriles. Exmple 2.7: P ( P Q) is logiclly equivlent to P Q. There re mny wys to see this. Since we re discussing truth tles, let us look t the truth tles of the two propositionl formuls. If we compre the truth tles of the two propositionl formuls row y row nd find no difference, then, y Definition 2.5, the two formuls re logiclly equivlent. We show the truth tles together in Figure 2.3. Notice tht the columns corresponding to P ( P Q) nd P Q re the sme, so the two formuls re indeed logiclly equivlent. P Q P P Q P ( P Q) P Q T T F F T T T F F T T T F T T T T T F F T F F F Tle 2.3: Showing tht P ( P Q) nd P Q re logiclly equivlent. Exmple 2.8: P Q is logiclly equivlent to Q P. For exmple, sy P = it is snowing nd Q = it is cold. Then P Q sys If it is snowing, then it is cold, nd Q P sys If it is not cold, it is not snowing. Intuitively, those two sentences sy the sme thing. Let s see the truth tles in Tle 2.4 for verifiction. P Q P Q Q P P Q T T F F T T T F F T F F F T T F T T F F T T T T Tle 2.4: Showing tht P Q nd Q P re logiclly equivlent. 6

2.2. Opertions on Propositions We cll Q P the contrpositive proposition of P Q. This is n importnt concept for proofs. Since n impliction is logiclly equivlent to its contrpositive, it suffices to prove the contrpositive in order to prove the impliction. This is common technique in writing proofs ecuse the contrpositive my hve simpler or more intuitive proof thn the impliction. An impliction lso hs converse. The converse of the impliction P Q is the impliction Q P. Exmple 2.9: The impliction nd its converse re not logiclly equivlent. Look t Tle 2.5 which shows the truth tles of the two implictions. The two middle rows of those truth tles re different, so P Q nd Q P re not logiclly equivlent. P Q P Q Q P T T T T T F F T F T T F F F T T Tle 2.5: Showing tht n impliction nd its converse re not logiclly equivlent. Consider P: it is snowing nd Q: it is cold. The impliction P Q sys tht if it is snowing, it is cold, while the impliction Q P sys tht if it is cold, it is snowing. The former doesn t llow the possiility of wrm wether when it snows, while the ltter does llow tht. 2.2.5 The Equivlence Opertor There is nother logicl opertor tht we use in mthemtics. We use it to denote tht oth n impliction nd its converse hold. We write this s P Q nd red s P if nd only if Q. In other words, P Q is logiclly equivlent to (P Q) (Q P). Agin recll the sttements P 1 nd P 2 from erlier. We use them in the exmple elow. Exmple 2.10: P 1 P 2 is flse sttement ecuse P 1 is true while P 2 is flse. P 1 1 = 2 is flse for the sme reson. P 2 1 = 2 is true ecuse oth sides of the equivlence opertor re flse. x is even x+1 is odd is true. 2.2.6 The P Versus NP Prolem Consider the following prolem. Someody gives you propositionl formul. Your gol is to set ech vrile in tht formul to either true or flse in wy tht mkes the entire formul true. This is known s the stisfiility prolem nd is equivlent to mny prolems in computer science nd engineering. One lgorithm for stisfiility is exhustive serch. We try ll possile settings to the vriles, ut this is n lgorithm whose running time is exponentil in the numer of vriles. To see tht, 7

2.3. Next Time consider formul tht hs k vriles. Ech vrile hs two possile vlues, nd ech vrile cn e ssigned vlue independently, so we hve to multiply together the numers of possile ssignmentsforechvriletogettotlof2 k possilessignmentsoftruthvluestothevriles. We would like to know whether there is fster lgorithm for deciding stisfiility, preferly one tht runs in time tht is polynomil in the numer of vriles. This is known s the P versus NP prolem. We do not know whether stisfiility lgorithm tht is sustntilly fster thn exhustive serch exists. On the other hnd, we re lso unle to disprove the existence of such n lgorithm, which is wht mkes the P versus NP prolem one of the most importnt open prolems in computer science nd mthemtics. 2.3 Next Time Next time we will generlize propositions nd tlk out predictes. 8