Sets and set operations. Lecture 5 ICOM 4075

Similar documents
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

1.1 - Introduction to Sets

Lecture 15: The subspace topology, Closed sets

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets.

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

COUNTING AND PROBABILITY

2 Review of Set Theory

CS100: DISCRETE STRUCTURES

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

What is Set? Set Theory. Notation. Venn Diagram

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

Lecture-12: Closed Sets

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Lecture - 8A: Subbasis of Topology

CSC Discrete Math I, Spring Sets

Discrete Mathematics

Chapter 3. Set Theory. 3.1 What is a Set?

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

2.1 Sets 2.2 Set Operations

Algebra of Sets (Mathematics & Logic A)

Discrete Mathematics Lecture 4. Harper Langston New York University

Set and Set Operations

CHAPTER 8. Copyright Cengage Learning. All rights reserved.


Slides for Faculty Oxford University Press All rights reserved.

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4

Lecture : Topological Space

Open and Closed Sets

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

MA651 Topology. Lecture 4. Topological spaces 2

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4

1 Elementary number theory

Chapter 1: Number and Operations

Introduction. Sets and the Real Number System

Algebra of Sets. Aditya Ghosh. April 6, 2018 It is recommended that while reading it, sit with a pen and a paper.

Sets. Sets. Subset, universe. Specifying sets, membership. Examples: Specifying a set using a predicate. Examples

c) the set of students at your school who either are sophomores or are taking discrete mathematics

Introduction to Sets and Logic (MATH 1190)

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

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Topology notes. Basic Definitions and Properties.

Sets and set operations

SET DEFINITION 1 elements members

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

CSE 20 DISCRETE MATH. Fall

IB Sets and Venn Diagram Questions- Package #1

Integers and Mathematical Induction

CS 441 Discrete Mathematics for CS Lecture 24. Relations IV. CS 441 Discrete mathematics for CS. Equivalence relation

9.5 Equivalence Relations

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

Figure 1: From Left to Right, General Venn Diagrams for One, Two, and Three Sets

A.1 Numbers, Sets and Arithmetic

The Relational Data Model. Functional Dependencies. Example. Functional Dependencies

4 Mathematical Data Types

2 Sets. 2.1 Notation. last edited January 26, 2016

LECTURE 8: SETS. Software Engineering Mike Wooldridge

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Module 11. Directed Graphs. Contents

CSE 20 DISCRETE MATH. Winter

Final Test in MAT 410: Introduction to Topology Answers to the Test Questions

Let A(x) be x is an element of A, and B(x) be x is an element of B.

Topology Homework 3. Section Section 3.3. Samuel Otten

Relational Database: The Relational Data Model; Operations on Database Relations

1. [5 points each] True or False. If the question is currently open, write O or Open.

Johns Hopkins Math Tournament Proof Round: Point Set Topology

Discrete Mathematics SECOND EDITION OXFORD UNIVERSITY PRESS. Norman L. Biggs. Professor of Mathematics London School of Economics University of London

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

Section 17. Closed Sets and Limit Points

2.1 Symbols and Terminology

Figure 1.1: This is an illustration of a generic set and its elements.

Lecture 6,

Mathematically Rigorous Software Design Review of mathematical prerequisites

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Intersection of sets *

CS2 Language Processing note 3

Math Week in Review #5

Alphabets, strings and formal. An introduction to information representation

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

VLSI System Design Part II : Logic Synthesis (1) Oct Feb.2007

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

1 Elementary number theory

AXIOMS FOR THE INTEGERS

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Chapter 1. Preliminaries

TA: Jade Cheng ICS 241 Recitation Lecture Notes #12 November 13, 2009

= [ U 1 \ U 2 = B \ [ B \ B.

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

SECTION A (40 marks)

Compiler Construction

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects.

Sets. Margaret M. Fleck. 15 September 2010

Publication Data. Reading Options. Licence and permissions ISBN Mark Jago, 2007

3.DEFINITION. examples being the finite sets. However, we will have to consider infinite sets as well.

Transcription:

Sets and set operations Lecture 5 ICOM 4075

Reviewing sets s defined in a previous lecture, a setis a collection of objects that constitute the elementsof the set We say that a set containsits elements, and that an element belongs to its set If S is a set and x an element in S, we write x ЄS

Examples of sets 1. The set of integers: {, -3, -2, -1, 0, 1, 2, 3, } 2. The set of the vowels in the Latin alphabet: {a, e, i, o, u} 3. The set of all real solutions of the equation x⁴ + y⁴ 1 4. The set of 6 foot tall people 5. The set with no elements: this is the so-called empty set, and is denoted by φ

Describing sets a) By listing: this is, providing a list (sometimes partial list or mere pattern of formation) of the elements Example: Integers {, -3, -2, -2, 0, 1, 2, 3, } b) By property:this is, by providing a logical statement (property) that characterizes membership in the set. In this case, an element x is in the set if the statement is true for x and it is not if the statement is false Property logical statement Example: {x : x is an integer and x⁴ + 1 is even} 1Є, since 1⁴+1 2; 3Є since 3⁴+182; etc

