Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.

Slides:



Advertisements
Similar presentations
Introduction to Set Theory
Advertisements

Discrete Mathematics I Lectures Chapter 6
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
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.
Denoting the beginning
1 Section 1.7 Set Operations. 2 Union The union of 2 sets A and B is the set containing elements found either in A, or in B, or in both The denotation.
Analytical Methods in CS (CIS 505)
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.
EE1J2 – Discrete Maths Lecture 7
Chapter 2 The Basic Concepts of Set Theory
Sets 1.
Sets 1.
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.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Mathematics.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
Chapter 3 – Set Theory  .
Mt263f-11 Discrete Structures Li Tak Sing( 李德成 ) Room A
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Construction Techniques (1) - 1ICOM 4075 (Fall, 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez 2005.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
Set Theory Dr. Ahmed Elmoasry. Contents Ch I: Experiments, Models, and Probabilities. Ch II: Discrete Random Variables Ch III: Discrete Random Variables.
Week 11 What is Probability? Quantification of uncertainty. Mathematical model for things that occur randomly. Random – not haphazard, don’t know what.
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
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
CompSci 102 Discrete Math for Computer Science
Copyright © Cengage Learning. All rights reserved.
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.
ELEMENTARY SET THEORY.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
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 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.
ITD1111 Discrete Mathematics & Statistics STDTLP
Discrete Mathematics Set.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
Functions (2) - 1ICOM 4075 (Spring, 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez ICOM 4075: Foundations.
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.
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
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.
Dr. Ameria Eldosoky Discrete mathematics
Set Definition: A set is unordered collection of objects.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
CSNB 143 Discrete Mathematical Structures
Lecture 04 Set Theory Profs. Koike and Yukita
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
What is Probability? Quantification of uncertainty.
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.
CS100: Discrete structures
Set Operations Section 2.2.
        { } Sets and Venn Diagrams Prime Numbers Even Numbers
Algebra 1 Section 1.1.
CHAPTER 1 - Sets and Intervals
CHAPTER 1 - Sets and Intervals
The aim of education is to teach students how to think rather than what to think. Sets The set is the fundamental discrete structure on which all other.
Chapter 7 Logic, Sets, and Counting
ICOM 5016 – Introduction to Database Systems
Presentation transcript:

Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring 2010 ICOM 4075: Foundations of Computing Lecture 2: Elementary Notions and Notations (2) Lecture Notes Originally Written By Prof. Yi Qian

Notions & Notations (2) - 2ICOM 4075 (Spring 2010) UPRM Homework 1 (due Tuesday, Feb 9, 2010 ) Section 1.1: (pp.12-13) b., d a., b. 8. b., c., d. Random Problems will be graded

Notions & Notations (2) - 3ICOM 4075 (Spring 2010) UPRM Reading Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 2 nd edition, Chapter 1. Section 1.2

Notions & Notations (2) - 4ICOM 4075 (Spring 2010) UPRM Sets A set is a collection of things called elements, members, or objects. –If S is a set and x is an element in S, then we writex S –If x is not an element of S, then we write x S –If x S and y S, we then write x, y S

Notions & Notations (2) - 5ICOM 4075 (Spring 2010) UPRM Describing Sets One way to define a set is to explicitly name its elements: –e.g., S = {x, y, z} Sets can have other sets as elements –e.g., A = {x, {x, y}} has two elements. One element is x, and the other element is {x, y}. So we can write x A and {x, y} A. An important characteristic of sets is that there are no repeated occurrences of elements. –e.g., {x, y, y, z} is not a set since there are two occurrences of the letter y. We can write {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 11} as {1, 2, … 11}, or {1, 2, 3, …, 10, 11}, or … The set with no elements is called the empty set (or null set). The empty set is denoted by { } or A set with one element is called a singleton. e.g., {a} and {c} are singletons.

Notions & Notations (2) - 6ICOM 4075 (Spring 2010) UPRM Equality of Sets Two sets are equal if they have the same elements. We denote the fact that two sets A and B are equal by writing A = B. –{u, g, h} = {h, u, g} If the sets A and B are not equal, we write A ≠ B. –e.g., {a, b, c} ≠ {a, b} –e.g., {a} ≠ Two Characteristics of Sets: 1.There are no repeated occurrences of elements. 2.There is no particular order or arrangement of the elements.

Notions & Notations (2) - 7ICOM 4075 (Spring 2010) UPRM Finite and Infinite Sets Natural Numbers and Integers: N = {0, 1, 2, 3, …} Z = {…, -3, -2, -1, 0, 1, 2, 3, …}

Notions & Notations (2) - 8ICOM 4075 (Spring 2010) UPRM Describing Sets by Properties Many sets are hard to describe by listing elements. Instead of listing the elements, we can often describe a property that the elements of the set satisfy. –e.g., the set of rational numbers Q, the set of real numbers R. –e.g., the set of odd integers consists of integers having the form 2k + 1 for some integer k.

Notions & Notations (2) - 9ICOM 4075 (Spring 2010) UPRM Describing Sets by Properties If P is a property, then the set S whose elements have property P is denoted by writing S = {x | x has property P} –e.g., Odd = {…, -5, -3, -1, 1, 3, 5, …} = {x | x is an odd integer} = {x | x = 2k + 1 for some integer k} = {x | x = 2k + 1 for some k Z} –e.g., {1, 2, 3, …, 11} = {x | x N and 1 ≤ x ≤ 11} –We can also write Odd = {2k + 1 | k is an integer} = {2k + 1 | k Z}

Notions & Notations (2) - 10ICOM 4075 (Spring 2010) UPRM Subsets If A and B are sets and every element of A is also an element of B, then we say that A is a subset of B and write A B –e.g., {a, b} {a, b, c} –e.g., {0, 1, 2} N, and N Z –e.g., A A –e.g., A, empty set is a subset of any set A. If A B and there is some element in B that does not occur in A, then A is called a proper subset of B. –e.g., {a, b} is a proper subset of {a, b, c} –e.g., N is a proper subset of Z, and Z is a proper subset of Q, and Q is a proper subset of R. If A is not a subset of B, we write it as A B –e.g., {a, b} {a, c} –e.g., {0, -1, -2} N

Notions & Notations (2) - 11ICOM 4075 (Spring 2010) UPRM The Power Set The collection of all subsets of a set S is called the power set of S, which we denote by power(S). –e.g., if S = {a, b, c}, then the power set of S can be written as follows: power(S) = { Φ, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, S} –e.g., …

Notions & Notations (2) - 12ICOM 4075 (Spring 2010) UPRM Venn Diagrams A Venn diagram consists of one or more closed curves in which the interior of each curve represents a set. –e.g., the Venn diagram in the following represents the fact that A is a proper subset of B and x is an element of B that does not occur in A. A B x Venn diagram of proper subset A B

Notions & Notations (2) - 13ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Equality of Sets A = B means A B and B A Three useful strategies for comparing two sets Statement to ProveProof Strategy A BFor arbitrary x A, show that x B. A BFind an element x A such that x B. A = BShow that A B and show that B A

Notions & Notations (2) - 14ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Subset Proof Example: Show that A B, where A and B are defined as follows: A = {x | x is a prime number and 42 ≤ x ≤ 51}, B = {x | x = 4k + 3 and k N}. Proof:

Notions & Notations (2) - 15ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Subset Proof Example: Show that A B, where A and B are defined as follows: A = {x | x is a prime number and 42 ≤ x ≤ 51}, B = {x | x = 4k + 3 and k N}. Proof: Let x A, then either x = 43 or x = 47. We can write 43 = 4(10) + 3 and 47 = 4(11) + 3. So in either case, x has the form of an element of B. Thus x B. Therefore A B. QED.

Notions & Notations (2) - 16ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Not-Subset Proof Example: Show that A B and B A, where A and B are defined by A = {3k + 1 | k N} and B = {4k + 1 | k N}. Proof:

Notions & Notations (2) - 17ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Not-Subset Proof Example: Show that A B and B A, where A and B are defined by A = {3k + 1 | k N} and B = {4k + 1 | k N}. Proof: By listing a few elements from each set we can write A and B as follows:A = {1, 4, 7, …} and B = {1, 5, 9, …}. Now it’s easy to prove that A B because 4 A and 4 B. We can also prove that B A by observing that 5 B and 5 A. QED.

Notions & Notations (2) - 18ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Equal Set Proof Example: Show that A = B, where A and B are defined as follows: A = {x | x is prime and 12 ≤ x ≤ 18}, B = {x | x = 4k + 1 and k {3, 4}}. Proof:

Notions & Notations (2) - 19ICOM 4075 (Spring 2010) UPRM Proof Strategies with Subsets and Equality Equal Set Proof Example: Show that A = B, where A and B are defined as follows: A = {x | x is prime and 12 ≤ x ≤ 18}, B = {x | x = 4k + 1 and k {3, 4}}. Proof: First we’ll show that A B. Let x A, then either x = 13 or x = 17. We can write 13 = 4(3) + 1 and 17 = 4(4) + 1. It follows that x B. Therefore A B. Next we’ll show that B A. Let x B. It follows that either x = 4(3) + 1 or x = 4(4) + 1. i.e., x = 13 or x = 17. In either case, x is a prime number between 12 and 18. Therefore, B A. So A = B. QED.

Notions & Notations (2) - 20ICOM 4075 (Spring 2010) UPRM Operations of Sets Union of Sets –The union of two sets A and B is the set of all elements that are either in A or in B or in both A and B. The union is defined by A B and we can given the following formal definition. A B = {x | x A or x B}. here the word of “or” in the definition means “either or both”. –e.g., … –Properties of Union a. A = A b.A B = B A( is commutative) c.A (B C) = (A B) C( is associative) d. A A = A e.A B if and only if A B = B A B Venn diagram of A B

Notions & Notations (2) - 21ICOM 4075 (Spring 2010) UPRM Operations of Sets Intersection of Sets –The intersection of two sets A and B is the set of all elements that are both in A and B. The intersection is defined by A B and we can given the following formal definition. A B = {x | x A and x B}. –e.g., … –Properties of Intersection a. A = b.A B = B A( is commutative) c.A (B C) = (A B) C( is associative) d. A A = A e.A B if and only if A B = A …… … ……….. ………. …… Venn diagram of A B AB

Notions & Notations (2) - 22ICOM 4075 (Spring 2010) UPRM Operations of Sets Differences of Sets –If A and B are sets, then difference A – B (also called the relative complement of B in A) is the set of elements in A that are not in B, which we can describe as a difference of sets. A – B = {x | x A and x B} –A natural extension of the difference A – B is the symmetric difference of sets A and B, which is the union of A – B and B – A and is denoted by A B. A B = {x | x A or x B but not both} A B = (A B) – (A B) (A B) C = A (B C) A B Venn diagram of A - B ………..…. …………… …………... ……..… ……….…. …………… …………....……..…. AB Venn diagram of A B

Notions & Notations (2) - 23ICOM 4075 (Spring 2010) UPRM Operations of Sets Complement of a Set –If the discussion always refers to sets that are subsets of a particular set U, then U is called the universe of discourse, the difference U – A is called the complement of A, which we denote by A’. The Venn diagram pictures the universe U as a rectangle, with two subsets A and B, where the shaded region represents the complement (A B)’. U AB Venn diagram of (A B)’

Notions & Notations (2) - 24ICOM 4075 (Spring 2010) UPRM Operations of Sets Combining Set Operations –Combining Properties of Union and Intersection a.A (B C) = (A B) (A C)( distributes over ) b.A (B C) = (A B) (A C)( distributes over ) c.A (A B) = A(absorption law) d.A (A B) = A(absorption law)

Notions & Notations (2) - 25ICOM 4075 (Spring 2010) UPRM Operations of Sets –Properties of Complement a.(A’)’ = A b. ’ = U and U’ = c.A A’ = and A A’ = U d.A B if and only if B’ A’ e.(A B)’ = A’ B’(De Morgan’s law) f.(A B)’ = A’ B’(De Morgan’s law) g.A (A’ B) = A B(absorption law) h.A (A’ B) = A B(absorption law)

Notions & Notations (2) - 26ICOM 4075 (Spring 2010) UPRM Operations of Sets The union operation can be defined for an arbitrary collection of sets in a natural way. –e.g., the union of the n sets A 1, …, A n can be denoted in the following way –e.g., the union of the infinite collection of sets A 1, A 2, …, A n, … can be denoted in the following way –If I is a set of indices and A i is a set for each i I, then the union of the sets in the collection can be denoted in the following way The intersection operation can be defined for an arbitrary collection of sets in a natural way. –e.g., the intersection of the n sets A 1, …, A n can be denoted in the following way –e.g., the intersection of the infinite collection of sets A 1, A 2, …, A n, … can be denoted in the following way –If I is a set of indices and A i is a set for each i I, then the intersection of the sets in the collection can be denoted in the following way

Notions & Notations (2) - 27ICOM 4075 (Spring 2010) UPRM Counting Finite Sets Definition: The size of a set S is called its cardinality, which denoted by |S|. –e.g., if S = {w, x, y, z}, then |S| = |{w, x, y, z}| = 4. We say “the cardinality of S is 4”, or “4 is the cardinal number of S”, or simply “S has 4 elements”. Counting by Inclusion and Exclusion Union Rule |A B| = |A| + |B| - |A B| |A B C| = |A| + |B| + |C| - |A B| - |B C| - |C A| + |A B C| The popular name for the union rule and its extensions to three or more sets is the principle of inclusion and exclusion.

Notions & Notations (2) - 28ICOM 4075 (Spring 2010) UPRM Example: A Building Project Example: Suppose A, B, C are sets of tools needed by three workers on a job. For convenience let’s call the workers A, B, and C. Suppose further that the workers share some tools (for example, on a housing project, all three workers might share a single table saw). Suppose that A uses 8 tools, B uses 10 tools, and C uses 5 tools. Suppose further that A and B share 3 tools, A and C share 2 tools, and B and C share 2 tools. Finally, suppose that A, B, and C share the use of 2 tools. How many distinct tools are necessary to do the job?

Notions & Notations (2) - 29ICOM 4075 (Spring 2010) UPRM Example: A Building Project Example: Suppose A, B, C are sets of tools needed by three workers on a job. For convenience let’s call the workers A, B, and C. Suppose further that the workers share some tools (for example, on a housing project, all three workers might share a single table saw). Suppose that A uses 8 tools, B uses 10 tools, and C uses 5 tools. Suppose further that A and B share 3 tools, A and C share 2 tools, and B and C share 2 tools. Finally, suppose that A, B, and C share the use of 2 tools. How many distinct tools are necessary to do the job? Solutions: We want to find the value |A B C| |A B C| = |A| + |B| + |C| - |A B| - |B C| - |C A| + |A B C| = – 3 – 2 – = 18 tools

Notions & Notations (2) - 30ICOM 4075 (Spring 2010) UPRM Counting Finite Sets Counting the Differences of Two Sets Difference Rule|A – B| = |A| - |A B| It’s easy to discover this rule by drawing a Venn diagram.

Notions & Notations (2) - 31ICOM 4075 (Spring 2010) UPRM Bags Bags (Multisets) –A bag (or multiset) is a collection of objects that may contain repeated occurrences of elements. Two Characteristics of Bags –1. There may be repeated occurrences of elements. –2. There is no particular order or arrangement of the elements To differentiate bags from sets, we use brackets to enclose the elements. –e.g., [a, b, a, e, u] is a bag with five elements. Two bags A and B are equal if the number of occurrences of each elements in A or B is the same in either bag. –e.g., [a, b, a, e, g] = [a, a, g, b, e], but [a, a, b, d] ≠ [a, b, d]

Notions & Notations (2) - 32ICOM 4075 (Spring 2010) UPRM subbag Define A to be a subbag of B, and write A B, if the number of occurrences of each element x in A is less than or equal to the number of occurrences of x in B. –e.g., [a, b] [a, b, a], but [a, b, a] [a, b] Two bags A and B are equal if and only if A is a subbag of B and B is a subbag of A. Define the sum of two bags A and B, denoted by A + B, as: If x occurs m times in A and n times in B, then x occurs m + n times in A + B. –e.g., [2, 2, 3] + [2, 3, 3, 4] = [2, 2, 2, 3, 3, 3, 4] Define union and intersection for bags: Let m and n be the number of times x occurs in bags A and B, respectively. Put the larger of m and n occurrences of x in A B. Put the smaller of m and n occurrences of x in A B. –e.g., [2, 2, 3] [2, 3, 3, 4] = [2, 2, 3, 3, 4], and [2, 2, 3] [2, 3, 3, 4] = [2, 3]