Lecture 2 Introduction To Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.

Slides:



Advertisements
Similar presentations
Learning Objectives for Section 7.2 Sets
Advertisements

Sets and its element A set is a collection of well-defined and well-distinguished objects. The objects that make up a set are called the members or elements.
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
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.
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)
Chapter 2 The Basic Concepts of Set Theory
Sets 1.
Sets 1.
Chapter 2 The Basic Concepts of Set Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Lecture 3 Operations on Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
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.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
CSCI 1900 Discrete Structures
Sets.
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,
Lecture 4 Sequences CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Definition and Representation A set is a well-defined collection of objects; The objects are called elements or members of the set; A set can be represented.
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)
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
CompSci 102 Discrete Math for Computer Science
Set Theory Symbols and Terminology Set – A collection of objects.
Slide Section 2-1 Symbols and Terminology. SYMBOLS AND TERMINOLOGY Designating Sets Sets of Numbers and Cardinality Finite and Infinite Sets Equality.
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
ELEMENTARY SET THEORY.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Definition of a Set DM is study of discrete structures. Fundamental discrete structure upon which most of other discrete structures are built is the sets.
Module Code MA1032N: Logic Lecture for Week Autumn.
Set Notation and Description Kinds of Sets Operations on Sets By: Mr. Gerzon B. Mascariñas.
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.
Sets.
1 Chapter Two Basic Concepts of Set Theory –Symbols and Terminology –Venn Diagrams and Subsets.
Discrete Mathematics Lecture # 10. Set Theory  A well defined collection of {distinct} objects is called a set.  The objects are called the elements.
(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.
Unit :1 Set Theory Prof. A.J. SHAKADWIPI. Sets and Subsets A well-defined collection of objects. finite sets, infinite sets, subset A={1,3,5,7,9} B={x|x.
Welcome to Form 4 Mathematics Topic for the day SETS.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Theorem By Derek Mok, Alex Yau, Henry Tsang and Tommy Lee.
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.
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.
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. Outline Set and Set Elements Set Representation Subset, Proper Subset, Set Equality, and Null Set.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set, Combinatorics, Probability & Number Theory
The Basic Concepts of Set Theory
ALGEBRA II H/G - SETS : UNION and INTERSECTION
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
        { } Sets and Venn Diagrams Prime Numbers Even Numbers
The Basic Concepts of Set Theory
2.1 Sets Dr. Halimah Alshehri.
Chapter 2 The Basic Concepts of Set Theory
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.
ALGEBRA I - SETS : UNION and INTERSECTION
Chapter 2 The Basic Concepts of Set Theory
Chapter 7 Logic, Sets, and Counting
ALGEBRA II H/G - SETS : UNION and INTERSECTION
Lecture Sets 2.2 Set Operations.
Introduction A set is a collection of objects.
Presentation transcript:

Lecture 2 Introduction To Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine

CSCI 1900 Lecture Lecture Introduction Reading –Rosen - Section 2.1 Set Definition and Notation Set Description and Membership Power Set and Universal Set Venn Diagrams

CSCI 1900 Lecture Set Definition Set: any well-defined collection of objects –The objects are called set members or elements –Well-defined - membership can be verified with a Yes/No answer Three ways to describe a set –Describe in English S is a set containing the letters a through k, inclusively –Roster method - enumerate using { } ‘Curly Braces’ S = {a, b, c, d, e, f, g, h, i, j, k} –Set builder method ; Specify common properties of the members S = { x | x is a lower case letter between a and k, inclusively}

CSCI 1900 Lecture Set Description Examples Star Wars films S = {car, cat, C ++, Java} {a,e,i,o,u,y} The 8 bit ASCII character set Good SciFi Films S = { 1, car, cat, 2.03, …} a,e,i,o,u & sometimes y The capital letters of the alphabet GoodNot So Good

CSCI 1900 Lecture Finite Set Examples Coins –C = {Penney, Nickel, Dime, Quarter, Fifty ‑ Cent, Dollar} Data types –D = {Text, Integer, Real Number} A special set is the empty set, denoted by –Ø –{ }

CSCI 1900 Lecture Infinite Set Examples The set of all integers Z –Z = { …, -3, - 2, -1, 0, 1, 2, 3, …} The set of positive Integers Z + (Counting numbers) – Z + = { 1, 2, 3, …} The set of whole numbers W – W = { 0, 1, 2, 3, …} The Real Numbers R –Any decimal number The Rational Numbers Q –Any number that can be written as a ratio of two integers Example of a number that is in R but not in Q ?

CSCI 1900 Lecture Additional Set Description The set of even numbers E –E is the set containing … -8, -6, -4, -2, 0, 2, 4, 6, 8, … –E = any x that is 2 * some integer –E = Set of all x | x = 2*y where y is an integer –E ={ x | x = 2*y where y is an integer } –E = { x | x = 2*y where y is in Z } –E = { x | x = 2*y where y  Z }

CSCI 1900 Lecture Set Membership x is an element of A is written x  A –Means that the object x is in the set A x is not an element of A is written x  A Given: S={1, -5, 9} and Z + the positive Integers – 1  S 1  Z + – -5  S -5  Z + – 2  S 2  Z +

CSCI 1900 Lecture Set Ordering and Duplicates Order of elements does not matter –{1, 6, 9} = {1, 9, 6} = {6, 9, 1} Repeated elements do not matter –{1, 1, 1, 1, 2, 3} = {1, 2, 3} = {1, 2, 2, 3}

CSCI 1900 Lecture Set Equality Two sets are equal if and only if they have the same elements –S1 = {1, 6, 9} –S2 = {1, 9, 6} –S3 = {1, 6, 9, 6} S1 = S2 - same elements just reordered S2 = S3 - remember duplicates do not change the set Since S1= S2 and S2 = S3 then S1=S3

CSCI 1900 Lecture Subsets A is a subset of B, if and only if every element of set A is an element of set B –Denoted A  B Examples –{Kirk, Spock}  {Kirk, Spock, Uhura} –{Kirk, Spock}  {Kirk, Spock} For any set S, S  S is always true –{Kirk, Sulu}  {Kirk, Spock, Uhura}

CSCI 1900 Lecture Proper Subsets If every element of set A is an element of set B, AND A≠B then A is a proper subset of B, denoted A  B Examples –{1,2}  {1,2,3} –{2}  {1,2,3} –{3,3,3,1}  {1,2,3} –{1,2,3}  {1,2,3} But {1,2,3}  {1,2,3} –{2,3,1}  {1,2,3} But {2,3,1}  {1,2,3}

CSCI 1900 Lecture Membership and Subset Exercise Given: D = { 1, 2, {1}, {1,3}} Is 1  D ? Is 3  D ? Is 1  D? Is {1}  D ? Is {2}  D ? Is {1}  D? Is {1}  D? Is {3}  D? Is { {1} }  D ? Is { {1,2} }  D ?

CSCI 1900 Lecture Subsets and Equality Given: Two sets A and B –If you know that A  B and B  A then you can conclude that A = B –If A  B then it must be true that B  A

CSCI 1900 Lecture Power Set The power set P of a set S is a set containing every possible unique subset of S –Written as P(S) P(S) always includes – S itself –The empty set 

CSCI 1900 Lecture Power Set Example

CSCI 1900 Lecture Set Size The cardinality of set S, denoted |S|, is the number distinct elements of S. –if S = {1,3,4,1}, then |S|=3 –|{1,3,3,4,4,1}| = 3 –|{2, 3, {2}, 5} | = 4 –|{ 2, 3, {2,3}, 5, { 2,{2,5} } }| = 5 –|Z | = ∞ –|Ø| = 0 A set is finite if it contains exactly n elements –Otherwise the set is infinite

CSCI 1900 Lecture Universal Set There is no largest set containing everything We will use a (different) Universal Set, U, for each discussion – It is the set of all possible elements of the type we want to discuss, for each particular problem For an example involving even and odd integers we might say U = Z

CSCI 1900 Lecture Venn Diagrams –A graphic way to show sets and subsets, developed by John Venn in the 1880’s –A set is shown as a Circle or Ellipse, and the Universal set as a rectangle or square –This shows that S1  Z, and if x  S1 then x  Z U = Z S1 = Integers divisible by 2

CSCI 1900 Lecture Venn Diagrams: Subsets U = Z S1 = Integers divisible by 2 This shows that S1  Z and S2  Z and S2  S1 If x  S2 then x  S1, if x  S1 then x  Z, if x  S2 then x  Z S2 = Integers divisible by 4

CSCI 1900 Lecture Venn Diagrams: Subsets 2 U = Z S1 = Integers divisible by 2 S3 = Integers divisible by 5,, This shows that S1  Z and S3  Z, if x  S1 then x  Z, if x  S3 then x  Z, and there exists at least one element y such that y  Z and y  S1 and y  S3

CSCI 1900 Lecture Venn Diagram Exercise Draw a Venn Diagram representation for the following example: –U = { x | x  W and x < 10 } –A= {1, 3, 5, 7, 9} –B = { 1, 5, 7} –C = {1, 5, 7, 8}

CSCI 1900 Lecture Key Concepts Summary Definition of a set Ways of describing a set Power sets and the Universal set Set Cardinality Draw and interpret Venn Diagrams