Equality of sets Definition: Two sets are equalif they have the same elements. If S and R are sets and they are equal, then we write S R Examples: {1, 2, 3} {3, 1, 2} {a, b, a} {a, b} {a, c} {a}

Implications of equality s illustrated in the previous examples, (as a consequence of the definition of equality between sets) we have that in sets: Repeated elements do not count (repetitions are ignored) There is no particular order of the elements in a set

Finite and infinite sets set is finiteif it has a finite number of elementsor if it is the empty set. Otherwise, the set is said to be infinite Examples: The set of vowels in the Latin alphabet is finite since it has only 5 elements The set of people 20 foot tall is finite since it is empty The set of integers is infinite

Subsets Definition: If and B are sets and every element in is also an element in B, we say that is a subset of B. If is a subset of B we write: B Remark: The empty set is a subset of any set

The power set Definition: The power set of a set is the set of all subsets of (includes the empty set and the set itself). The power set of is denoted by pow() Example: Let {1, 2, 3}. The subsets of are: φ, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, and itself. Thus, pow( ) {φ, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, }

Proof strategies with subsets and equalities Following are useful strategies for proving logical statements asserting that two sets are equal or that one set is a subset of another set: Statement to prove is a subset of B is not a subset of B equals B is not equal to B Strategy Forarbitrary x in, show that x is also in B Find an element in that is not an element in B Show that is a subset of B and B is a subset of Find an element in that is not in B oran element in Bthat is not in

Example 1 Prove that is subset of B where {x : x 1 / (3n + 6), for some natural n} B {x : x 1 / n, for some natural n} Proof: If x is an element in, then there is a natural number q such that x 1 /(3q + 6). So, x 1 / 3(q + 2) or what is the same x 1 / 3k, where k q + 2 is a natural number. generic element in Therefore, x 1 / n with n 3k, a natural number. Conclusion: x is in B. Just a bit of algebra The generic element in satisfies the condition of membership in B

Example 2 Let {x : x 3k + 4, k integer} and B {x : x 5k + 6, k integer}. Is subset of B or B subset of? nswer: Neither is subset of B nor B is subset of. Proof: 7 is in, since 3 1+4 7. But, 7 is not in B since 7 5k+6 implies k 1/5 which is not integer. So, is not a subset of B. Reciprocally, 11 is in B since 5 1+6 11. But, 11 is not in since 11 3k+4 implies k 7/3 which is not integer. So, B is not a subset of.

Example 3 Let {x : x is prime and 12 x 18} and B {x : x 4 k + 1 and k 3 or k 4} Prove that B. Proof: First prove that is a subset of B: Note that {13, 17} since these are the primes that satisfy the property. But, 13 4 3 + 1 and 17 4 4 + 1. Therefore, 13 is in B and 17 is in B. Reciprocally, if k 3, 4 k + 1 4 3 + 1 13. Now, 13 is prime and 12 13 18. So, 13 is in. lso, if k 4, 4 k + 1 4 4 + 1 17. But, 17 is prime and 12 17 18. So, 17 is in

Set operations The main set operations are Union of sets Intersection of sets Complement of a set

The union of two sets Definition: given two sets and B, their unionis the set U B defined as U B {x: x in or x in B} Example 1: Let {a, b, c, d} and B {a, e, f}. Then, U B {a, b, c, d, e, f} Example 2: Let be the even numbers and B be the odd numbers. Then, U B is the set of natural numbers

Properties of union 1. φ 2. B B 3. (B C) ( B) C 4. 5. Bif andonly if B B

Proving some of these properties These properties (as any other property) are logical statements about sets and operations. This is, they are ultimately mathematical statements. We ll prove a one of them. Let s take for example, properties 5.

Proof of property 3 Remark: Note that property is and if and only if statement, and therefore, there are two implications involved. These are: (a) If B then B B (b) If Proof of (a): B B then The thesis is a equality of sets. We ll prove it by proving that: B B, and B B B

Proof of (a) (continuation) If x B, then x or x B. Since by hypothesis B, we have that if x, then x B. Therefore, if x B, then x B. This is, B B. Reciprocally, if x B then x B or x ; therefore, B B. So, B B.

