CISC1100: Sets Fall 2014 Xiaolan Zhang

Slides:



Advertisements
Similar presentations
Learning Objectives for Section 7.2 Sets
Advertisements

Lecture 2 Introduction To Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Sets DISCRETE STRUCTURE ABDUL BASIT TAHIR, KAMRAN ALI, FAIZAN ILLAHI, NOMAN AHMAD, ARSALAN MUBASHIR.
Analytical Methods in CS (CIS 505)
Chapter 5 Section 1 Sets Basics Set –Definition: Collection of objects –Specified by listing the elements of the set inside a pair of braces. –Denoted.
Introduction to Sets. A set is just a collection of stuff But the stuff must be written inside curly braces Each item in the curly braces is separated.
Chapter 2 The Basic Concepts of Set Theory
Set Theory.
1 Learning Objectives for Section 7.2 Sets After today’s lesson, you should be able to Identify and use set properties and set notation. Perform set operations.
Set Notation.
This section will discuss the symbolism and concepts of set theory
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
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:
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
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
CompSci 102 Discrete Math for Computer Science
Section 2.2 Subsets and Set Operations Math in Our World.
Sets CSLU Fall 2007 Cameron McInally Fordham University.
Chapter 2 Section 2.1 Sets and Set Operations. A set is a particular type of mathematical idea that is used to categorize or group different collections.
ELEMENTARY SET THEORY.
Sets and Set Notation What are sets? A set is a collection of things. The "things" in the set are called the "elements”. A set is represented by listing.
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.
1 Chapter Two Basic Concepts of Set Theory –Symbols and Terminology –Venn Diagrams and Subsets.
(CSC 102) Lecture 13 Discrete Structures. Previous Lectures Summary  Direct Proof  Indirect Proof  Proof by Contradiction  Proof by Contra positive.
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.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
Thinking Mathematically Venn Diagrams and Set Operations.
The Basic Concepts of Set Theory. Chapter 1 Set Operations and Cartesian Products.
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.
Sets and Operations TSWBAT apply Venn diagrams in problem solving; use roster and set-builder notation; find the complement of a set; apply the set operations.
CPCS 222 Discrete Structures I
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.
Sets CS 202, Spring 2007 Epp, chapter 5.
Dr. Ameria Eldosoky Discrete mathematics
The set of whole numbers less than 7 is {1, 2, 3, 4, 5, 6}
Sets Page 746.
Welcome to MATH225 Applications of Discrete Mathematics and Statistics.
Sets Finite 7-1.
Set Definition: A set is unordered collection of objects.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set, Combinatorics, Probability & Number Theory
Sets CSLU Fall 2007 Cameron McInally
Sets Section 2.1.
Chapter 1 Logic and Proofs Homework 2 Given the statement “A valid password is necessary for you to log on to the campus server.” Express the statement.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Intro to Set Theory The Math of Santa’s Bag.
CS100: Discrete structures
Set-Builder Notation.
2.1 Sets Dr. Halimah Alshehri.
CHAPTER 1 - Sets and Intervals
CHAPTER 1 - Sets and Intervals
Sets. EXAMPLE 1 The set O of odd positive integers less than 10 can be expressed by O = { l, 3, 5, 7, 9}. * This way of describing a set is known as.
Copyright © Cengage Learning. All rights reserved.
SETS Sets are denoted by Capital letters Sets use “curly” brackets
MCS680: Foundations Of Computer Science
Chapter 7 Logic, Sets, and Counting
Terms Set S Set membership x  S Cardinality | S |
ICOM 5016 – Introduction to Database Systems
2.1 – Symbols and Terminology
Lecture Sets 2.2 Set Operations.
Sets & Set Operations.
SETS, RELATIONS, FUNCTIONS
Presentation transcript:

CISC1100: Sets Fall 2014 Xiaolan Zhang Dept. of Computer & Information Sciences Fordham University

Outline on sets Basics Venn Diagram Specify a set by enumerating all elements Notations Cardinality Venn Diagram Relations on sets: subset, proper subset Set builder notation Set operations

Set: an intuitive definition A set is just a collection of objects, these objects are called the members or elements of the set One can specify a set by enclosing all its elements with curly braces, separated by commas Examples: Set has 6 elements: letter a, letter b, letter c, d, e, and f Set has 5 elements: bob, 1, 8, clown, hat.

A set without elements is a special set: Called the empty set, or null set, often also denoted as

Enumerating set elements You don’t list anything more than once Order doesn’t matter The following sets are identical (same)

So what if I get tired of writing out all of these Sets? Just as with algebra, we give name to a set. Typically we use single capital letters to denote a set. For example:

Notations Two key symbols that we will see: means “x is an element of set A” means “x is not an element of set A” 7

Cardinality The cardinality of a set A is the number elements in the set, denoted as |A|. For example:

Exercises What is |A|? 3 What is |B|+|C| 6 What is |D|+|E|-|A|? 3+0-3=0

Outline on sets Basics Venn Diagram Specify a set by enumerating all elements Notations Cardinality Venn Diagram Relations on sets: subset, proper subset Set builder notation Set operations

Venn Diagram Venn Diagram is a diagram for visualizing sets a rectangle represents universal set, U, the set contains all elements that we are interested in Circles within it represent other sets A U Ex: U: the set of all Fordham students A: all freshman students, B: all female students, C: all science major students

Relations between sets If A is totally included in set B, i.e., every element of A is also an element of B, denoted as , read as A is a subset of B B A For example: B Any set is a subset of itself Empty set is subset of any set 12

Relations between sets If A is not totally included in set B, i.e., there exists some element of A that is not an element of B, then A is not a subset of B, denoted as B C A For example: B 13

Proper subset If A is a subset of B, and A≠B, then A is a proper subset of B, denoted as Analogy to ≤ and < relations between numbers 14

