CS 173: Discrete Structures. Eric Shaffer Office Hour: Wed. 1-2, 2215 SC

Similar documents
With Question/Answer Animations. Chapter 2

CS 2336 Discrete Mathematics

Sec$on Summary. Definition of sets Describing Sets

Today s topics. Introduction to Set Theory ( 1.6) Naïve set theory. Basic notations for sets

A set is an unordered collection of objects.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman

ICS141: Discrete Mathematics for Computer Science I

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Sets McGraw-Hill Education

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Discrete Mathematics Set Operations

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Chapter 2 Sets, Relations and Functions

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall Set-builder notation (a more precise way of describing a set)

Mathematics Review for Business PhD Students Lecture Notes

3.4 Set Operations Given a set A, the complement (in the Universal set U) A c is the set of all elements of U that are not in A. So A c = {x x / A}.

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

CM10196 Topic 2: Sets, Predicates, Boolean algebras

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall

1. (B) The union of sets A and B is the set whose elements belong to at least one of A

CSI30. Chapter 2. Basic Structures: Sets, Functions, Sequences, Sums. 2.1 Sets and subsets 2.2 Sets of sets

Background for Discrete Mathematics

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

Mathematics Review for Business PhD Students

Discrete Basic Structure: Sets

COMP Logic for Computer Scientists. Lecture 16

Logic, Sets, and Proofs

Show Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.

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

1 Chapter 1: SETS. 1.1 Describing a set

Automata and Languages

CSCE 222 Discrete Structures for Computing

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

COMP Logic for Computer Scientists. Lecture 16

CSE 20 DISCRETE MATH. Winter

Chapter 4. Basic Set Theory. 4.1 The Language of Set Theory

Introduction to Proofs

Discrete Mathematical Structures: Theory and Applications

Propositional Logic, Predicates, and Equivalence

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

CHAPTER 6. Copyright Cengage Learning. All rights reserved.

Axioms for Set Theory

1.1 Introduction to Sets

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Statistics for Financial Engineering Session 2: Basic Set Theory March 19 th, 2006

Chapter 1 : The language of mathematics.

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3

Review 1. Andreas Klappenecker

Sets, Logic, Relations, and Functions

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Equivalence and Implication

BASIC MATHEMATICAL TECHNIQUES

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

Set Operations. Combining sets into new sets

Study sheet for Final CS1100 by Matt in Wed night class

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

A B is shaded A B A B

Carmen s Core Concepts (Math 135)

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Chapter-2 SETS In Mathematics, Set theory was developed by George Cantor ( ).

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Section 2.2 Set Operations. Propositional calculus and set theory are both instances of an algebraic system called a. Boolean Algebra.

Logic Synthesis and Verification

Spring Based on Partee, ter Meulen, & Wall (1993), Mathematical Methods in Linguistics

Operations on Sets. Gazihan Alankuş (Based on original slides by Brahim Hnich et al.) August 6, 2012

CISC 1100: Structures of Computer Science

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH SPRING

In this initial chapter, you will be introduced to, or more than likely be reminded of, a

Mathematics. Lecture and practice. Norbert Bogya. University of Szeged, Bolyai Institute. Norbert Bogya (Bolyai Institute) Mathematics / 27

1 Predicates and Quantifiers

CSE 20 DISCRETE MATH WINTER

Finite Math Section 6_1 Solutions and Hints

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Chapter 2 - Basics Structures

Topics in Logic and Proofs

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Foundations of algebra

This section will take the very naive point of view that a set is a collection of objects, the collection being regarded as a single object.

CS 340: Discrete Structures for Engineers

Sets. your school. A group of odd natural numbers less than 25.

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

ON1 Big Mock Test 4 October 2013 Answers This test counts 4% of assessment for the course. Time allowed: 10 minutes

Chapter 0. Introduction: Prerequisites and Preliminaries

CA320 - Computability & Complexity

Chapter 2: The Logic of Quantified Statements. January 22, 2010

Digital Logic Design: a rigorous approach c

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

Contradiction MATH Contradiction. Benjamin V.C. Collins, James A. Swenson MATH 2730

CHAPTER 1. Preliminaries. 1 Set Theory

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Transcription:

CS 173: Discrete Structures Eric Shaffer Office Hour: Wed. 1-2, 2215 SC shaffer1@illinois.edu

Agenda Sets (sections 2.1, 2.2) 2

Set Theory Sets you should know: Notation you should know: 3

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: { } 4

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. or, B contains A. or, every element of A is also in B. or, x ((x A) (x B)). A B Venn Diagram 5

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 6

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 7

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}) Vacuously holds, because (x ) is false. Is {1,2,3}? No Is {,1,2,3}?! Yes! Is {,1,2,3}? Yes! 8

Quiz time: Set Theory - Definitions and notation Is {x} {x}? Yes Is {x} {x,{x}}? Is {x} {x,{x}}? Yes Yes Is {x} {x}? No 9

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. : and are read such that or where Ex. Let D(x,y) denote x is divisible by y. Give another name for { x : y ((y > 1) (y < x)) D(x,y) }. Primes Can we use any predicate P to define a set S = { x : P(x) }? 10

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 } No! Then, if S S, then by defn of S, S S. So S must not be in S, right? But, if S S, then by defn of S, S S. ARRRGH! 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? 11

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}, S = 1. If S =, S = 0. If S = {, { }, {,{ }} }, S = 3. If S = {0,1,2,3, }, S is infinite. (more on this later) 12

