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:

Slides:



Advertisements
Similar presentations
Introduction to Set Theory
Advertisements

Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
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.
Sets DISCRETE STRUCTURE ABDUL BASIT TAHIR, KAMRAN ALI, FAIZAN ILLAHI, NOMAN AHMAD, ARSALAN MUBASHIR.
Denoting the beginning
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
SET.   A set is a collection of elements.   Sets are usually denoted by capital letters A, B, Ω, etc.   Elements are usually denoted by lower case.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
1 Discussion #21 Discussion #21 Sets & Set Operations; Tuples & Relations.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Set Theory. What is a set?  Sets are used to define the concepts of relations and functions. The study of geometry, sequences, probability, etc. requires.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Chapter 3 – Set Theory  .
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 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.
Language: Set of Strings
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
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
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.
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
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.
(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.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Discrete Mathematics Set.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
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.
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.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
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
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.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
The Language of Sets If S is a set, then
Discrete Mathematical The Set Theory
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Chapter 5, Set Theory 1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Operations Section 2.2.
Session – 2 SETS & Operations of SETS
Discrete Mathematics CS 2610
MCS680: Foundations Of Computer Science
Lecture Sets 2.2 Set Operations.
Sets & Set Operations.
Presentation transcript:

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: people, plants, numbers, functions, and even other sets. Using sets, nearly any mathematical concept can be derived

Describing Sets There are many accepted ways to describe sets. Intensional Definition: A is the set of all integers Extension: using braces – C = {red, blue, green} Use “…” as a shorthand – D = {1,2,3,…,1000} Set-Builder notation: using a formula F = {n^2: n is an integer; and 0 ≤ n ≤ 19} This is the set of the first 20 squared integers The “:” means “Such That” This form can be expanded by indicating the set of all elements with a given property

Membership The key relation between sets is membership If set X is a member of set Y, then all of the elements of X are also in Y This is loosely denoted X Y, where X is a subset of Y If element a is a member of set Y, we say a Y

Subsets Do not be mislead, there is a proper way to denote subsets If X is a subset of Y, we say . The second notation is read Y is the superset of X, meaning that Y contains X If we know that X is a subset of Y, but X does not equal Y, then X is a proper subset of Y, denoted

Set Equality A useful way to define the equality of sets is to say , meaning X and Y are subsets of each other (their elements are equal) Because a set is a collection of distinct objects, the order of elements and the frequency of the same element are meaningless {11,7} = {7,11} = {11,7,11,11,7}

Special Kinds of Sets A null set (Ф)is defined as a set that is negligible in some sense For example, if an object’s length is to be measured, the value 0 would be negligible, meaning that if an object has a length of 0, it has no length at all An empty set is always a null set, in every situation In general, if the value of the elements of a set can be disregarded, the set is a null set Consider a set used to represent integers. If only integers matter, then {a,b,c} is a null set A universal set (U) is the set that contains all meaningful objects, including itself This set is very controversial, and in many cases is said not to exist It is basically the opposite of the null set

Basic Set Operations The two most common set operations are Union and Intersection The Union of a collection of sets is a derived set containing all of the elements in either of the sets The Intersection of a collection of sets is a derived set containing all of the elements in each of the sets For example, the union of the sets {1,2,3} and {3,4,5} is the set {1,2,3,4,5} and the intersection is the set {3}

Properties of Sets The following are useful properties of sets and set operations Inclusion of Intersection: Inclusion of Union: Transitivity: Commutative Laws: Associative Laws: Distributive Laws:

Set Partitions Partitions of a set are subsets which do not share any elements These sets are said to be disjoint, meaning the intersection of any two partitions is the null set Partitions are very useful in computer science. A hard drive can partitioned into multiple drives, enabling certain information to be stored on one partition and other information on another partition

Difference and Complement The difference of two sets (B-A) is the set of all elements x in U such that x is in B but not in A The complement of a set is the set of all elements that are not in the original set

More Set Properties If an element is in a set’s complement, it is not in the original set Identity Laws: Complement Laws: Double Complement Law: Idempotent Laws: Universal Bound Laws: DeMorgan’s Laws: Absorption Laws: Special Set Complements: Set Difference Law:

Visual Aids Set operations can be represented by visual aids like Venn Diagrams Given sets A={1,2} and B={2,3} and outside value (4) “A union B” is “A intersect B” is “A complement” is “A – B” is “Complement (A union B)” is “Complement (A intersect B)” is Any set operation can be represented by a visual aid, regardless of complexity. This is useful in proofs!

Power Sets The power set of set A is the set of all subsets of A Consider the set {1,2} The power set of {1,2} contains all subsets, so the null set and the original set itself are also elements This is denoted It has been proven (through induction) that a set of n elements has exactly subsets

Tuples A set, such as {1,2} is equal to all other sets that contain only the elements {1,2} in any order and frequency, such as {1,2,1,1} The opposite is true of an ordered tuple The ordered tuple (x[1], x[2],…,x[n]) is equal to the ordered tuple (y[1], y[2],…,y[n]) iff “x[1] = y[1], x[2] = y[2], …,x[n] = y[n]” Each element must equal its partner – (a,b) = (c,d) iff “a = c and b = d” An ordered 2-tuple is denoted ((x[1],y[1]),…,(x[n],y[n])) and is called an ordered pair. A 3-tuple is an ordered triple

Cross Products (a.k.a. Cartesian Products) The cross product of A and B (AxB) is the set of all ordered pairs (a,b) where a is in A and b is in B The cross product of {1,2,3} and {a,b} is {(1,a), (2,a), (3,a), (1,b), (2,b), (3,b)} The cross product of n number of sets is a set of ordered tuples, with each tuple containing n elements

Procedural Definitions In order to use these concepts in CS, you must be able to use their definitions to generate procedures Union: if element x is in “A union B”, it must be in A or B If x is in “A intersect B”, it must be in A and B If x is in “A difference B”, it must be in A and can’t be in B If x is in “A complement”, it cannot be in A If (x,y) is in “A cross B”, x must be in A and y must be in B If A is a subset of B, every element a that is in A must be in B If set A and B are equal, A must be a subset of B and B must be a subset of A From these procedures, set identities and laws can be constructed in your code. Try extending set theory definitions to more than two sets. Happy coding!

Subset Algorithm This common algorithm is used to prove subset relations Use this algorithm to help define other algorithms. Remember: reusing code is a good thing