Exercise: True or False If , and , then If , and , then If , then If , then {} has no subset.

Exercise Find out all subsets of set A={1,2} Find out all subsets of set A={a,b,c} Find out all proper subsets of set A={a,b,c}

Outline on sets Basics Venn Diagram Specify a set by enumerating all elements Notations Cardinality Venn Diagram Relations on sets: subset, proper subset Set builder notation Set operations

Some well-known sets N is the natural numbers {0, 1, 2, 3, 4, 5, …} Z is the set of integers {…-2,-1,0,1,2,…} Q is the set of rational numbers Any number that can be written as a fraction, that is , where p and q are integers, and q≠0 e.g. R is the set of real numbers all numbers/fractions/decimals that you can imagine, including , etc.

Some Well-known Sets: Variations N+ is the set of positive natural numbers, { 1, 2, 3, 4, 5, …} Z- is the set of negative integers {-1,-2,-3,…} Q>1 is the set of rational numbers that are greater than 1 R<10 is the set of real numbers that are smaller than 10

Set Builder Notation We don’t always have the ability or want to list every element in a set. Mathematicians have invented “Set Builder Notation”. For example, read as “a set contains all x’s such that x is an element of the set of natural numbers and … ”

Set Builder Notation Second half: constrains on objects specified in first half for it to be an element of the set. first half: what we want to include in our set

Reading set builder notations

More about set builder First half: can be an expression, or specify part of the constraints. For example: Let A={1,2,3,5}

Some exercise Find all elements of set B defined as follows:

Outline on sets Basics Venn Diagram Specify a set by enumerating all elements Notations Cardinality Venn Diagram Relations on sets: subset, proper subset Set builder notation Set operations

Set Operations Just like in arithmetic, there are lots of ways we can perform operation on sets. Most of these operations are different ways of combining two different sets, but some (like Cardinality) only apply to a single set.

Create a new set by combining all of the elements or two sets, i.e., Union Create a new set by combining all of the elements or two sets, i.e., The part that has been shaded. “is defined as”

Union Examples

Create a new set using the elements the two sets have if common Intersection Create a new set using the elements the two sets have if common “is defined as” The part that has been shaded twice is

Intersection Examples

Difference Create a new set that includes all elements of set A, removing those elements that are also in set B A-B: the part that is shaded in blue A B

Difference Examples

Complement The difference of universal set U (the set that includes everything) and A is also called the complement of A: U Colored area is U-A A

Set operations example A is the set of all computer science majors. B is the set of all physics majors. C is the set of all general science majors. D is the set of all female students. Using set operations, describe each of the following in terms of the sets A, B, C and D: Set of all male physics majors. Set of all students who are female or general science majors. Set of all students not majoring in computer science.

Fenway Park or Yankee Stadium Of the 28 students in a class, 23 have visited one or both 12 have visited Fenway 9 have visited Fenway and Yankee Stadium How many have visited Yankee stadium? How many have visited only Fenway Park?

Principle of Inclusion/Exclusion Also,

Principle of Inclusion/Exclusion A C B

Power Set is a set that consists of all subsets of set A. e.g. P({1})=? List all subsets of {1}: {},{1} Therefore P({1})={{},{1}}.

Power Set Examples

Exercises on power set

Cardinality of Power Set If |A|=1, |P(A)|= ? Try P({a})= If |A|=2, |P(A)|= Try P({a,b}) If set A has a certain number of subsets, after we add one more element into A, how many subsets A has now ? Every originally identified subsets are still valid Add the new element into each of them, and we get a new subset. The number of subsets doubles !

Cardinality of Power Set Set A with n elements has an subsets We can find the closed form: A set of cardinality n has 2n subsets If |A|=n, |P(A)|=2n Or: |P(A)|=2|A|

Cartesian Product (Cross Product) Create a new set consisting of all possible ordered pairs with the first element taking from A, and second element taking from B.

Ordered Pair Its just like what you learned about when you learned about graphing: It’s different from set ! {1,2}={2,1} x, and y can be numbers, names, anything you can imagine y (1,2) (2,1) x

Example of Cartesian Product I have two T-shirts: white, black A={white shirt, black shirt} I have three jeans: black, blue, green B={black jean, blue jean, green jean} All outfits I can make out of these ? The set of all ordered-pairs, in the form (T-shirt, jean)…

Cartesian Product Examples

Cardinality of Cartesian Product If A has m elements, B has n elements, how many elements does AxB have ? For every element of A, we pair it with each of the n elements in B,. to get n ordered pairs in AxB So we can form n*m ordered pairs this way So |AxB| = m*n = |A|*|B| This is where the name Cartesian product comes from.

Exercises on Power Set/Cartesian Product P({a,b}) x {c,d} = Is it true that for any set A,

Examples A certain club is forming a recruitment committee consisting of five of its members. They have calculated that there are 8,568 different ways to form such a committee. The club has two members named Jack and Jill. They have calculated that 2,380 of the potential committees have Jack on them, 2,380 have Jill, 1,820 have Jack but not Jill, 1,820 have Jill but not Jack, and 560 have both Jack and Jill. How many committees have either Jack or Jill? How many committees have neither Jack nor Jill? Jack and Jill are car-pooling, so they insist that if either one is on the committee, the other person must also be on the committee. How many committee meet this condition? Jack and Jill have had a fight. Jack says, “if Jill is on the committee, I won’t be.” Jill says,“Likewise.” How many of the committees meet this condition? (Hint, draw a Venn diagram depicting the set of all possible committees as the universal set…)

Summary Basics Venn Diagram Relations on sets: subset, proper subset Specify a set by enumerating all elements Notations Cardinality Venn Diagram Relations on sets: subset, proper subset Set builder notation Set operations