Announcements. CompSci 230 Discrete Math for Computer Science Sets. Introduction to Sets. Sets



Similar documents
Discrete Mathematics

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

INTRODUCTORY SET THEORY

THE LANGUAGE OF SETS AND SET NOTATION

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Basic Concepts of Set Theory, Functions and Relations

Lecture 16 : Relations and Functions DRAFT

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Discrete Maths. Philippa Gardner. These lecture notes are based on previous notes by Iain Phillips.

Mathematics Review for MS Finance Students

Automata and Formal Languages

Lecture Note 1 Set and Probability Theory. MIT Spring 2006 Herman Bennett

Handout #1: Mathematical Reasoning

Math Week in Review #4. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

All of mathematics can be described with sets. This becomes more and

So let us begin our quest to find the holy grail of real analysis.

Set Theory Basic Concepts and Definitions

Fundamentele Informatica II

Logic in Computer Science: Logic Gates

Math 4310 Handout - Quotient Vector Spaces

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Regular Languages and Finite State Machines

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Functions: Piecewise, Even and Odd.

A Little Set Theory (Never Hurt Anybody)

Set Theory. 2.1 Presenting Sets CHAPTER2

No Solution Equations Let s look at the following equation: 2 +3=2 +7

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Cartesian Products and Relations

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Basic Proof Techniques

7 Relations and Functions

Math 3000 Section 003 Intro to Abstract Math Homework 2

Basic Probability Concepts

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability

3. Mathematical Induction

A Course in Discrete Structures. Rafael Pass Wei-Lung Dustin Tseng

CS 3719 (Theory of Computation and Algorithms) Lecture 4

1. Prove that the empty set is a subset of every set.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Check Skills You ll Need. New Vocabulary union intersection disjoint sets. Union of Sets

Sample Induction Proofs

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Computability Theory

Lecture 17 : Equivalence and Order Relations DRAFT

MA651 Topology. Lecture 6. Separation Axioms.

Factorizations: Searching for Factor Strings

Elements of probability theory

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

LEARNING OBJECTIVES FOR THIS CHAPTER

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Mathematical Induction

5.1 Radical Notation and Rational Exponents

Incenter Circumcenter

Math 223 Abstract Algebra Lecture Notes

Math 55: Discrete Mathematics

The Set Data Model CHAPTER What This Chapter Is About

C H A P T E R Regular Expressions regular expression

Book of Proof. Richard Hammack Virginia Commonwealth University

Lecture 1 Introduction Properties of Probability Methods of Enumeration Asrat Temesgen Stockholm University

Georg Cantor and Set Theory

Course Syllabus. MATH 1350-Mathematics for Teachers I. Revision Date: 8/15/2016

1 The Concept of a Mapping

Reading 13 : Finite State Automata and Regular Expressions

Basic Set Theory. 1. Motivation. Fido Sue. Fred Aristotle Bob. LX Semantics I September 11, 2008

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Binary Adders: Half Adders and Full Adders

Section 1.1 Real Numbers

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

Answer Key for California State Standards: Algebra I

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Summary. Operations on Fuzzy Sets. Zadeh s Definitions. Zadeh s Operations T-Norms S-Norms. Properties of Fuzzy Sets Fuzzy Measures

E3: PROBABILITY AND STATISTICS lecture notes

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

This chapter is all about cardinality of sets. At first this looks like a

3. SETS, FUNCTIONS & RELATIONS

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Set operations and Venn Diagrams. COPYRIGHT 2006 by LAVON B. PAGE

Lecture 13 - Basic Number Theory.

Probability: Terminology and Examples Class 2, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

6.080/6.089 GITCS Feb 12, Lecture 3

CONTENTS 1. Peter Kahn. Spring 2007

Linear Algebra I. Ronald van Luijk, 2012

6.3 Conditional Probability and Independence

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

SOLUTIONS TO ASSIGNMENT 1 MATH 576

Properties of Real Numbers

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

6.4 Normal Distribution

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

How To Understand The Difference Between Economic Theory And Set Theory

You know from calculus that functions play a fundamental role in mathematics.

Notes on Complexity Theory Last updated: August, Lecture 1

Regular Languages and Finite Automata

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Applied Liberal Arts Mathematics MAT-105-TE

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

MATH10040 Chapter 2: Prime and relatively prime numbers

Transcription:

