CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Slides:



Advertisements
Similar presentations
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Advertisements

Instructor: Hayk Melikya
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.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
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.
Lecture 3 Operations on Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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:
Copyright © 2014 Curt Hill Set Operations Now it gets fun.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
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 2/10/121. What is a Set? Informally, a collection of objects, determined by its members, treated as a single mathematical object Not a real definition:
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 2 With Question/Answer Animations. Section 2.1.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
College Algebra: Section 8.1 Sets and Counting Objectives of this Section Find All the Subsets of a Set Find All the Subsets of a Set Find the Intersection.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 Topic Sets (5.1, 5.2, 5.3). 2 Original author of the slides: Vadim Bulitko University of Alberta Modified by.
Thinking Mathematically Venn Diagrams and Subsets.
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.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
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.
Fifteen Puzzle Move: can move a square adjacent to the empty square to the empty square.
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.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Warm – up True / false : If false, explain why
Dr. Ameria Eldosoky Discrete mathematics
Applied Discrete Mathematics Week 1: Logic and Sets
Sets Finite 7-1.
Set Theory.
Discrete Structures – CNS 2300
Discrete Mathematical The Set Theory
Warm – up True / false : If false, explain why
CSNB 143 Discrete Mathematical Structures
Lecture 04 Set Theory Profs. Koike and Yukita
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
What is Probability? Quantification of uncertainty.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
… and now for something completely different…
Exercises Show that (P  Q)  (P)  (Q)
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Warm – up True / false : If false, explain why
CS100: Discrete structures
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Session – 2 SETS & Operations of SETS
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Applied Discrete Mathematics Week 2: Proofs
Discrete Mathematics CS 2610
Probability Notes Math 309.
… and now for something completely different…
Sets & Set Operations.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Probability Notes Math 309.
Probability Notes Math 309 August 20.
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics:  Vs  Venn Diagrams Proving two sets are equal Power Set and Cross Product

Set notations Union: AB = {x:xA  xB} Intersection: AB = {x:xA  xB} Complement: Ac= {x:xA} Difference: A-B = {x:xA  xB} Empty set: 

1.  Vs  Don’t be confused!

 Vs  Which one of the following is true? 1  {1,2,3} 1  {1,2,3} {1}  {1,2,3} {1}  1,2,3 None/other/more than one

 Vs  Which one of the following is true? 1  {{1},{2},{3}} 1  {{1},{2},{3}} {1}  {{1},{2},{3}} {1}  {{1},{2},{3}} None/other/more than one

 Vs  Which one of the following is true?   {,{},{{}}}   {,{},{{}}} {}  {,{},{{}}} {}  {,{},{{}}} None/other/more than one

2. Venn Diagrams

If A, B, and C are subsets of U, then 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =∅ We will prove this using Venn Diagram method First, we need to draw a generic Venn Diagram: U B A C

If A, B, and C are subsets of U, then 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =∅ Which area(s) represent 𝐵−𝐶 ? 1,2 2,5,8 1,2,3,4 3,4 Other/none/more U B A C

If A, B, and C are subsets of U, then 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =∅ Which area(s) represent 𝐴−𝐶 ? 1,4 2,3 8,7 5,6 Other/none/more U B A C

If A, B, and C are subsets of U, then 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =∅ Which area(s) represent 𝐴−𝐵 ? A = 2,3,5,6 B = 3,4,6,7 A – B = 2,5 A-C = 2,3 B-C = 3,4 A-B = 2,5 There is no number that appears in all three lists, so the intersection is empty set U B A C

If A, B, and C are subsets of U, then 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =∅ Algebraic proof: 𝐴−𝐶 ∩ 𝐵−𝐶 ∩ 𝐴−𝐵 =𝐴∩ 𝐶 𝐶 ∩𝐵∩ 𝐶 𝐶 ∩𝐴∩ 𝐵 𝐶 (by definition of set difference, and by associative law –removing parentheses) =𝐴∩ 𝐶 𝐶 ∩ 𝐶 𝐶 ∩𝐴∩ (𝐵 𝐶 ∩𝐵) (by commutative law, and by associative law –adding parentheses) =𝐴∩ 𝐶 𝐶 ∩ 𝐶 𝐶 ∩𝐴∩∅(by complement law) =∅(by universal bound law)

3. Proving two sets are equal

Set equality Given sets X and Y, X = Y means: ∀𝑧, 𝑧∈𝑋 ↔𝑧∈𝑌 ∀𝑧, 𝑧∈𝑋 ↔𝑧∈𝑌 So we can use our proof template for “if and only if” to show that two sets are equal (Your book shows a different way, “chain of iffs”) Recall: 𝑝↔𝑞 is equivalent to 𝑝→𝑞 AND 𝑞→𝑝 “IFF” proof template says do this as two proofs: Prove 𝑝→𝑞 Next, prove 𝑞→𝑝 (Each part uses the “proving implications” template)

Set equality: example X={even numbers} Y={n: n+2 is even} Claim: X=Y Proof: nX  n is even  n+2 is even  nY

Set equality Another take: one way to prove that X=Y is to prove that both X  Y Y  X

Set equality: another example X={n: 6 divides n} Y={n:2 divides n and 3 divides n} Claim: X=Y XY: Let nX, i.e. n=6k. Hence, n=2(3k),n=3(2k), which means nY. YX: Let nY, i.e. n=2a,n=3b. So, 3b=2a is even. Hence b must be even (need lemma: odd times odd is odd), i.e. b=2c. So, n=6c, hence nX.

Set equality: yet another example Can also prove directly Claim: (AC)C=A Proof: AC={x: x  A} (AC)C = {x: x  AC} = {x: x  A}

4. Power Set and Cross Product

Power Sets For any set A, let P(A) be its power set, which is the set of all its subsets Note that A is itself a member of P(A). Recall: ∅ denotes the empty set. Question: What is P({1,2})? {1, 2, {1,2}} {{1}, {2}, {1,2}, ∅} {1, 2, {1,2}, {2,1}} None/other/more than one

Cross Product For any sets A and B, let A x B = {(x, y); x ∈ A and y ∈ B} Question: What is {1,2} x {1, 2, 3} ? {1, 2, 3} {(1,1), (2,2), (∅ ,3)} {(1,1),(1,2),(1,3),(2,1),(2,2),(2,3)} {(1),(1,2),(1,3),(2),(2,3)} None/other/more than one