Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.

Slides:



Advertisements
Similar presentations
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Advertisements

Lecture 2 Introduction To Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Prof. Johnnie Baker Module Basic Structures: Sets
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
CS 173: Discrete Mathematical Structures Cinda Heeren Rm 2213 Siebel Center Office Hours: M 12:30-2:30p.
Instructor: Hayk Melikya
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
2.1 Sets. DEFINITION 1 A set is an unordered collection of objects. DEFINITION 2 The objects in a set are called the elements, or members, of the set.
Sets DISCRETE STRUCTURE ABDUL BASIT TAHIR, KAMRAN ALI, FAIZAN ILLAHI, NOMAN AHMAD, ARSALAN MUBASHIR.
Analytical Methods in CS (CIS 505)
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/10/11 Ming-Hsuan Yang UC Merced 1.
Sets 1.
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
Sets.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
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
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
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,
1 Section 1.6 Sets. 2 Set Fundamental discrete structure on which all other discrete structures are built Can be loosely defined as a collection of elements.
CompSci 102 Discrete Math for Computer Science
Copyright © Cengage Learning. All rights reserved.
Lecture 4: Predicates and Quantifiers; Sets.
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
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.
ELEMENTARY SET THEORY.
Sets Goal: Introduce the basic terminology of set theory.
Lecture 2.1: Sets and Set Operations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
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.
Basic Structures: Sets, Functions, Sequences, and Sums.
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.
1 Chapter Two Basic Concepts of Set Theory –Symbols and Terminology –Venn Diagrams and Subsets.
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.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Section 2.1. Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 1 The Foundations: Logic, Sets,
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)
CPCS 222 Discrete Structures I
CSE15 Discrete Mathematics 02/13/17
Sets.
Chapter 2 Sets and Functions.
Set Definition: A set is unordered collection of objects.
Discrete Mathematical The Set Theory
The Basic Concepts of Set Theory
Sets Section 2.1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CS100: Discrete structures
The Basic Concepts of Set Theory
2.1 Sets Dr. Halimah Alshehri.
Chapter 2 The Basic Concepts of Set Theory
Applied Discrete Mathematics Week 2: Proofs
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.
Discrete Mathematics CS 2610
Chapter 2 The Basic Concepts of Set Theory
Lecture Sets 2.2 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.
Presentation transcript:

Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built out of sets. We have been using sets on an informal basis when we talked about universes of discourse. We will now define what a set is and start working with sets more formally.

Def: A set is an unordered collection of objects. We use the notation {ob 1, ob 2, … } to denote a set where the ob i are the objects in the set. Ex: {a, -1, Finland, fork} is a set. The objects in this set are the letter a, the integer -1, the country Finland, and the utensil fork. Ex: {1, 2} is a set. The objects in this set the first 2 positive integers. Ex: V = {a, e, i, o, u} is a set. The objects in V are the vowels. Ex: The set of all odd positive integers less than 10 is {1, 3, 5, 7, 9} Ex: The set of all positive integers is Z + = {1, 2, 3,...} Ex: The set of all positive integers less than 100 is {1, 2, …, 99} Def: The objects in a set are called the elements or members of the set. We say that a set contains its elements.

Note that we never attempted to define what an object is. We never placed any restrictions on what can be in a set. So a set could perhaps contain another set. Ex: {1, {2}, 3, {4}} is a set. The objects in this set are the integer 1, the set containing the integer 2, the integer 3, and the set containing 4. Ex: What are the members of the set { {1}, {{1}, {2}} }? The members of this set are the set containing 1, and the set containing the set containing 1 and the set containing 2. That a set is defined in such general terms can cause problems. It leads to various logical paradoxes such as Russell’s Paradox. For this reason, this is called Naïve Set Theory.

Some useful sets The Set of Natural Numbers: N = {0, 1, 2, …} –Note that there is some debate on 0. The Set of Integers: Z = {…, -2, -1, 0, 1, 2, …} The Set of Positive Integers: Z + = {1, 2, 3, …} The Set of Rational Numbers: Q = {p/q | p and q are integers and q  0} The Set of Real Numbers: R

Def: Two sets are equal if and only if they have the same elements. Ex: The sets {1, 3, 5} and {5, 1, 3} are equal since they have the same elements. Due to the definition of equal, it also does not matter if an element is repeated in a set. Ex: The sets {1, 3, 5} and {1, 1, 3, 3, 5, 5, 5} are equal since they have the same elements 1, 3, and 5. So order doesn’t matter and repetition doesn’t matter. An element is a member of a set if it is listed in the set. Ex: The sets {1, 2, 5, 4, 3} and {5, 1, 3, 2, 4} are equal since they have the same elements.

We often specify a set using set builder notation instead of listing the elements in the set. Ex: The set of positive integers less than 10 can be specified as {x  Z | x > 0  x < 10} instead of {1, 2, 3, 4, 5, 6, 7, 8, 9}. We use the symbol  to indicate set membership. If x is a member of the set A, we say x  A. On the other hand, if x is not a member of A, we say x  A. An element x is either a member of a set or not. Ex:5  Z1.6  Z1  {1, 2} 3  {1, 2} 1  {{1, 2}, {3, 4}}{1, 2}  {{1, 2}, {3, 4}} We can use set builder notation to restrict the members of a set. Ex: {x  Z | x > 5} = { 6, 7, 8, 9, …}

Ex: What are the members of {x  Z | x = x + 1}? There are no members! So {x  Z | x = x + 1} = {}. This is called the empty set. We also use the symbol  to denote the empty set. The empty set has no members. We can denote it as {} or . Think of  as just a symbolic abbreviation for {}. {  } does not denote the empty set! What does it denote? {  } is the set containing the empty set. This is very different from the empty set. {  } = {{}}. This set has one member, namely the empty set. The empty set , however, has no members. {  }  