CompSci 230 Discrete Math for Computer Science Sets September 12, 2013 Prof. Rodger Slides modified from Rosen 1 nnouncements Read for next time Chap. 2.3-2.6 Homework 2 due Tuesday Recitation 3 on Friday and Monday Microsoft Hackathon Fri 5pm for 24 hours Microsoft will be holding a 24 hour hackathon called CampppHack starting at *5pm on 9/13*. The hackathon will be focused on Windows 8 andwindows Phone, and will begin with crash courses to teach you how to develop apps for each of these platforms. fter 24 hours of apphacking a panel of expert judges will choose the three top apps and award a number of awesome prizes, including an *all-expenses paid trip to Microsoft headquarters* in Redmond, W, Microsoft Surfaces and Phones, and cash. In addition, they ll be giving away SWG to lucky attendees every hour, and dinner, breakfast and lunch will be provided! 2 Introduction to Sets Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting. Programming languages have set operations. Set theory is an important branch of mathematics. Many different systems of axioms have been used to develop set theory. Here we are not concerned with a formal set of axioms for set theory. Instead, we will use what is called naïve set theory. 3 Sets set is an unordered collection of objects. the students in this class the attendees at a Duke Football Game The objects in a set are called the elements, or members of the set. set is said to contain its elements. The notation denotes that is an element of the set. If is not a member of, write 4

Sets Programming Class (PC) vs. Discrete Math Class (DM) D.M. formal notation, proofs P. C. - implementation Describing a Set: Roster Method Order not important Each distinct object is either a member or not; listing more than once does not change the set. 5 6 Roster Method Set of all vowels in the English alphabet: Set of all odd positive integers less than : Set of all positive integers less than : Some Important Sets = natural numbers = = integers = = positive integers = = set of real numbers = set of positive real numbers = set of complex numbers. Q = set of rational numbers 7 8

Set-Builder Notation Specify the property or properties that all members must satisfy: x x x x x x x predicate may be used: x x Example: x x Positive rational numbers: x R x Interval Notation closed interval [a,b] open interval (a,b) 9 10 niversal Set and Empty Set The universal set is the set containing everything currently under consideration. Sometimes implicit Sometimes explicitly stated. Contents depend on the context. The empty set is the set with no elements. Symbolized {} also used. V Venn Diagram a e i o u John Venn (1834-1923) Cambridge, K 11 Russell s Paradox Let S be the set of all sets which are not members of themselves. paradox results from trying to answer the question Is S a member of itself? Related Paradox: Henry is a barber who shaves all people who do not shave themselves. paradox results from trying to answer the question Does Henry shave himself? Bertrand Russell (1872-1970) Cambridge, K Nobel Prize Winner 12

Some things to remember Sets can be elements of sets. How many elements? re these the same? Set Equality Definition: Two sets are equal if and only if they have the same elements. Therefore if and B are sets, then and B are equal if and only if. We write = B if and B are equal sets. re these sets equal? Equal! Equal! Not equal! 13 14 Subsets Definition: The set is a subset of B, if and only if every element of is also an element of B. The notation true. Is for any set S? Because a is always false, S,for every set S Is for any set S? Because a S a S, S S, for every set S. is Showing a Set is or is not a Subset of nother Set Showing that is a Subset of B: To show that B, show that if x belongs to, then x also belongs to B. Showing that is not a Subset of B: To show that is not a subset of B, B, find an element x with x B. (Such an x is a counterexample to the claim that x implies x B.) Examples: 1. Is the set of all computer science majors at Duke a subset of all students at Duke? 2. Is the set of integers with squares less than 100 a subset of the set of nonnegative integers? 3. Is the set of Duke fans a subset of all students at Duke? 15 16

nother look at Equality of Sets Recall that two sets and B are equal, denoted by = B, iff sing logical equivalences we have that = B iff Proper Subsets Definition: If B, but B, then we say is a proper subset of B, denoted by B B, then This is equivalent to B and B 17 Venn Diagram B 18 Set Cardinality Definition: If there are exactly n distinct elements in S where n is a nonnegative integer, we say that S is finite. Otherwise it is infinite. Definition: The cardinality of a finite set, denoted by, is the number of (distinct) elements of. Examples: 1. ø = 2. Let S be the letters of the English alphabet. Then S = 3. { } = 4. {ø} = 5. The set of integers is infinite. 19 Power Sets Definition: The set of all subsets of a set, denoted P(), is called the power set of. Example: If = {a,b} then P() = {ø, {a},{b},{a,b}} What is the size of P({4, 6, 9, 12, 15})? If a set has n elements, then the cardinality of the power set is ⁿ. (In Chapters 5 and 6, we will discuss different ways to show this.) 20

