12/19/20151 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are very closely related.

Slides:



Advertisements
Similar presentations
Set Operations. When sets are equal A equals B iff for all x, x is in A iff x is in B or … and this is what we do to prove sets equal.
Advertisements

Fall 2002CMSC Discrete Structures1 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are.
Discrete Mathematics I Lectures Chapter 6
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.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
2.1 Sets. DEFINITION 1 A set is an unordered collection of objects. DEFINITION 2 The objects in a set are called the elements, or members, of the set.
Denoting the beginning
Analytical Methods in CS (CIS 505)
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
1 Learning Objectives for Section 7.2 Sets After today’s lesson, you should be able to Identify and use set properties and set notation. Perform set operations.
Intro to Set Theory. Sets and Their Elements A set A is a collection of elements. If x is an element of A, we write x  A; if not: x  A. Say: “x is a.
February 5, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Homework Solution PQ  (P  Q) (  P)  (  Q)  (P  Q)  (  P)  (  Q) truetruefalsefalsetrue.
This section will discuss the symbolism and concepts of set theory
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Mathematical Proofs. Chapter 1 Sets 1.1 Describing a Set 1.2 Subsets 1.3 Set Operations 1.4 Indexed Collections of Sets 1.5 Partitions of Sets.
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.
1. Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element of A” A = {a 1, a 2,
CompSci 102 Discrete Math for Computer Science
Chapter 2 Section 1 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Fall 2003CMSC Discrete Structures1 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are.
ELEMENTARY SET THEORY.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Chapter 2 With Question/Answer Animations. Section 2.1.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Introduction to Set theory. Ways of Describing Sets.
(CSC 102) Lecture 13 Discrete Structures. Previous Lectures Summary  Direct Proof  Indirect Proof  Proof by Contradiction  Proof by Contra positive.
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.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Wed, Mar 8, 2006.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Mon, Feb 21, 2005.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
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.
Thinking Mathematically Venn Diagrams and Set Operations.
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.
Ch02-Basic Structures: Sets, Functions, Sequences, Sums, and Matrices 1.
Applied Discrete Mathematics Week 1: Logic and Sets
Sets Finite 7-1.
Discrete Mathematical The Set Theory
Sets Section 2.1.
Chapter 1 Logic and Proofs Homework 2 Given the statement “A valid password is necessary for you to log on to the campus server.” Express the statement.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CSE 2353 – September 22nd 2003 Sets.
… and now for something completely different…
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Algebra 1 Section 1.1.
Applied Discrete Mathematics Week 2: Proofs
Discrete Mathematics CS 2610
Chapter 7 Logic, Sets, and Counting
… and now for something completely different…
Which sets are equal? Which sets are equivalent?
Lecture Sets 2.2 Set Operations.
Sets, Unions, Intersections, and Complements
Presentation transcript:

12/19/20151 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are very closely related.

12/19/20152 Set Theory Set: Collection of objects (“elements”)Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A”a  A “a is an element of A” “a is a member of A” a  A “a is not an element of A”a  A “a is not an element of A” A = {a 1, a 2, …, a n } “A contains…”A = {a 1, a 2, …, a n } “A contains…” Order of elements is meaninglessOrder of elements is meaningless It does not matter how often the same element is listed.It does not matter how often the same element is listed.

12/19/20153 Set Equality Sets A and B are equal if and only if they contain exactly the same elements. Examples: A = {9, 2, 7, -3}, B = {7, 9, -3, 2} : A = {9, 2, 7, -3}, B = {7, 9, -3, 2} : A = B A = {dog, cat, horse}, B = {cat, horse, squirrel, dog} : A = {dog, cat, horse}, B = {cat, horse, squirrel, dog} : A  B A = {dog, cat, horse}, B = {cat, horse, dog, dog} : A = {dog, cat, horse}, B = {cat, horse, dog, dog} : A = B

12/19/20154 Examples for Sets “Standard” Sets: Natural numbers N = {0, 1, 2, 3, …}Natural numbers N = {0, 1, 2, 3, …} Integers Z = {…, -2, -1, 0, 1, 2, …}Integers Z = {…, -2, -1, 0, 1, 2, …} Positive Integers Z + = {1, 2, 3, 4, …}Positive Integers Z + = {1, 2, 3, 4, …} Real Numbers R = {47.3, -12, , …}Real Numbers R = {47.3, -12, , …} Rational Numbers Q = {1.5, 2.6, -3.8, 15, …} (correct definition will follow)Rational Numbers Q = {1.5, 2.6, -3.8, 15, …} (correct definition will follow)

12/19/20155 Examples for Sets A =  “empty set/null set”A =  “empty set/null set” A = {z} Note: z  A, but z  {z}A = {z} Note: z  A, but z  {z} A = {{b, c}, {c, x, d}}A = {{b, c}, {c, x, d}} A = {{x, y}} Note: {x, y}  A, but {x, y}  {{x, y}}A = {{x, y}} Note: {x, y}  A, but {x, y}  {{x, y}} A = {x | P(x)} “set of all x such that P(x)”A = {x | P(x)} “set of all x such that P(x)” A = {x | x  N  x > 7} = {8, 9, 10, …} “set builder notation”A = {x | x  N  x > 7} = {8, 9, 10, …} “set builder notation”

12/19/20156 Examples for Sets We are now able to define the set of rational numbers Q: Q = {a/b | a  Z  b  Z + } or Q = {a/b | a  Z  b  Z  b  0} And how about the set of real numbers R? R = {r | r is a real number} That is the best we can do.

12/19/20157 Subsets A  B “A is a subset of B” A  B if and only if every element of A is also an element of B. We can completely formalize this: A  B   x (x  A  x  B) Examples: A = {3, 9}, B = {5, 9, 1, 3}, A  B ? true A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A  B ? false true A = {1, 2, 3}, B = {2, 3, 4}, A  B ?

12/19/20158 Subsets Useful rules: A = B  (A  B)  (B  A)A = B  (A  B)  (B  A) (A  B)  (B  C)  A  C (see Venn Diagram)(A  B)  (B  C)  A  C (see Venn Diagram) U A B C

12/19/20159 Subsets Useful rules:   A for any set A   A for any set A A  A for any set AA  A for any set A Proper subsets: A  B “A is a proper subset of B” A  B   x (x  A  x  B)   x (x  B  x  A) or A  B   x (x  A  x  B)   x (x  B  x  A)

12/19/ Cardinality of Sets If a set S contains n distinct elements, n  N, we call S a finite set with cardinality n. Examples: A = {Mercedes, BMW, Porsche}, |A| = 3 B = {1, {2, 3}, {4, 5}, 6} |B| = 4 C =  |C| = 0 D = { x  N | x  7000 } |D| = 7001 E = { x  N | x  7000 } E is infinite!

12/19/ The Power Set P(A) “power set of A” P(A) = {B | B  A} (contains all subsets of A) Examples: A = {x, y, z} P(A) = { , {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}} A =  P(A) = {  } Note: |A| = 0, |P(A)| = 1

12/19/ The Power Set Cardinality of power sets: | P(A) | = 2 |A| Imagine each element in A has an “on/off” switchImagine each element in A has an “on/off” switch Each possible switch configuration in A corresponds to one element in 2 AEach possible switch configuration in A corresponds to one element in 2 A zzzzzzzzz yyyyyyyyy xxxxxxxxx A For 3 elements in A, there are 2  2  2 = 8 elements in P(A)For 3 elements in A, there are 2  2  2 = 8 elements in P(A)

12/19/ Cartesian Product The ordered n-tuple (a 1, a 2, a 3, …, a n ) is an ordered collection of objects. Two ordered n-tuples (a 1, a 2, a 3, …, a n ) and (b 1, b 2, b 3, …, b n ) are equal if and only if they contain exactly the same elements in the same order, i.e. a i = b i for 1  i  n. The Cartesian product of two sets is defined as: A  B = {(a, b) | a  A  b  B} Example: A = {x, y}, B = {a, b, c} A  B = {(x, a), (x, b), (x, c), (y, a), (y, b), (y, c)}

12/19/ Cartesian Product The Cartesian product of two sets is defined as: A  B = {(a, b) | a  A  b  B} Example: A = {good, bad}, B = {student, prof} A  B = { (good, student), (good, prof), (bad, student), (bad, prof) } (student, good), (prof, good), (student, bad), (prof, bad) } B  A = {

12/19/ Cartesian Product Note that: A  =  A  =   A =   A =  For non-empty sets A and B: A  B  A  B  B  A For non-empty sets A and B: A  B  A  B  B  A |A  B| = |A|  |B| |A  B| = |A|  |B| The Cartesian product of two or more sets is defined as: A 1  A 2  …  A n = {(a 1, a 2, …, a n ) | a i  A i for 1  i  n}

12/19/ Set Operations Union: A  B = {x | x  A  x  B} Example: A = {a, b}, B = {b, c, d} A  B = {a, b, c, d} A  B = {a, b, c, d} Intersection: A  B = {x | x  A  x  B} Example: A = {a, b}, B = {b, c, d} A  B = {b} A  B = {b}

12/19/ Set Operations Two sets are called disjoint if their intersection is empty, that is, they share no elements: A  B =  The difference between two sets A and B contains exactly those elements of A that are not in B: A-B = {x | x  A  x  B} Example: A = {a, b}, B = {b, c, d}, A-B = {a}

12/19/ Set Operations The complement of a set A contains exactly those elements under consideration that are not in A: A c = U-A Example: U = N, B = {250, 251, 252, …} B c = {0, 1, 2, …, 248, 249} B c = {0, 1, 2, …, 248, 249}

12/19/ Set Operations Table 1 in Section 1.5 shows many useful equations. How can we prove A  (B  C) = (A  B)  (A  C)? Method I: x  A  (B  C) x  A  (B  C)  x  A  x  (B  C)  x  A  (x  B  x  C)  (x  A  x  B)  (x  A  x  C) (distributive law for logical expressions)  x  (A  B)  x  (A  C)  x  (A  B)  (A  C)

12/19/ Set Operations Method II: Membership table 1 means “x is an element of this set” 0 means “x is not an element of this set” (A  B)  (A  C) ACACACAC ABABABAB A  (B  C) BCBCBCBC A B C

12/19/ Set Operations Every logical expression can be transformed into an equivalent expression in set theory and vice versa.