CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 14 CS 1813 – Discrete Mathematics A Little Bit of Set Theory.

Slides:



Advertisements
Similar presentations
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
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.
Instructor: Hayk Melikya
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.
The Engineering Design of Systems: Models and Methods
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way.
SET.   A set is a collection of elements.   Sets are usually denoted by capital letters A, B, Ω, etc.   Elements are usually denoted by lower case.
Sets 1.
Sets 1.
Theoretical Computer Science COMP 335 Fall 2004
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
SET Miss.Namthip Meemag Wattanothaipayap School. Definition of Set Set is a collection of objects, things or symbols. There is no precise definition for.
Discrete Mathematics Unit - I. Set Theory Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is very subjective)
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
1 Introduction (Pengenalan) n About the Lecturer: –Nama lengkap: Heru Suhartanto, Ph.D –Kantor: Ruang 1214, Gedung A, Fakultas Ilmu Komputer UI, Depok.
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Sets Defined A set is an object defined as a collection of other distinct objects, known as elements of the set The elements of a set can be anything:
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Copyright © 2014 Curt Hill Sets Introduction to Set Theory.
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.
CS201: Data Structures and Discrete Mathematics I
A Brief Introduction to Set Theory. How Many Things?
CompSci 102 Discrete Math for Computer Science
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
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.
1 Introduction to Abstract Mathematics Sets Section 2.1 Basic Notions of Sets Section 2.2 Operations with sets Section 2.3 Indexed Sets Instructor: Hayk.
Sets Goal: Introduce the basic terminology of set theory.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 2 CS 1813 – Discrete Mathematics Proofs Propositions and Calculuses.
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.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Wed, Mar 8, 2006.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
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.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
Introduction to Graph Theory & its Applications
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
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.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 CS 1813 – Discrete Mathematics Review of Predicate Calculus Set Theory Inductive.
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Sets.
Discrete Mathematical The Set Theory
Lecture 04 Set Theory Profs. Koike and Yukita
Set, Combinatorics, Probability & Number Theory
CS 2210:0001 Discrete Structures Sets and Functions
Chapter 5, Set Theory 1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Lecture 15 CS 1813 – Discrete Mathematics
Lecture 12 CS 1813 – Discrete Mathematics
Lecture 13 CS 1813 – Discrete Mathematics
CS 1813 – Discrete Mathematics
Quizzes CS 1813 – Discrete Mathematics
Lecture 11 CS 1813 – Discrete Mathematics
CSCI-2400 Models of Computation.
A Brief Summary for Exam 1
Discrete Mathematics CS 2610
Lecture 8 CS 1813 – Discrete Mathematics
Presentation transcript:

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 14 CS 1813 – Discrete Mathematics A Little Bit of Set Theory

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 2 What Is a Set?  Axiomatic approach  Postulate the existence of Empty set — a set with no elements Infinite set — a set with an infinite number of elements  Define some set operations  Build all other sets from this starting point  Naïve approach  A set is a collection of elements  There is some way to determine whether or not an element resides in a set  Avoid contradictions by being specific about the universe of discourse path we’ll follow

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 3 Notation for Sets — Explicit Enumeration  {2, 3, 5, 7, 11}  2  {2, 3, 5, 7, 11} — stylized epsilon denotes “element of”  5  {2, 3, 5, 7, 11}  1  {2, 3, 5, 7, 11} — x  A   (x  A)  “Long Tall Sally”  {2, 3, 5, 7, 11}  {{“Wha’d I Say”, “Nadine”}, {“Peer Gynt”, “Moonlight Sonata”, “Finlandia”}} = A  {“Wha’d I Say”, “Nadine”}  A  “Moonlight Sonata”  A  { }— the empty set, which has no elements none … nada … the number of elements in { } is zero  3  { }  x  { } — no matter what x stands for   = { } — stylized Greek letter phi denotes empty set

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 4 Notation for Sets — Set Comprehension  { x | x  {2, 3, 5, 7, 11}  x  4}  {5, 7, 11}  { x + x | x  {2, 3, 5, 7, 11}  x  3  x  11}  {6, 10, 14}  {f x | x  A, p x}  Denotes set whose elements have the form (f x), where x comes from A and (p x) has the value True  To avoid contradictions  Predicate (or context) specifies universe of discourse  Examples of invalid set comprehensions {X | X is a set} {X | X  X} Universe of discourse is missing in these examples

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 5 Set Operations — Subset, Equality  A is a subset of B  Definition: A  B   x. (x  A  x  B)  Examples {2, 3, 5, 7}  {2, 3, 5, 7, 11}   A — regardless of what set A stands for  Set equality  Definition: A = B  (A  B)  (B  A)  A is a proper subset of B  Definition: A  B  (A  B)  (A  B)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 6 Set Operations — Union  Union of A and B  Definition: A  B = {x | x  A  x  B}  Another way to say it:  x. (x  A  B)  (x  A  x  B)  Examples {2, 3, 5}  {5, 7, 11} = {2, 3, 5, 7, 11}   A = A — regardless of what set A stands for { , {  }}  { {{  }}, { , {  }} } = { , {  }, {{  }}, { , {  }} }  Big Union — of a set of sets  Definition:  S = {x |  A  S. x  A}  Another way to say it:  x. (x   S)  (  A. A  S  x  A)  Examples  { {2, 3, 5}, {5, 7, 11}, {2, 5, 13, 17} } = {2, 3, 5, 7, 11, 13, 17}  { {c, c 2 } | c  {1, 2, …}   a  {1, 2, …}.  b  {1, 2, …}. a 2 +b 2 =c 2 } = hypotenuses and their squares

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 7 Set Operations — Intersection  Intersection of A and B  Definition: A  B = {x | x  A  x  B}  Examples {2, 3, 5, 7}  {2, 7, 11} = {2, 7}   A =  — regardless of what set A stands for {Crazy}  {s | Patsy Cline sang s}  {s | Willie Nelson wrote s} where the universe of discourse is songs  Big Intersection — of a set of sets  Definition:  S = {x |  A  S. x  A}  Examples  { {2, 3, 5, 11}, {5, 7, 11}, {2, 5, 7, 11, 13, 17} } = {5, 11}  { {x n | x  {1, 2, …}} | n  {0, 1, 2, …} } = {1}  Disjoint  Definition: A and B are disjoint  A  B = 

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 8 Set Operations — Difference, Complement  Difference of A and B  Definition: A – B = {x | x  A  x  B}  Examples {2, 3, 5, 7} – {2, 7, 11} = {3, 5} A –  = A — regardless of what set A stands for  – A =  — regardless of what set A stands for {Georgia}  {s | Ray Charles sang s} – {s | Hank Wms wrote s} where the universe of discourse is songs  Complement of A  Definition: A’ = U – A where U is the universe of discourse  Examples, universe of discourse = {0, 1, 2, …} {2, 3, 4, 5}’ = {0, 1}  {6, 7, 8, …} {2x | x  {0, 1, 2, …} }’ = {2x+1 | x  {0, 1, 2, …} }

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 9 Set Operations — Power Set  Power set of A  Definition: P(A) = {S | S  A}  Examples P({2, 3, 5}) = { , {2}, {3}, {5}, {2,3}, {2,5}, {3,5}, {2,3,5}} P(  ) = {  } Theorem: If A has n elements, P(A) has 2 n elements –This will be proved later, using mathematical induction How many elements in P(P(  ))? –P(P(  )) = { , {  } } How many elements in P(P(P(  )))? –P(P(P(  ))) = { , {  }, {{  }}, { , {  }} } How many elements in P(P(P(P(  ))))? –2 4 — that is, 16 How many elements in P(P(P(P(P(  )))))? –2 16 — that is, quite a few (around 65,000)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10 Set Operations — Cartesian Product Also Known as Cross Product  Cartesian product of A and B  Definition: A  B = {(a, b) | a  A  b  B} Note: This definition is problematic because it doesn’t say what the universe of discourse is for the pairs (a, b). –Problem can be solved by defining pairs in terms of subsets –Solution is tedious, and not especially enlightening A has n elements, B has m elements |– A  B has n  m elements  Examples {2, 3}  {3, 5, 7} = {(2,3), (2,5), (2,7), (3,3), (3,5), (3,7)} {0, 1, 2, …}  {1, 2, 3, …} = pairs of non-negative natural numbers with second component non-zero A  P(A) has how many elements? (assume A has n elements) - A  P(A) has n  2 n elements if A has n elements

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 11 Tools for Computing with Sets  Domain of application  Finite sets  All elements have same type  Type of elements is the class Eq and in the class Show  Set operators defined in Stdm module  Make set — normalizeSet :: Eq a => [a] -> Set a  Subset — subset :: (Eq a, Show a) => Set a -> Set a -> Bool  Equality — setEq :: (Eq a, Show a) => Set a -> Set a -> Bool  Union — (+++) :: (Eq a, Show a) => Set a -> Set a -> Set a  Intersection — (  ) :: (Eq a, Show a) => Set a -> Set a -> Set a  Difference — (~~~) :: (Eq a, Show a) => Set a -> Set a -> Set a  Cartesian Product crossproduct :: (Eq a, Show a, Eq b, Show b) => Set a -> Set b -> Set(a,b)  Power Set — powerset :: (Eq a, Show a) => Set a -> Set(Set a)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 12 Subset Chain Rule (by natural deduction)  Theorem (Subset Chain Rule)  A  B, B  C |– A  C  Proof A  B  {def  fwd }  x. x  A  x  B B  C  {def  fwd }  x. x  B  x  C  {Thm27}  x. x  A  x  C  {def  bkw } A  C qed  Corollary (Set Equality Chain Rule)  A = B, B = C |– A = C Proof - recall that A = B means (A  B)  (B  A)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 13 Union is Commutative (by equational reasoning)  Definitions  A  B   x. (x  A  x  B)  A = B  (A  B)  (B  A)  Theorem {comm  }: (A  B) = (B  A) A  B = {x | x  A  x  B} {def  } = {x | x  B  x  A} {comm  } = B  A {def  } qed

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 14 Pointwise Proofs of Set Equality  Definitions  A  B   x. (x  A  x  B)  A = B  (A  B)  (B  A)  So, A = B can be proved point by point  Prove (  x. (x  A  x  B))  (  x. (x  B  x  A))  That is, prove  x. (x  A  x  B)  (x  B  x  A) Predicate calculus law 3.11  That is, prove  x. (x  A  x  B) Equivalence law of propositional calculus  That is, prove (x  A  x  B), where x is arbitrary Proof does not depend on the value of x

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 15 DeMorgan’s Law for Union a pointwise, equational proof  Theorem (DeM  )  (U – (A  B)) = ((U – A)  (U – B))  Proof x  U – (A  B)  x  U  x  A  B{def –}  x  U   (x  A  B) {def  }  x  U   ((x  A)  (x  B)) {def  }  x  U   (x  A)   (x  B) {DeM  }  x  U  x  U   (x  A)   (x  B) {  idem}  x  U   (x  A)  x  U   (x  B) {  comm}  x  (U – A)  x  U   (x  B){def –}  x  (U – A)  x  (U – B) {def –}  x  (U – A)  (U – B){def  } qed Proofs skips a few steps Where?

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 16 End of Lecture