Tuples The ordered n-tuple 1 2 n is the ordered collection that has 1 as its first element and 2 as its second element and so on until n as its last element. Two n-tuples are equal if and only if their corresponding elements are equal. 2-tuples are called ordered pairs. The ordered pairs ( ) and ( ) are equal if and only if and. 21 Cartesian Product Definition: The Cartesian Product of two sets and B, denoted by B is the set of ordered pairs (a,b) where a and b B. Example: = {a,b} B = {1,2,3} B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)} Definition: subset R of the Cartesian product B is called a relation from the set to the set B. (Relations will be covered in depth in Chapter 9. ) René Descartes 1596 1650 22 Cartesian Product Definition: The cartesian products of the sets 1 2 n, denoted by 1 2 n is the set of ordered n-tuples ( 1 2 n ) where i belongs to i for i =,. Truth Sets of Quantifiers Given a predicate P and a domain D, we define the truth set of P to be the set of elements in D for which P(x) is true. The truth set of P(x) is denoted by Example: What is B C where = {0,1}, B = {1,2} and C = {0,1,2} Size is? Solution: B C= {(0,1,0), (0,1,1), (0,1,2),(0,2,0), (0,2,1), (0,2,2),(1,1,0), (1,1,1), (1,1,2), (1,2,0), (1,2,1), (1,1,2)} 23 Example: The truth set of P(x) where the domain is the integers and P(x) is x = is the set 24

Boolean lgebra Propositional calculus and set theory are both instances of an algebraic system called a Boolean lgebra. The operators in set theory are analogous to the corresponding operator in propositional calculus. s always there must be a universal set. ll sets are assumed to be subsets of. Boolean algebra is fundamental to the development of Computer Science and digital logic! nion Definition: Let and B be sets. The union of the sets and B, denoted by B, is the set: Example: What is {? Solution: { Venn Diagram for B B 25 26 Intersection Definition: The intersection of sets and B, denoted by B, is Note if the intersection is empty, then and B are said to be disjoint. Example: What is? Example:What is? Venn Diagram for B Complement Definition: If is a set, then the complement of (with respect to ), denoted by Ā is the set Ā x x (The complement of is sometimes denoted by c.) Example: If is the positive integers less than 100, what is the complement of x x x x B 27 Venn Diagram for Complement Ā 28

Difference Definition: Let and B be sets. The difference of and B, denoted by B, is the set containing the elements of that are not in B. The difference of and B is also called the complement of B with respect to. B x x x B B The Cardinality of the nion of Two Sets B Venn Diagram for B 29 30 Review Questions Example: = {0,1,2,3,4,5,6,7,8,9,10} = {1,2,3,4,5}, B ={4,5,6,7,8} 1. B Solution: {1,2,3,4,5,6,7,8} 2. B Solution: {4,5} 3. Ā Solution: {0,6,7,8,9,10} 4. Solution: {0,1,2,3,9,10} 5. B Solution: {1,2,3} 6. B Solution: {6,7,8} 31 Symmetric Difference Definition: The symmetric difference of and B, denoted by is the set Example: What is: Solution B B Venn Diagram 32

Set Identities Set Identities Identity laws Commutative laws Domination laws ssociative laws Idempotent laws Complementation law Distributive laws Continued on next slide 33 Continued on next slide 34 De Morgan s laws bsorption laws Complement laws Set Identities 35 Proving Set Identities Different ways to prove set identities: 1. Prove that each set (side of the identity) is a subset of the other. 2. se set builder notation and propositional logic. 3. Membership Tables: Verify that elements in the same combination of sets always either belong or do not belong to the same side of the identity. se to indicate it is in the set and a to indicate that it is not. 36

Proof of Second De Morgan Law Example: Prove that Solution: We prove this identity by showing that: Proof of Second De Morgan Law These steps show that: 1) and 2) Continued on next slide 37 Continued on next slide 38 Proof of Second De Morgan Law These steps show that: Set-Builder Notation: Second De Morgan Law 39 40

Exampl e: Solutio n: Membership Table Construct a membership table to show that the distributive law holds. B C 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 41 Generalized nions and Intersections Let 1, 2,, n be an indexed collection of sets. We define: These are well defined, since union and intersection are associative. For i =,,, let i = {i, i +, i +,.}. Then, 42 Problems Can you conclude that =B, if, B, and C are sets such that? Cannot conclude they could be different subsets? Cannot conclude C could be empty set 43 Problems Can you conclude that =B, if, B and C are sets such that and? Yes! By symmetry, Show Suppose, then 2 cases If, then thus If, then thus Thus, by symmetry, thus 44

Problems Can you conclude that =B, if, B and C are sets such that and? Yes! By symmetry, Show Suppose, then 2 cases If, then thus If, then thus Thus, by symmetry, thus 45