CS 173: Discrete Mathematical Structures Cinda Heeren Rm 2213 Siebel Center Office Hours: M 12:30-2:30p.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

Prof. Johnnie Baker Module Basic Structures: Sets
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
Analytical Methods in CS (CIS 505)
Discrete Structures CS 2800
Sets 1.
1 Discrete Structures CS 2800 Prof. Bart Selman Module Logic (part proof methods)
CSE115/ENGR160 Discrete Mathematics 02/10/11 Ming-Hsuan Yang UC Merced 1.
Sets 1.
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
Discrete Structures CS 23022
Mathematical Induction
Sets.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Methods of Proof & Proof Strategies
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
Introduction to Proofs
MATH 224 – Discrete Mathematics
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
CSci 2011 Discrete Mathematics Lecture 6
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Introduction to Abstract Mathematics Chapter 3: Elementary Number Theory and Methods of Proofs Instructor: Hayk Melikya Direct.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 5 Existence and Proof by contradiction
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
January 30, 2002Applied Discrete Mathematics Week 1: Logic and Sets 1 Let’s Talk About Logic Logic is a system based on propositions.Logic is a system.
CompSci 102 Discrete Math for Computer Science
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
Sets Goal: Introduce the basic terminology of set theory.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Lecture 2.1: Sets and Set Operations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Chapter 2 With Question/Answer Animations. Section 2.1.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Lecture 1.4: Rules of Inference, and Proof Techniques* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
CS 285- Discrete Mathematics
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Introduction to Proofs
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Section 2.1. Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the.
Lecture 1.5: Proof Techniques CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren 1.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
The Foundations: Logic and Proofs
Discrete Mathematical The Set Theory
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
The Foundations: Logic and Proofs
Applied Discrete Mathematics Week 2: Proofs
Discrete Mathematics CS 2610
Lecture 2.1: Sets and Set Operations*
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Presentation transcript:

CS 173: Discrete Mathematical Structures Cinda Heeren Rm 2213 Siebel Center Office Hours: M 12:30-2:30p

Cs173 - Spring 2004 CS 173 Announcements Homework 1 returned this week. Homework 2 available. Due 09/09. WCS announcements… Let’s try the clickers… a)I have registered for section. b)I have not registered for section. a)I have posted to newsgroup. b)I have not posted to newsgroup. a)I don’t know how. b)I’m lazy. a)I don’t know how. b)I’m lazy.

Cs173 - Spring 2004 CS 173 Proof Techniques - direct proofs Here’s what you know: Ellen is a math major or a CS major. If Ellen does not like discrete math, she is not a CS major. If Ellen likes discrete math, she is smart. Ellen is not a math major. Can you conclude Ellen is smart? M  C  D   C D  S  M ((M  C)  (  D   C)  (D  S)  (  M))  S ?

Cs173 - Spring 2004 CS 173 Proof Techniques - direct proofs In general, to prove p  q, assume p and show that q follows. ((M  C)  (  D   C)  (D  S)  (  M))  S ?

Cs173 - Spring 2004 CS 173 Proof Techniques - direct proofs 1. M  CGiven 2.  D   CGiven 3. D  SGiven 4.  MGiven 5. CDS (1,4) 6. DMT (2,5) 7. SMP (3,6) Ellen is smart!

Cs173 - Spring 2004 CS 173 Proof Techniques - vacuous proofs In general, to prove p  q, assume p and show that q follows. But p  q is also TRUE if p is FALSE. Suggests proving p  q by proving  p. Ex. p: There is good Chinese food in CU. q: I’ll give you each $10. Since p is FALSE, p  q is TRUE (but we don’t know a thing about q)

Cs173 - Spring 2004 CS 173 Proof Techniques - trivial proofs In general, to prove p  q, assume p and show that q follows. But p  q is also TRUE if q is TRUE. Suggests proving p  q by proving q. Ex. p: there is good Chinese food in CU q: I’m drinking coffee Since q is TRUE, p  q is TRUE (the truth or falsity of p is irrelevant)