Set Theory - Power sets If S is a set, then the power set of S is 2 S = { x : x S }. aka P(S) If S = {a}, If S = {a,b}, If S =, 2 S = {, {a}}. We say, P(S) is the set of all subsets of S. If S = {,{ }}, 2 S = {, { }, {{ }}, {,{ }}}. Fact: if S is finite, 2 S = 2 S. (if S = n, 2 S = 2 n ) 13

Set Theory - Cartesian Product The Cartesian Product of two sets A and B is: A x B = { <a,b> : a A b B} If A = {Charlie, Lucy, Linus}, and B = {Brown, VanPelt}, then A x B = {<Charlie, Brown>, <Lucy, Brown>, <Linus, Brown>, <Charlie, VanPelt>, <Lucy, VanPelt>, <Linus, VanPelt>} We ll use these special sets soon! A 1 x A 2 x x A n = {<a 1, a 2,, a n >: a 1 A 1, a 2 A 2,, a n A n } A,B finite AxB =? 14

Set Theory - Cartesian Product The Cartesian Product of two sets A and B is: A x B = { <a,b> : a A b B} A,B finite AxB =? 15

Set Theory - Operators The union of two sets A and B is: A B = { x : x A v x B} If A = {Charlie, Lucy, Linus}, and B = {Lucy, Desi}, then A B = {Charlie, Lucy, Linus, Desi} B A 16

Set Theory - Operators The intersection of two sets A and B is: A B = { x : x A x B} If A = {Charlie, Lucy, Linus}, and B = {Lucy, Desi}, then A B = {Lucy} B A 17

Set Theory - Operators The intersection of two sets A and B is: A B = { x : x A x B} If A = {x : x is a US president}, and B = {x : x is deceased}, then A B = {x : x is a deceased US president} B A 18

Set Theory - Operators The intersection of two sets A and B is: A B = { x : x A x B} If A = {x : x is a US president}, and B = {x : x is in this room}, then A B = {x : x is a US president in this room} = B A Sets whose intersection is empty are called disjoint sets 19

Set Theory - Operators The complement of a set A is: A = { x : x A} If A = {x : x is bored}, then A = {x : x is not bored} U = A = U and U = 20

The set difference, A - B, is: Set Theory - Operators U B A A - B = { x : x A x B } A - B = A B 21

Set Theory - Operators The symmetric difference, A B, is: A B = { x : (x A x B) v (x B x A)} = (A - B) U (B - A) like exclusive or U B A 22

Set Theory - Operators A B = { x : (x A x B) v (x B x A)} = (A - B) U (B - A) Proof : { x : (x A x B) v (x B x A)} = { x : (x A - B) v (x B - A)} = { x : x ((A - B) U (B - A))} = (A - B) U (B - A) 23

Set Theory - Famous Identities Page 124 Mostly like HS algebra. Don t memorize understand them 24

Set Theory - Famous Identities Identity A U = A A U = A Domination Idempotent A U U = U A = A A U A = A A A = A (Lazy) 25

Set Theory - Famous Identities Excluded Middle A U A = U Uniqueness A A = Double complement A = A 26

Set Theory - Famous Identities Commutativity A U B = A B = B U A B A Associativity (A U B) U C = (A B) C = A U (B U C) A (B C) Distributivity A U (B C) = A (B U C) = (A U B) (A U C) (A B) U (A C) 27

Set Theory - Famous Identities DeMorgan s I (A U B) = A B DeMorgan s II (A B) = A U B p q 28

Set Theory - 4 Ways to prove identities Show that A B and that A B. New & important Use a membership table. Like truth tables Use previously proven identities. Like Use logical equivalences to prove equivalent set definitions. Not hard, a little tedious 29

Set Theory - 4 Ways to prove identities Prove that (A U B) = A B using a membership table. 0 : x is not in the specified set 1 : otherwise A B A B A B A U B A U B 1 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 Haven t we seen this before? 30

CS 173 Set Theory - 4 Ways to prove identities Prove that (A U B) = A B using identities. (A U B) = A U B = A B = A B 31

CS 173 Set Theory - 4 Ways to prove identities Prove that (A U B) = A B equivalent set definitions. using logically (A U B) = {x : (x A v x B)} = {x : (x A) (x B)} = {x : (x A) (x B)} = A B 32

Set Theory - 4 Ways to prove identities Prove that (A U B) = A B 1. ( ) (x A U B) 2. ( ) (x A B) 33

Set Theory - A proof for us to do together. X (Y - Z) = (X Y) - (X Z). True or False? Prove your response. (X Y) - (X Z) = (X Y) (X Z) = (X Y) (X U Z ) = (X Y X ) U (X Y Z ) = U (X Y Z ) = (X Y Z ) 34

Set Theory - A proof for us to do together. Pv that if (A - B) U (B - A) = (A U B) then A B = a) A U B = Suppose to the contrary, that A B, and that x A B. b) A = B c) A B = Then x cannot be in A-B and x cannot be in B-A. d) A-B = B-A = DeMorgan s!! Then x is not in (A - B) U (B - A). Do you see the contradiction yet? But x is in A U B since (A B) (A U B). Thus, A B =. Trying to pv p --> q Assume p and not q, and find a contradiction. Our contradiction was that sets weren t equal. 35