1 Discussion #21 Discussion #21 Sets & Set Operations; Tuples & Relations.

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

Union Definition: The union of sets A and B, denoted by A B, contains those elements that are in A or B or both: Example: { 1, 2, 3} {3, 4, 5} = { 1,
Prof. Johnnie Baker Module Basic Structures: Sets
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
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
Denoting the beginning
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.
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.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
modified from UCI ICS/Math 6D, Fall Sets+Functions-1 Sets “Set”=Unordered collection of Objects “Set Elements”
1 Set Theory. 2 Set Properties Commutative Laws: Associative Laws: Distributive Laws:
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
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,
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:
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.
CS201: Data Structures and Discrete Mathematics I
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
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Sets. Definitions (I) Collection of elements such that: There are no duplicates There is no order Special sets Universe (U or E): all elements under consideration.
ELEMENTARY SET THEORY.
Sets & Set Operations Tuples & Relations. Sets Sets are collections –The things in the collection are called elements or members –Sets have no duplicates.
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.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
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.
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)
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
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.
Discrete Mathematical The Set Theory
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Week 7 - Monday CS322.
CS 2210:0001 Discrete Structures Sets and Functions
Discussion #10 Logical Equivalences
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Operations Section 2.2.
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Discrete Mathematics CS 2610
Discrete Mathematics R. Johnsonbaugh
L5 Set Operations.
Lecture Sets 2.2 Set Operations.
Sets & 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.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

1 Discussion #21 Discussion #21 Sets & Set Operations; Tuples & Relations

2 Discussion #21 Topics Sets and Set Operations  Definitions  Operations  Set Laws  Derivations, Equivalences, Proofs Tuples and Relations  Tuples  pairs & n-tuples  Cartesian Product  Relations  subset of the cross product

3 Discussion #21 Sets Sets are collections  The things in a collection are called elements or members  Sets have no duplicates. Notation { }  Enumerate: {1, 2, 3}  Ellipsis: {1, 2, …} or {1, 2, …, 100}  Universe: U, universe of discorse  Empty set: { } or  i.e. set with no elements Special sets  N  N natural numbers {0, 1, 2, …} (some exclude 0 from this set)  ZR  Z integers; R reals “set builder” notation  { x | P(x)} all elements in U that satisfy predicate P N  { x | x>5  x<10} = {6, 7, 8, 9} when U = N Element of: x  A Cardinality  |A| or #A  both denote the number of elements in A, e.g. |{a,b}| = 2

4 Discussion #21 Set Equality, Subsets, Supersets Set Equality  A = B if A and B have the same elements  A = B  x  A  x  B Subsets  A  B  x  A  x  B (subset or equal)  A  B  A  B   x(x  B  x  A) (proper subset) Supersets A  B if B  A A  B if B  A

5 Discussion #21 Proofs about Set Equality and the Empty Set Prove: A = B iff A  B  B  A A = B  x  A  x  B definition of set equality  (x  A  x  B)  (x  B  x  A) P  Q  (P  Q)  (Q  P)  A  B  B  A definition of subset Prove:   A (i.e.  is a subset of every set.)   A  x    x  A definition of subset  F  x  A x   is false (for if not there is an element of U in the empty set, contrary to the defintion)  T

6 Discussion #21 Set Operations: Intersection Intersection A  B  {x | x  A  x  B} {1, 2, 3}  {2, 3, 4} = {2, 3} Prove: A  B  A By definition, A  B  A  x  A  B  x  A 1. x  Aassume negation of conclusion 2. x  A  Bpremise 3. x  A  x  Bdef of  4. x  A3, simplification 5. x  A  x  A1&4, conjunction 6. F5, contradiction AB

7 Discussion #21 Set Operations: Intersection Intersection A  B  {x | x  A  x  B} {1, 2, 3}  {2, 3, 4} = {2, 3} Prove: A  B  A By definition, A  B  A  x  A  B  x  A 1. x  Aassume negation of conclusion 2. x  A  Bpremise 3. x  A  x  Bdef of  4. x  A3, simplification 5. x  A  x  A1&4, conjunction 6. F5, contradiction AB A simpler proof.