Cs173 - Spring 2004 CS 173 Proof Techniques - indirect proofs Recall that p  q   q   p (the contrapositive) So, we can prove the implication p  q by first assuming  q, and showing that  p follows. Example: Prove that if a and b are integers, and a + b ≥ 15, then a ≥ 8 or b ≥ 8. (a + b ≥ 15)  (a ≥ 8) v (b ≥ 8) (Assume  q) Suppose (a < 8)  (b < 8). (Show  p)Then (a ≤ 7)  (b ≤ 7), and (a + b) ≤ 14, and (a + b) < 15.

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by contradiction To prove a proposition p, assume not p and show a contradiction. Suppose the proposition is of the form p  q, and recall that p  q  q v  p   (  q  p). So assuming the opposite is to assume  q  p.

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by contradiction Example: Rainy days make gardens grow. Gardens don’t grow if it is not hot. When it is cold outside, it rains. Prove that it’s hot. Given:R  G  H   G  H  R Show: H (( R  G )  (  H   G )  (  H  R ))  H ?

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by contradiction Given:R  G  H   G  H  R Show: H 1. R  GGiven 2.  H   GGiven 3.  H  R Given 4.  H assume to the contrary 5. R MP (3,4) 6. G MP (1,5) 7.  G MP (2,4) 8. G   G contradiction HH

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by contradiction Classic proof that  2 is irrational. Suppose  2 is rational. Then  2 = a/b for some integers a and b (relatively prime).  2 = a/b implies 2 = a 2 /b 2 2b 2 = a 2 a 2 is even, and so a is even (a = 2k for some k) b 2 = 2k 2 2b 2 = (2k) 2 = 4k 2 b 2 is even, and so b is even (b = 2k for some k) But if a and b are both even, then they are not relatively prime!

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by contradiction You’re going to let me get away with that? a 2 is even, and so a is even (a = 2k for some k)?? So a really is even. contradiction Suppose to the contrary that a is not even. Then a = 2k + 1 for some integer k Then a 2 = (2k + 1)(2k + 1) = 4k2 + 4k + 1 and a 2 is odd.

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by cases Suppose we want to prove a theorem of the form: p 1 v p 2 v … v p n  q We can prove it in pieces corresponding to the cases, but which must be true? A: (p 1  q) v (p 2  q) v … v (p n  q)B: (p 1  q)  (p 2  q)  …  (p n  q)

Cs173 - Spring 2004 CS 173 Proof Techniques - proof by cases Proof for n=2: (p 1  q)  (p 2  q)  …  (p n  q) (p 1 v p 2 )  q   (p 1 v p 2 ) v q Defn of   (  p 1   p 2 ) v q DeMorgan’s  (  p 1 v q)  (  p 2 v q) Distributivity  (p 1  q)  (p 2  q) Defn of 

Cs173 - Spring 2004 CS 173 Proofs - something for everyone… “if x is a perfect square, and x is even, then x is divisible by 4.” Formally: (p  q)  r Contrapositive:  r   (p  q) Suppose x is not divisible by 4. Then x = 4k + 1, or x = 4k + 2, or x = 4k + 3.   r  (  p v  q) Now structure looks like (u 1 v u 2 v u 3 )  (  p v  q) Case 1 (&3): x = 4k + 1, odd, corresponds to  q Case 2: x = 4k + 2, even, so must not be a perfect square.

Cs173 - Spring 2004 CS 173 Proofs - something for everyone… “if x is a perfect square, and x is even, then x is divisible by 4.” Subgoal, prove Case 2: Case 2: x = 4k + 2, even (so we have to show not square). But x = 4k + 2 = 2(2k + 1) x is the product of 2 and an odd number. So, x is not a perfect square.

Cs173 - Spring 2004 CS 173 Proofs - something for everyone… If Boris becomes a pastry chef, then if he gives in to his desire for chocolate mousse, then his waistline will suffer. If his waistline suffers, then his dancing will suffer. Boris gives in to his desire for chocolate mousse. However, his dancing will not suffer. Prove that Boris does not become a pastry chef. a)I could have done this on my own. b)I worked it out with my partner, but I couldn’t have done it alone. c)My partner and I couldn’t do it.

Cs173 - Spring 2004 CS 173 Proof Techniques- Quantifiers: Existence Proofs Two ways of proving  x P(x). Either build one, or show one can be built. Two examples, both involving n! For the examples, think of n! as a list of factors. Constructive Non-constructive

Cs173 - Spring 2004 CS 173 Proof Techniques- Quantifiers: Existence Proofs Example: Prove that for all integers n, there exist n consecutive composite integers.  n (integer),  x so that x, x+1, x+2, …, x+n-1 are all composite. Proof: Let n be an arbitrary integer. x = (n + 1)! + 2 Composite = not prime (n + 1)! + 2 is divisible by 2,  composite. (n + 1)! + 3 is divisible by 3,  composite. … (n + 1)! + (n + 1) is divisible by n + 1,  composite. CONSTRUCTIVE

Cs173 - Spring 2004 CS 173 Proof Techniques- Quantifiers: Existence Proofs Example: Prove that for all integers n, there exists a prime p so that p > n.  n (integer),  p so that p is prime, and p > n. Proof: Let n be an arbitrary integer, and consider n! + 1. If (n! + 1) is prime, we are done since (n! + 1) > n. But what if (n! + 1) is composite? If (n! + 1) is composite then it has a prime factorization, p 1 p 2 …p n = (n! + 1) Consider the smallest p i, how small can it be? Infinitely many primes!

