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

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

1.1 - Introduction to Sets

CSC Discrete Math I, Spring Sets

CS100: DISCRETE STRUCTURES

Recursion and Structural Induction

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

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

SET DEFINITION 1 elements members

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

2.1 Sets 2.2 Set Operations

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

Set and Set Operations

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

Discrete Mathematics

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

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

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

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

11 Sets II Operations

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.

Discrete Mathematics Lecture 4. Harper Langston New York University

Lecture 15: The subspace topology, Closed sets

Sets and set operations. Lecture 5 ICOM 4075

Sets and set operations

Logic and Proof course Solutions to exercises from chapter 6

2 Review of Set Theory

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

Slides for Faculty Oxford University Press All rights reserved.

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say


Sets. {1, 2, 3, Calvin}.

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

COUNTING AND PROBABILITY

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

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

CSE 20 DISCRETE MATH. Fall

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

9.5 Equivalence Relations

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

2.1 Symbols and Terminology

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

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

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

Intersection of sets *

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

Math Week in Review #5

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Lecture-12: Closed Sets

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

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

What is Set? Set Theory. Notation. Venn Diagram

Today s Topics. What is a set?

Outline. CISC 1100/1400 Structures of Comp. Sci./Discrete Structures Chapter 1 Sets. Sets. Enumerating the elements of a set

The Language of Sets and Functions

CSE 20 DISCRETE MATH. Winter

Math Week in Review #5. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

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

Algebra of Sets (Mathematics & Logic A)

EDAA40 At home exercises 1

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

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

Question7.How many proper subsets in all are there if a set contains (a) 7 elements (b) 4 elements

Chapter 2: Sets. Diana Pell. In the roster method: elements are listed between braces, with commas between the elements

Section Sets and Set Operations

1 Sets, Fields, and Events

LECTURE 8: SETS. Software Engineering Mike Wooldridge

2.3 Algebraic properties of set operations

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

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics

Functions. How is this definition written in symbolic logic notation?

Lecture : Topological Space

LECTURE 2 An Introduction to Boolean Algebra

Math Summer 2012

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

What is a Set? Set Theory. Set Notation. Standard Sets. Standard Sets. Part 1.1. Organizing Information

Topology notes. Basic Definitions and Properties.

Homework Set #2 Math 440 Topology Topology by J. Munkres

Math Introduction to Advanced Mathematics

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

CS February 17

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics

Section 13. Basis for a Topology

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

MATH 54 - LECTURE 4 DAN CRYTSER

In this section we take an aside from the normal discussion in algebra.

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Tutorial 3 Q&A. En la pregunta 7 de la sección 2.2 el cual dice: 7. Prove the domination laws in Table 1 by showing that: a)a U = U b)a =

Domination, Independence and Other Numbers Associated With the Intersection Graph of a Set of Half-planes

Ch 3.4 The Integers and Division

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

Algorithm. Algorithm Analysis. Algorithm. Algorithm. Analyzing Sorting Algorithms (Insertion Sort) Analyzing Algorithms 8/31/2017

r=1 The Binomial Theorem. 4 MA095/98G Revision

TOPOLOGY, DR. BLOCK, FALL 2015, NOTES, PART 3.

Appendix Set Notation and Concepts

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

4 Mathematical Data Types

Definition. A set is a collection of objects. The objects in a set are elements.

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

Introduction. Sets and the Real Number System

Transcription:

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

Sets Sets A set is an unordered collection of objects, called elements, without duplication. We write a A to denote that a is an element in A. Sets are the most fundamental discrete structure on which all other discrete structures are built. Examples: A = {a, b, c} N = {0, 1, 2,..., 99}, all positive integers below 100 Mukulika Ghosh Parasol Lab - Texas A&M University 2/27

Common Sets Common Sets N = 0, 1, 2, 3,..., set of natural numbers. Z =..., 2, 1, 0, 1, 2,..., set of integers. R set of real numbers, C set of complex numbers. Mukulika Ghosh Parasol Lab - Texas A&M University 3/27