Proof of (b) Theimplication is now : If B B then, B. We use the contrapositive: If B then B B. Proof of the contrapositive: If B, then there is an element x such that x B. But then,x B but x B. Therefore B and B do not have thesameelements. This is, B B.

Infinite unions Definition: Let ₁, ₂, ₃, be an infinite collection of sets. Their unionis define as the set: Thus, Now, U i 1 Example: Let { 2i, 2i}, i i 1 U i 1 i { 2, i {x : x, for some i 1,2,3,... 2}; 2 i { 4, 4}; 1} { 6, 6}, etc... {...,-10, -8, - 6, - 4, - 2, 2, 4, 6, 8,10,...} 3

Intersections Definition: The intersection of two sets and B is defined to be the set Example: B {x : x and x B} Let {n : n is integer and n 3k + 7 for some integer k} and let B {m : m is integer and m 4k + 5 for some integer k} Then B {n : n 3k + 7 4k + 5, for some integer k} Is there a solution? Yes!Pick k 2. Then 3k + 7 13 4k + 5. Therefore, B {13}.

Properties of the intersection of two sets 1. φ φ 2. B B 3. ( B) C (B C) 4. 5. B if and only if B

Further examples 1. Let {x : x is integer and x and let B the set of all integers. 20 for some integer k} k Then B {-20, -10, -5, - 4, - 2, 2, 4, 5,10, 20} 2. Let {y : y (x -1) 2 + 2 for some real number x} and let B {z :z -2x + 3 for some real number x}. Then, B {3}since if y z then (x -1) 2 + 2 2x + 3 x 2 2x + 1+ 2-2x + 3 x 2 + 3 3. This is, x 0. By replacing in both equations : y z 3.

,, Infinite intersections Definition : The intersection of 1 I i 1 i 2 Example: Let 3,...of sets is defined to be the set {x : x is an element of positive even number.then, I i 2 i i {x : x is integer and -i { 2, 0, 2} an infinite collection i for all i} x : i} where i is a

Complement of a set Definition: The complementof a set always refer to sets that are subsets of a particular set U, called universe, universal set or universe of discourse. Thus, if U, the complement of, denoted ', is defined to be the set ' {x U : x }

Example Let be the set of odd numbers. If U is chosen to be the set of naturals, then { 0, 2, 4, 6, }, this is, the set of all even numbers But if U is chosen to be the set of all real numbers, then {x: x real and x 2n+1 for any n natural}

Operational properties: Combining union and intersection 1. 2. ( B C) ( B) ( C) ( B C) ( B) ( C) Illustration of 1. : Let {1, 2, 3}, B {a, b, 2, 3} and C {1, 2, b, c}. Then, (B C) {1, 2,3} ({a,b, 2,3} {1,2, b,c}) {1, 2,3} {a,b,c,1, 2,3} {1, 2,3} ( B) ( C) ({1,2,3} {a,b, 2,3}) ({1,2,3} {1,2, b,c}) {2,3} {1, 2} {1, 2,3}

Properties of complement 1.(')' 2. φ' 3. 4. 5.( 6.( U and U' ' B if B)' B)' φ φ and and only if ' ' B' B' ' B' U ' De Morgan s LWS

Illustration of De Morgan s laws 7}' 5, 3, o,1, e,i, {a, B)' Then,( 9}. 7,8, 6, 5, 4, 3, 2, 0,1, u, o, e,i, {a, with universeu 7} 5, 3, o,1, i, {a,e, B 7}, 3, o, {a, Let 9} 6,8, 4, 2, 0, {u, 6,8,9} 4, 2, 0, {u, 9} 6,8, 4,5, 2, 0,1, u, {e,i, B' ' 9} 6,8, 4, 2, 0, {u,

Summary Notion of set, set descriptions Set equality and its implications Finite sets and infinite sets Subsets, power set Proof strategies with subsets and set equalities Operations with sets: definitions and properties Properties of combined operations

Exercises 1. Describe each of the following sets in terms of a property 1. {1, 5, 9, 13, } 2. B {, -8, -5, -2, 1, 4, 7, } 3. C {1, 2, 5, 10, 17,,82} 2. Write down the power set for each of the following sets 1. pow({a, b}) 2. {a, {a, b}, φ} 3. {φ, {φ}}

Exercises (cont.) 3. Is it true that power( B) power() power(b)? {x : x is integer and x -i or x i}, if i is even 4. Let i < > {x : x is integer and -i < x < i}, if i is odd 1.Find the union of 2. Find the intersection of 3.Find the union of 4. Find the intersection of the collection{ the collection{ the collection{ the collection{ i i :i natural} i :i natural} :i 1, 2, 3, 4, 5} i :i 1,3,5,7}