Cs173 - Spring 2004 CS 173 Proof Techniques- Quantifiers: Existence Proofs  n (integers),  p so that p is prime, and p > n. Proof: Let n be an arbitrary integer, and consider n! + 1. If (n! + 1) is prime, we are done since (n! + 1) > n. But what if (n! + 1) is composite? If (n! + 1) is composite then it has a prime factorization, p 1 p 2 …p n = (n! + 1) NON-CONSTRUCTIVE Consider the smallest p i, and call it p. How small can it be? Can it be 2?Can it be 3?Can it be 4?Can it be n? So, p > n, and we are done. BUT WE DON’T KNOW WHAT p IS!!!

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing “1” and “2” and “3.” {1, 1, 2, 3, 3} = {1, 2, 3} since repetition is irrelevant. {1, 2, 3} = {3, 2, 1} since sets are unordered. {1, 2, 3, …} is a way we denote an infinite set (in this case, the natural numbers).  = {} is the empty set, or the set containing no elements. Note:   {  }

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation x  S means “x is an element of set S.” x  S means “x is not an element of set S.” A  B means “A is a subset of B.” Venn Diagram or, “B contains A.” or, “every element of A is also in B.” or,  x ((x  A)  (x  B)). A B

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation A  B means “A is a subset of B.” A  B means “A is a superset of B.” A = B if and only if A and B have exactly the same elements. iff, A  B and B  A iff, A  B and A  B iff,  x ((x  A)  (x  B)). So to show equality of sets A and B, show: A  B B  A

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation A  B means “A is a proper subset of B.” A  B, and A  B.  x ((x  A)  (x  B))   x ((x  B)  (x  A))  x ((x  A)  (x  B))   x  (  (x  B) v (x  A))  x ((x  A)  (x  B))   x ((x  B)   (x  A))  x ((x  A)  (x  B))   x ((x  B)  (x  A)) A B

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation Quick examples: {1,2,3}  {1,2,3,4,5} {1,2,3}  {1,2,3,4,5} Is   {1,2,3}? Yes!  x (x   )  (x  {1,2,3}) holds, because (x   ) is false. Is   {1,2,3}?No! Is   { ,1,2,3}?Yes! Is   { ,1,2,3}?Yes! Vacuously

Cs173 - Spring 2004 CS 173 Set Theory - Definitions and notation Quiz time: Is {x}  {x}? Is {x}  {x,{x}}? Is {x}  {x,{x}}? Is {x}  {x}? Yes No

Cs173 - Spring 2004 CS 173 Set Theory - Ways to define sets Explicitly: {John, Paul, George, Ringo} Implicitly: {1,2,3,…}, or {2,3,5,7,11,13,17,…} Set builder: { x : x is prime }, { x | x is odd }. In general { x : P(x) is true }, where P(x) is some description of the set. Ex. Let D(x,y) denote “x is divisible by y.” Give another name for { x :  y ((y > 1)  (y < x))   D(x,y) }. Can we use any predicate P to define a set S = { x : P(x) }? : and | are read “such that” or “where” Primes

Cs173 - Spring 2004 CS 173 Set Theory - Russell’s Paradox Can we use any predicate P to define a set S = { x : P(x) }? Define S = { x : x is a set where x  x } Then, if S  S, then by defn of S, S  S. So S must not be in S, right? ARRRGH! But, if S  S, then by defn of S, S  S. No! There is a town with a barber who shaves all the people (and only the people) who don’t shave themselves. Who shaves the barber?

Cs173 - Spring 2004 CS 173 Set Theory - Cardinality If S is finite, then the cardinality of S, |S|, is the number of distinct elements in S. If S = {1,2,3}, |S| = 3. If S = {3,3,3,3,3}, If S = , If S = { , {  }, { ,{  }} }, |S| = 1.|S| = 0. |S| = 3. If S = {0,1,2,3,…}, |S| is infinite. (more on this later)

Cs173 - Spring 2004 CS 173 Set Theory - Power sets If S is a set, then the power set of S is 2 S = { x : x  S }. If S = {a}, aka P(S) If S = {a,b}, If S = , If S = { ,{  }}, We say, “P(S) is the set of all subsets of S.” 2 S = { , {a}}.2 S = { , {a}, {b}, {a,b}}.2 S = {  }.2 S = { , {  }, {{  }}, { ,{  }}}. Fact: if S is finite, |2 S | = 2 |S|. (if |S| = n, |2 S | = 2 n )