Empty Set Empty Set Empty set does not have any member and is denoted by. Example: Empty directory in file structure. Question: What does { } mean? Mukulika Ghosh Parasol Lab - Texas A&M University 4/27

Set Builder Notation Set Builder Notation The set builder notation describes all elements having certain properties (even they can formed from elements from other sets). Q = {p/q R p Z, q Z, and q 0} [a, b] = {x a <= x <= b, a < b and x, a, b R} [a, b) = {x a <= x < b, a < b and x, a, b R} (a, b] = {x a < x <= b, a < b and x, a, b R} (a, b) = {x a < x < b, a < b and x, a, b R} Mukulika Ghosh Parasol Lab - Texas A&M University 5/27

Equal Sets Equal Sets Two sets (A and B) are considered equal (A = B) if and only if they have the same elements ( x(x A x B). To prove A = B, it is sufficient to show both x(x A x B) and x(x B x A) hold. Mukulika Ghosh Parasol Lab - Texas A&M University 6/27

Subset Subset A set A is a subset of B, written A B, if every element of A is also an element of B ( x(x A x B)). Example: Z R A = {1, 2}, B = {0, 1, 1, 2}, A B Mukulika Ghosh Parasol Lab - Texas A&M University 7/27

Subset Prove that for every set S, we have S. Proof: We have to show that ( x(x x S)) is true. Since the empty set does not contain any elements, the premise is always false; hence, the implication x x S is always true. Therefore, ( x(x x S)) is true; hence, the claim follows. Mukulika Ghosh Parasol Lab - Texas A&M University 8/27

Exercise 1 Exercise 1 Answer the following: 1. Use set builder notation to define the set { 3, 2, 1, 0, 1, 2, 3}. 2. If A = {2, 4, 6}, B = {2, 6}, C = {4, 6} and D = {4, 6, 8}, then determine which of these sets are subsets of which other of these sets. 3. State true/false : { } { }. 4. State true/false : {{ }}. 5. State true/false : If A = B, then A B and B A. Mukulika Ghosh Parasol Lab - Texas A&M University 9/27

Cardinality of Sets Cardinality of Sets Let S be a set with a finite number of elements. We say that the set has cardinality n if and only if S contains n elements. We write S to denote the cardinality of the set. Example: A = {1, 2, 3}, then A = 3. What is the cardinality of ( )? Mukulika Ghosh Parasol Lab - Texas A&M University 10/27

Power Sets Power Sets Given a set S, the power set P (S) of S is the set of all subsets of S. Example: P ({1}) = {, {1}} P ({1, 2}) = {, {1}, {2}, {1, 2}} P ( ) = { } since every set contains the empty set as a subset, even the empty set. P ({ }) = {, { }}. Question: Determine P ({, { }}) Mukulika Ghosh Parasol Lab - Texas A&M University 11/27

Cartesian Product Cartesian Product Let A and B be sets. The cartesian product of A and B, denote A B, is the set of all pairs (a, b) with a A and b B. A B = {(a, b) a A b B} Example: Let A = {1, 2} and B = {a, b}, then A B = {(1, a), (1, b), (2, a), (2, b)}. Question: What is the catersian product of A = {1, 2} and empty set? Mukulika Ghosh Parasol Lab - Texas A&M University 12/27

Exercise 2 Exercise 2 Let A = {a, b, c} and B = {0, 1}. Answer the following: 1. What is cardinality of sets A and B? 2. Determine P (A) and P (B). 3. What is A B? Mukulika Ghosh Parasol Lab - Texas A&M University 13/27

Set Operations Set Operations Let A and B be two sets. The union of Aand B, denoted A B, is the set that contains those elements that are in A or in B, or in both. The intersection of Aand B, denoted A B, is the set that contains those elements that are in both A and B. The difference between A and B, denoted A B or A\B, is the set that contains those elements that are in A but not in B (A B = {x A x / B}). Mukulika Ghosh Parasol Lab - Texas A&M University 14/27

Set Operations Example: A = {1, 2, 3}, B = {2, 4, 6} A B = {1, 2, 3, 4, 6} A B = {2} A B = {1, 3} B A = {4, 6} Mukulika Ghosh Parasol Lab - Texas A&M University 15/27

Set Operations Exercise 3 Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find: 1. A B 2. A B 3. A B 4. B A Mukulika Ghosh Parasol Lab - Texas A&M University 16/27

Universe and Complement Universe and Complement A set which has all the elements in the universe of discourse is called a universal set and is denoted by U. The complement of set A, denoted A c or Ā, is given by U A. Example: Let the universal set be set of all letters in English alphabets, and V be set of all vowels. The complement of V ( V ) is set of all consonants. Mukulika Ghosh Parasol Lab - Texas A&M University 17/27

Set Identities Set Identities Let U be universal set. Identity Laws: A U = A, A = A Domination Laws: A U = U, A = Idempotent Laws: A A = A, A A = A Commutative Laws: A B = B A, A B = B A Associative Laws: A (B C) = (A B) C, A (B C) = (A B) C Distributive Laws: A (B C) = (A B) (A C), A (B C) = (A B) (A C) Mukulika Ghosh Parasol Lab - Texas A&M University 18/27

De Morgan s Law De Morgan s Law A B = Ā B A B = {x x / A B} by definition of complement (1) = {x (x A B)} by definition of / (2) = {x (x A x B)} by definition of intersection (3) = {x (x A) (x B)} by De Morgan s law (4) = {x (x / A) (x / B)} by definition of / (5) = {x (x Ā) (x B)} by definition of complement (6) = {x x Ā x B} by definition of union (7) = Ā B by set builder notation (8) Mukulika Ghosh Parasol Lab - Texas A&M University 19/27

Exercise 4 Exercise 4 Simplify the equation using set identity laws if A, B and C are sets (A B) (B C). Mukulika Ghosh Parasol Lab - Texas A&M University 20/27

Generalized Unions and Intersections Generalized Unions and Intersections The union of a collection of sets is the set that contains those elements that are members of at least one set in the collection. nk=1 A k = A 1 A 2... A n The intersection of a collection of sets is the set that contains those elements that are members of all sets in the collection. nk=1 A k = A 1 A 2... A n Mukulika Ghosh Parasol Lab - Texas A&M University 21/27

Generalized Unions and Intersections Example: For i = 1, 2,..., let A i = {i, i + 1, i + 2,...} ni=1 A i = n i=1 {i, i + 1, i + 2,...} = {1, 2, 3,...} ni=1 A i = n i=1 {i, i + 1, i + 2,...} = {n, n + 1, n + 2,...} = A n Mukulika Ghosh Parasol Lab - Texas A&M University 22/27

Exercise 5 Exercise 5 Let A i = {..., 2, 1, 0, 1,..., i}. Find: 1. n i=1 A i 2. n i=1 A i Mukulika Ghosh Parasol Lab - Texas A&M University 23/27

Computer Representation of Sets Computer Representation of Sets Suppose that the universal set U is small. Order the elements of U, say a 1, a 2,..., a n. Represent a subset A of U by a bit string of length n. The k-th bit is equal to 1 if and only if a k is contained in A. Mukulika Ghosh Parasol Lab - Texas A&M University 24/27

Computer Representation of Sets Example: Let U = {1, 2, 3, 4, 5, 6} be the universal set. 1 6 Represent the subset A = {1, 2} by a bit string of length 6. 1 1 0 0 0 0 1 6 Mukulika Ghosh Parasol Lab - Texas A&M University 25/27

Computer Representation of Sets Operations Let A and B be sets represented by the bit strings a and b, respectively. Ā is represented by negating the bits of a. The A B is represented by (a k b k ) k=1..n The A B is represented by (a k b k ) k=1..n Mukulika Ghosh Parasol Lab - Texas A&M University 26/27

Computer Representation of Sets Usage The bit string representation of sets is particularly efficient if the size of the universal set can be represented with a few machine words. If many set operations beside union, intersection, and complement are needed, then this representation might not be such a good choice. Mukulika Ghosh Parasol Lab - Texas A&M University 27/27