Def: The set A is called a subset of the set B if and only if every element of A is also an element of B. We use the notation A  B to indicate that A is a subset of B. Restated: A  B iff  x( x  A  x  B ) Ex: {1, 3, 5}  {1, 2, 3, 4, 5} since every element in the first set is also a member of the second set. Ex: {6, 2, 4}  {4, 6, 2}. [In fact the two sets are equal.] Ex: N  Z. Note that two sets A and B are equal if and only if A  B and B  A. That is, when every member of A is also a member of B and when every member of B is also a member of A, then A and B have the same members. This is a very important technique that we use to prove that two sets are equal: show A  B and show B  A.

Theorem: For any set S, (I)   Sand(II) S  S Proof: Let S be a set. [State our assumptions.] (proof of (I)) We wish to show that   S. By using the definition of subset, what we must show is that every member of  is also a member of S. That is, we wish to show  x( x    x  S). [How?] [Vacuous Proof] Since  has no members, then x   is always false. So the implication x    x  S is always true no matter what x is. So   S. (proof of (II)) We wish to show that S  S. By using the definition of subset, what we must show is that every member of S is also a member of S. [Direct Proof] So let x  S. Then it follows that x  S! So S  S. 

Def: The set A is called a proper subset of the set B if A  B and A  B. We use the notation A  B to indicate that A is a proper subset of B. Note that this usage (like the usage of N) differs from text to text. Some texts, for historical reasons, use A  B to indicate A is a subset of B and they have not special notation to indicate that A is a proper subset of B. Ex: {1, 3, 5}  {1, 2, 3, 4, 5} since every element in the first set is also a member of the second set but the sets are not equal. Ex: {6, 2, 4}  {4, 6, 2} because these sets are equal. But it is a subset. Ex: N  Z. Of course, if A  B then it follows that A  B as well. But the converse does not hold. Ex: {1, 2}  {1, 2, 3, 4} Ex: {1, 2}  {{1, 2}, {3, 4}}{1, 2}  {{1, 2}, {3, 4}} or {{1, 2}}  {{1, 2}, {3, 4}}

Def: Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer, we say that S is a finite set and that the cardinality of S is n. The cardinality of S is denoted |S|. A set that is not finite is said to be an infinite set. Ex: Let S be the set of odd positive integers less than 10. So S = {1, 3, 5, 7, 9}. S is a finite set with cardinality 5. That is |S| = 5. Ex: Let L be the set of letters in the English alphabet. Then |L| = 26. Ex: |  | = 0. Note that  is the only set with cardinality 0. Ex: The set of integer, Z, is infinite. Ex: The set of real numbers, R, is infinite. Ex: |{  }| = 1. Remember that this is not the empty set! Ex: |{{1, 2, 3}, {4}}| = 2. It contains 2 sets! Ex: |{Z}| = 1. [{Z} = {{1, 2, 3, … }}]. Care with notation is crucial!

Def: Let S be a set. The power set of S is the set of all subsets of S. The power set of S is denoted P(S). That is P(S) = {X | X  S}. Ex: Let S = {1, 2}. Then P(S) = { , {1}, {2}, {1, 2}}. Ex: Let S = {a}. Then P(S) = { , {a}}. Ex: If S = {Joe, John, James}, then P(S) = { , {Joe}, {John}, {James}, {Joe, John}, {Joe, James}, {John, James}, {Joe, John, James}}. Ex: Let S = . Then P(S) = {  }. Ex: Let S be a finite set with cardinality n. Can you guess |P(S)|? Note that due to our previous theorem, it seems that P(S) has at least two elements in it regardless of S. [Which two?] [But this is not quite true] |P(S)| = 2 n. This can be shown in a number of different ways. [bit]

The order of elements in a collection is sometimes important. Recall that sets are unordered collections. If we care about ordered collections we will need to introduce a different discrete structure. For this purpose, we introduce ordered n-tuples. Def: The ordered n-tuple (a 1, a 2, …, a n ) is the ordered collection that has a 1 as its first element, a 2 as its second element, …, and a n as its nth element. Two ordered n-tuples are equal if and only if their first elements are equal, their second elements are equal, …, and their nth elements are equal. Ex: (1, 5, 7) and (2, 5, 7) are two ordered 3-tuples. These ordered 3-tuples are not equal since their first elements differ. Ex: (2, 4) and (4, 2) are two ordered 2-tuples. Ordered 2-tuples are called ordered pairs. These ordered pairs are not equal since their first and second elements differ.

Def: Let A and B be sets. The Cartesian product of A and B, denoted by A  B is the set of all ordered pairs (a, b) where a  A and b  B. That is: A  B = {(a, b) | a  A  b  B}. Ex: What is the Cartesian product of A = {1, 2} and B = {a, b, c}? A  B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)} Def: The Cartesian product of the sets A 1, A 2, …, A n, denoted by A 1  A 2  …  A n, is the set of all ordered n-tuples (a 1, a 2,... a n ), where a i  A i for i = 1, 2, …, n. That is: A 1  A 2  …  A n = {(a 1, a 2,... a n ) | a i  A i for i = 1, 2, …, n}. Ex: The Cartesian product of A = {1, 2}, B = {a, b}, and C = {b, c} is {(1, a, b), (1, a, c), (1, b, b), (1, b, c), (2, a, b), (2, a, c), (2, b, b), (2, b, c)}

Homework problems from Section 1.6 Problems 1, 4, 5, 6, 7, 11, 13, 14, 15, 19, and 22 from section 1.6 are included on homework 4.