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

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

Discrete Mathematics Set Operations

ICS141: Discrete Mathematics for Computer Science I

Discrete Basic Structure: Sets

With Question/Answer Animations. Chapter 2

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

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

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

Sec$on Summary. Definition of sets Describing Sets

A set is an unordered collection of objects.

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

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

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

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

CHAPTER 1. Preliminaries. 1 Set Theory

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

Discrete Mathematical Structures: Theory and Applications

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Background for Discrete Mathematics

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

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

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

Automata and Languages

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

Sets McGraw-Hill Education

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

BASIC MATHEMATICAL TECHNIQUES

LIN1032 Formal Foundations for Linguistics

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

Automata Theory and Formal Grammars: Lecture 1

Sets, Logic, Relations, and Functions

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

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

CSCE 222 Discrete Structures for Computing

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

Mathematics Review for Business PhD Students Lecture Notes

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Propositional Logic, Predicates, and Equivalence

Logic, Sets, and Proofs

Intro to Logic and Proofs

Digital Logic Design: a rigorous approach c

Topics in Logic and Proofs

Predicate Logic: Sematics Part 1

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

A B is shaded A B A B

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

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

CS 2336 Discrete Mathematics

Chapter 1. Logic and Proof

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Chapter 2 - Basics Structures

Exclusive Disjunction

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

CISC 1100: Structures of Computer Science

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

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

COMP Logic for Computer Scientists. Lecture 16

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

MTH202 Discrete Mathematics

2.3 Exercises. (a) F P(A). (Solution)

Mathematical Preliminaries. Sipser pages 1-28

2.23 Theorem. Let A and B be sets in a metric space. If A B, then L(A) L(B).

If f = ABC + ABC + A B C then f = AB C + A BC + AB C + A BC + A B C

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

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

Introduction to Set Operations

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

Equivalence and Implication

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

CSE 20 DISCRETE MATH WINTER

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

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

Mathematics Review for Business PhD Students

CSE 20. Final Review. CSE 20: Final Review

Analysis I. Classroom Notes. H.-D. Alber

CS Discrete Mathematics Dr. D. Manivannan (Mani)

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

In English, there are at least three different types of entities: letters, words, sentences.

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

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.

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}.

Fundamentals of Probability CE 311S

1.1 Introduction to Sets

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Review 1. Andreas Klappenecker

Equivalence of Propositions

Informal Statement Calculus

CHAPTER 1 SETS AND EVENTS

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH SPRING

1 Predicates and Quantifiers

Discrete Mathematics for M.Sc.CS

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Set Theory. CPT Section D Quantitative Aptitude Chapter 7 Brijeshwar Prasad Gupta

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

Chapter 2 Sets, Relations and Functions

Axioms of Probability

Chapter 1. Sets and Numbers

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

CSE 20 DISCRETE MATH. Winter

Transcription:

Today s topics Introduction to Set Theory ( 1.6) Sets Definitions Operations Proving Set Identities Reading: Sections 1.6-1.7 Upcoming Functions A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different) objects. Set theory deals with operations between, relations among, and statements about sets. Sets are ubiquitous in computer software systems. All of mathematics can be defined in terms of some form of set theory (using predicate logic). 5.1 5.2 Naïve set theory Basic notations for sets Basic premise: Any collection or class of objects (elements)) that we can describe (by any means whatsoever) constitutes a set. But, the resulting theory turns out to be logically inconsistent! This means, there exist naïve set theory propositions p such that you can prove that both p and p follow logically from the axioms of the theory!! The conjunction of the axioms is a contradiction! This theory is fundamentally uninteresting, because any possible statement in it can be (very trivially) proved by contradiction! More sophisticated set theories fix this problem. For sets, we ll use variables S, T, U, We can denote a set S in writing by listing all of its elements in curly braces: {a, b, c} is the set of whatever 3 objects are denoted by a, b, c. Set builder notation: : For any proposition P(x) ) over any universe of discourse, {x P(x)} is the set of all x such that P(x). 5.3 5.4