8 Discussion #21 Set Operations: Union Union A  B  {x | x  A  x  B} {1, 2, 3}  {2, 3, 4} = {1, 2, 3, 4} No duplicates! Prove: A  A  B By definition, A  A  B  x  A  x  A  x  B 1. x  A premise 2. x  A  x  B1, law of addition AB

9 Discussion #21 Set Operations: Set Difference AB Difference (minus) A – B  {x | x  A  x  B} {1, 2, 3} – {2, 3, 4} = {1} Remove elements of B from A Prove: A – B  A By definition, A – B  A  x  A–B  x  A 1. x  A – B premise 2. x  A  x  B definition 3. x  A simplification

10 Discussion #21 Set Operations: Complement Complement ~ A  U – A  {x | x  U  x  A} ~{1, 2, 3} = {4} if U = {1, 2, 3, 4} Prove: A  ~A =  A  ~A =   A  ~A      A  ~A set equality  A  ~A    T  is a subset of every set  A  ~A   identity  x  A  x  ~A  x   def of  and   x  A  x  U  x  A  x   def of ~  F  x   comm., contradict., dominat.  T Note: Unary operators have precedence over binary operators.Use parentheses for the rest. Possible to define precedence: ~, , , . A

11 Discussion #21 Basic Set Identities Set AlgebraName A  ~A = U A  ~A =  Complementation law Exclusion law A  U = A A   = A Identity laws A  U = U A   =  Domination laws A  A = A A  A = A Idempotent laws Duals:  and  E

12 Discussion #21 Basic Set Identities (continued…) Set AlgebraName ~(~A) = A Double Complement A  B = B  A A  B = B  A Commutative laws (A  B)  C = A  (B  C) (A  B)  C = A  (B  C) Associative laws A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) Distributive laws ~ (A  B) = ~A  ~B ~ (A  B) = ~A  ~B De Morgan’s laws

13 Discussion #21 Example: Set Laws Absorption A  (A  B) = A A  (A  B) = A Venn Diagram “Proof” Prove: A  (A  B) = A A  (A  B) = (A   )  (A  B)ident. = A  (   B)distrib. = A   dominat. = Aident. AB

14 Discussion #21 Tuples Things (usually a small number of things) arranged in order 2-tuples  pairs (x, y)  ordered (x, y)  (y, x) unless x = y n-tuples = (x 1, x 2, …, x n ) Typically, elements in tuples are taken from known sets  x  females, y  males (Mary, Jim) e.g. might mean: Mary and Jim are a married couple  x  people, y  cars (Mary, red sports car 17 ) e.g. might mean: Mary owns red sports car 17  x, y, z  integers (3, 4, 7) e.g. might mean: = 7

15 Discussion #21 Cartesian Product A  B = {(x, y) | x  A  y  B} e.g.A = {1, 2} B = {a, b, c} A  B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)} |A  B| = |A| · |B| = 2 · 3 = 6

16 Discussion #21 Cartesian Product (continued…) n-fold Cartesian Product A 1  …  A n = {(x 1, …, x n ) | x  A 1  …  x n  A n } e.g.A = {1, 2} B = {a, b, c} C = { ,  } A  B  C = {(1,a,  ), (1,a,  ), (1,b,  ), (1,b,  ), (1,c,  ), (1,c,  ), (2,a,  ), (2,a,  ), (2,b,  ), (2,b,  ), (2,c,  ), (2,c,  )} Can get large: A = set of students at BYU(30,000) B = set of BYU student addresses(10,000) C = set of BYU student phone#’s(60,000) |A|  |B|  |C| = 1.8  10 13

17 Discussion #21 Relations Relation  Subset of the cross product  Not necessarily a proper subset  R  A  B or R  A  B  C Examples:  A = {1, 2} & B = {a, b, c} R = {(1, a), (2, b), (2, c)}  A = {1, 2} & B = {a, b, c} & C = { ,  } R = {(1, a,  ), (2, c,  )}  Marriage: subset of the cross product of males and females