Basic properties of sets Definition of Set Equality Sets are inherently unordered: No matter what objects a, b, and c denote, {a, b, c} = {a, c, b} = {b, a, c} = {b, c, a} = {c, a, b} = {c, b, a}. All elements are distinct (unequal); multiple listings make no difference! If a=b, then {a, b, c} = {a, c} = {b, c} = {a, a, b, a, b, c, c, c, c}. This set contains (at most) 2 elements! Two sets are declared to be equal if and only if they contain exactly the same elements. In particular, it does not matter how the set is defined or denoted. For example: The set {1, 2, 3, 4} = {x x is an integer where x>0 and x<5 } = {x x is a positive integer whose square is >0 and <25} 5.5 5.6 Infinite Sets Venn Diagrams Conceptually, sets may be infinite (i.e., not finite, without end, unending). Symbols for some special infinite sets: N = {0, 1, 2, }} The Natural numbers. Z = {,{, -2, -1, 0, 1, 2, }} The Zntegers. R = The Real numbers, such as 374.1828471929498181917281943125 Blackboard Bold or double-struck font (!,",#)( is also often used for these special number sets. Infinite sets come in different sizes! John Venn 1834-1923 5.7 5.8

Basic Set Relations: Member of The Empty Set x"s ( x is in S ) is the proposition that object x is an!lement or member of set S. e.g. 3"N, a "{x x is a letter of the alphabet} Can define set equality in terms of " relation: #S,T: S=T $ (#x: x"s $ x"t) Two sets are equal iff they have all the same members. x%s :& (x"s) x is not in S * ( null, the empty set ) ) is the unique set that contains no elements whatsoever. * = {} = {x { x False} No matter the domain of discourse, we have the axiom -x: x"* "*. 5.9 5.10 Subset and Superset Relations Proper (Strict) Subsets & Supersets S'T ( S is a subset of T ) ) means that every element of S is also an element of T. S'T ( #x (x"s ) x"t) *'S, S'S. S. S+T ( S is a superset of T ) ) means T'S. Note S=T ( S'T, S+T. S /! T means (S'T), i.e. -x(x"s, x%t) S.T ( S is a proper subset of T ) ) means that S'T but T /! S. Similar for S/T. S T Venn Diagram equivalent of S.T Example: {1,2}. {1,2,3} 5.11 5.12

Sets Are Objects, Too! Cardinality and Finiteness The objects that are elements of a set may themselves be sets. E.g. let S={ ={x x ' {1,2,3}} then S={ ={*, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} Note that 1 1 {1} 1 {{1}}!!!! S (read the cardinality of S ) ) is a measure of how many different elements S has. E.g.,, * =0, =0, {1,2,3} = 3, {a,b} = 2, {{1,2,3},{4,5}} = If S "N,, then we say S is finite. Otherwise, we say S is infinite. What are some infinite sets we ve seen? 5.13 5.14 The Power Set Operation Review: Set Notations So Far The power set P(S) ) of a set S is the set of all subsets of S. P(S) ) :!: {x x's}. E.g. P({a,b}) = {*,{, {a}, {b}, {a,b}}. Sometimes P(S) ) is written 2 S. Note that for finite S, P(S) = 2 S. It turns out #S: P(S) > S, e.g. P(N) > N. There are different sizes of infinite sets! Variable objects x, y, z; ; sets S, T, U. Literal set {a, b, c} and set-builder {x P(x)}.{ " relational operator, and the empty set *. Set relations =, ', +,., /, 0,, etc. Venn diagrams. Cardinality S and infinite sets N, Z, R. Power sets P(S). 5.15 5.16

Naïve Set Theory is Inconsistent Ordered n-tuples There are some naïve set descriptions that lead to pathological structures that are not well-defined. (That do not have self-consistent properties.) These sets mathematically cannot exist. E.g. let S = {x{ x%x }. Is S"S? Therefore, consistent set theories must restrict the language that can be used to describe sets. For purposes of this class, don t t worry about it! Bertrand Russell 1872-1970 5.17 These are like sets, except that duplicates matter, and the order makes a difference. For n"n,, an a ordered n-tuple or a sequence or list of length n is written (a( 1, a 2,, a n ). Its first element is a 1, etc. Note that (1, 2) 1 (2, 1) 1 (2, 1, 1). Empty sequence, singlets,, pairs, triples, quadruples, quintuples tuples,, n-tuples. Contrast with sets {} 5.18 Cartesian Products of Sets Review of 1.6 For sets A, B,, their Cartesian product A2B :& {(a, b) ) a"a, b"b }. E.g. {a,b}2{1,2} {1,2} = {(a,1),(a,2),(b,1),(b,2)} Note that for finite A, B, A2B = = A B. Note that the Cartesian product is not commutative: i.e., #AB AB: A2B=B2A. Extends to A 1 2 A 2 2 2 A n... Sets S, T, U Special sets N, Z, R. Set notations {a,b,...}, {x P(x)}{ )} Set relation operators x"s, S'T, S+T, S=T, S.T, S/T.. (These form propositions.) Finite vs. infinite sets. Set operations S,, P(S), S2T. Next up: 1.5: More set ops: 3, 4, 5. René Descartes (1596-1650) 5.19 5.20

Start 1.7: The Union Operator Union Examples For sets A, B, their"nion A3B is the set containing all elements that are either in A, or ( 6 ) in B (or, of course, in both). Formally, #A,B: A3B = {x x"a 6 x"b}. Note that A3B is a superset of both A and B (in fact, it is the smallest such superset): #A, B: (A3B + A), (A3B + B) {a,b,c}3{2,3} {2,3} = {a,b,c,2,3} {2,3,5}3{3,5,7} {3,5,7} = {2,3,5{ 2,3,5,3,5,7} } ={2,3,5,7} = Think The United States of America includes every person who worked in any U.S. state last year. (This is how the IRS sees it...) 5.21 5.22 The Intersection Operator Intersection Examples For sets A, B,, their intersection A4B is the set containing all elements that are simultaneously in A and (, ) in B. Formally, #A,B: A4B={x x"a, x"b}. Note that A4B is a subset of both A and B (in fact it is the largest such subset): #A, B: (A4B ' A), (A4B ' B) {a,b,c}4{2,3} {2,3} = {2,4,6}4{3,4,5} {3,4,5} = Think The intersection of Main St. and 9th St. is just that part of the road surface that lies on both streets. 5.23 5.24

Disjointedness Inclusion-Exclusion Principle Two sets A, B are called disjoint (i.e. i.e., unjoined) iff their intersection is empty. (A4B=*)( Example: the set of even integers is disjoint with the set of odd integers. Help, I ve been disjointed! How many elements are in A3B? A3B = A + B 5 A4B Example: How many students are on our class email list? Consider set E = I 3 M, I = {s{ s turned in an information sheet} M = {s{ s sent the TAs their email address} Some students did both! E = I3M = I + M 5 I4M 5.25 5.26 Set Difference Set Difference Examples For sets A, B,, the difference of A and B, B written A5B,, is the set of all elements that are in A but not B.. Formally: A 5 B :& {x x"a, x%b} = {x (x"a ) x"b) } Also called: The complement of B with respect to A. {1,2,3,4,5,6} 5 {2,3,5,7,9,11} = Z 5 N = {, "1, 0, 1, 2, } 5 {0, 1, } = {x{ x is an integer but not a nat.. #} = {x{ x is a negative integer} = { {, "3, "2, "1} 5.27 5.28

Set Difference - Venn Diagram Set Complements A"B is what s s left after B takes a bite out of A Set A Set B The universe of discourse can itself be considered a set, call it U. When the context clearly defines U,, we say that for any set A'U, the complement of A, written A, is the complement of A w.r.t. U, i.e., it is U5A. E.g., If U=N, { 3,5} = {0,1,2,4,6,7,...} 5.29 5.30 More on Set Complements Set Identities An equivalent definition, when U is clear: U A A = { x x! A} A Identity: A3* = A = A4U Domination: A3U = U, A4* = * Idempotent: A3A = A = A4A Double complement: ( A ) = A Commutative: A3B = B3A, A4B = B4A Associative: A3(B3C)=( )=(A3B)3C, A4(B4C)=( )=(A4B)4C 5.31 5.32

DeMorgan s Law for Sets Proving Set Identities Exactly analogous to (and provable from) DeMorgan s Law for propositions. A! B A" B = A " B = A! B To prove statements about sets, of the form E 1 = E 2 (where the Es s are set expressions), here are three useful techniques: 1. Prove E 1 ' E 2 and E 2 ' E 1 separately. 2. Use a membership table. 3. Use set builder notation & logical equivalences. 5.33 5.34 Method 1: Mutual subsets Method 2: Membership Tables Example: Show A4(B3C)=( )=(A4B)3(A4C).). Part 1: Show A4(B3C)'(A4B)3(A4C). ). Assume x"a4(b3c), & show x"(a4b)3(a4c). ). We know that x"a,, and either x"b or x"c. Case 1: x"b.. Then x"a4b,, so x"(a4b)3(a4c). ). Case 2: x"c. Then x"a4c, so x"(a4b)3(a4c). ). Therefore, x"(a4b)3(a4c). ). Therefore, A4(B3C)'(A4B)3(A4C). ). Part 2: Show (A4B)3(A4C)( ' A4(B3C). Just like truth tables for propositional logic. Columns for different set expressions. Rows for all combinations of memberships in constituent sets. Use 1 to indicate membership in the derived set, 0 for non-membership. Prove equivalence with identical columns. 5.35 5.36

Membership Table Example Membership Table Exercise Prove (A3B)5B( = A5B. A B A! B (A! B) " B A " B 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 Prove (A3B)5C( = (A5C)3(B5C).( ). A B C A! B (A! B) " C A " C B " C (A " C)! (B " C) 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 5.37 5.38 Review of 1.6-1.7 Generalized Unions & Intersections Sets S, T, U Special sets N, Z, R. Set notations {a,b,...}, {x P(x)}{ )} Relations x"s, S'T, S+T, S=T, S.T, S/T. Operations S,, P(S), 2, 3, 4, 5, S Set equality proof techniques: Mutual subsets. Derivation using logical equivalences. Since union & intersection are commutative and associative, we can extend them from operating on ordered pairs of sets (A,B)( ) to operating on sequences of sets (A( 1,,A n ), or even on unordered sets of sets, X={ ={A A P(A)}. P 5.39 5.40

Generalized Union Generalized Intersection Binary union operator: A3B n-ary union: A3A 2 3 3A n :& (( (( ((A 1 3 A 2 ) 3 )3 A n) (grouping & order is irrelevant) Big U U notation: U n A i i=1 Or for infinite sets of sets: U A! X A Binary intersection operator: A4B n-ary intersection: A 1 4A 2 4 4A n &(( ((A 1 4A 2 )4 )4A n ) (grouping & order is irrelevant) Big Arch notation: I n A i i=1 Or for infinite sets of sets: I A! X A 5.41 5.42 Representations Representing Sets with Bit Strings A frequent theme of this course will be methods of representing one discrete structure using another discrete structure of a different type. E.g.,, one can represent natural numbers as Sets: 0:&* &*, 1:&{0}, 2:&{0,1}, 3:&{0,1,2}, Bit strings: 0:&0, 1:&1, 2:&10, 3:&11, 4:&100, For an enumerable u.d. U with ordering x 1, x 2,,, represent a finite set S'U as the finite bit string B=b 1 b 2 b n where #i: x i "S $ (i<n, b i =1). E.g. U=N, S={2,3,5,7,11}, B=001101010001. In this representation, the set operators 3, 4, 7 7 are implemented directly by bitwise OR, AND, NOT! 5.43 5.44