EE1J2 – Discrete Maths Lecture 7

Slides:



Advertisements
Similar presentations
Discrete Mathematics I Lectures Chapter 6
Advertisements

Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
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.
EE1J2 – Discrete Maths Lecture 9
Denoting the beginning
Analytical Methods in CS (CIS 505)
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.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Chapter 2 The Basic Concepts of Set Theory © 2008 Pearson Addison-Wesley. All rights reserved.
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 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.
Sets.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
1 Introduction (Pengenalan) n About the Lecturer: –Nama lengkap: Heru Suhartanto, Ph.D –Kantor: Ruang 1214, Gedung A, Fakultas Ilmu Komputer UI, Depok.
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.
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
Chapter 2 Section 1 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Copyright © Cengage Learning. All rights reserved.
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.
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.
Introduction to Set theory. Ways of Describing Sets.
(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.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
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.
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.
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)
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.
Set. Outline Universal Set Venn Diagram Operations on Sets.
Applied Discrete Mathematics Week 1: Logic and Sets
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
The Language of Sets If S is a set, then
Set, Combinatorics, Probability & Number Theory
COT 3100, Spring 2001 Applications of Discrete Structures
COT 3100, Spring 2001 Applications of Discrete Structures
The Basic Concepts of Set Theory
Sets Section 2.1.
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.
… and now for something completely different…
CS100: Discrete structures
The Basic Concepts of Set Theory
2.1 Sets Dr. Halimah Alshehri.
Discrete Mathematics CS 2610
… and now for something completely different…
ICOM 5016 – Introduction to Database Systems
Lecture Sets 2.2 Set Operations.
Sets & Set Operations.
Presentation transcript:

EE1J2 – Discrete Maths Lecture 7 What is a set? What is a relation on a set? What is a function between sets? See Truss, Chapter 3

Some Example Sets {a,b,c,d}, {0,1,2,3} {0,1,2,3,…} - the set ℕ of Natural Numbers {0,2,4,6,…} the set of even natural numbers {2n : n=0,1,2,3,…} {n : n=2m, m ℕ} {…,-3,-2,-1,0,1,2,3,…} - the set ℤ of Integers { : n, m  ℤ} – the set ℚ of rational numbers The set ℝ of real numbers  The empty set

Some more sets The set ℂ of complex numbers x+jy, where x,y are members of ℝ and j2=-1 The closed interval [a,b] = {x: ax b} The open interval (a,b) = {x: a<x <b} The half-open interval [a,b)={x:ax <b} (or (a,b]={x:a<x  b} The infinite intervals (-,), [a, ) and (-,b] are defined similarly

How do we define a Set? Axiom of Extensibility Axiom of Comprehension a set is defined completely by its members E.g: {0,1,2,3} Axiom of Comprehension any property defines a set – the set of all elements which satisfy that property E.g: {n : n=2m, m ℕ}

Notation Let S be a set. If x is a member of S write x  S 1  {0, 1, 2, 3} 4  {0, 1, 2, 3} Let T be another set. If each member of T is a member of S then T is a subset of S and we write T  S. Sometimes say T is contained in S If there is an element x such that x  S but x  T then T is a proper subset of S and we write T  S

Notation continued {0,1}  {0, 1, 2, 3} and {0,1}  {0, 1, 2, 3} {0, 1, 2, 3}  {0, 1, 2, 3} but {0, 1, 2, 3}  {0, 1, 2, 3} 0  {0, 1, 2, 3} 0  {0, 1, 2, 3} {0}  {0, 1, 2, 3}   {0, 1, 2, 3}, but   {0, 1, 2, 3} In fact, for any set S,   S

Ambiguity {a,b}={b,a}={a,a,b,b,b}={a,b,a,b,b,a} In other words, order and repetition are not important. {3,5}={n  ℕ: (n is prime)(n<6)} = {x  ℤ: x2-8x+15=0}

Union, Intersection, Difference Let S and T be sets The union of S and T is the set S  T = {x: (xS)(x T)} The intersection of S and T is the set S  T = {x: (xS)(x T)} The difference of S and T is the set S – T = {x: (xS)(x T)} S – T is sometimes called the (relative) complement of T (in S) and written S \ T

Cardinality Let S be a set The cardinality of S is the number of elements in S, written |S| For finite sets the meaning of |S| is clear (e.g. |{0,1,2,3}|=4). Cardinality also be extended to infinite sets.

The Power Set Let S be a set. The Power Set of S is the name given to the set of all subsets of S. It is normally denoted by P(S) Formally: P(S) = {T: T  S} Note that |P(S)|=2|S|

Proofs in Set Theory To prove that two sets S and T are equal it is necessary to show that they have the same elements One strategy is to show S  T and T  S Each member of S is a member of T, and Each member of T is a member of S An alternative is to use the equivalences from propositional logic

Proof based on PL Let A and B be sets. Prove that (AB)-(AB) = (A-B) (B-A) Proof (AB)-(AB) ={x:(xA  xB)(xA  xB)} ={x:(xA  xB) (xA  xB)} ={x:(xA  xA)}{x:(xA  xB)} {x:(xB  xA)}  {x:(xB  xB)} = {x:(xA  xB)} {x:(xB  xB)} = (A-B) (B-A)

Proof using Venn Diagrams B X X-A A  B A  B A-B B-A (A-B)  (B-A) (A  B) - (A  B)

Ordered Sets and n-tuples {a,b} = {b,a} – order is not important If order is important, we use (,) not {,} So, (a,b)  (b,a) (a,b) called an ordered pair More generally, (a1,a2,…,an) is called an (ordered) n-tuple (a1,a2,…,an,…), or (an)nℕ is a (infinite, ordered) sequence

Cartesian Product Let A and B be sets. The Cartesian product of A and B is the set AB = {(a,b): (aA)(bB)} | AB| = |A||B| (hence ‘product’) To see this, suppose A={a1,…,aN} and B={b1,…,bM}, then…

Cartesian Product

Relations Suppose A = {0,1,2,3}. An example of a relation on A is ‘<’ (‘less than’) This relation is defined by the set R = {0<1, 0<2, 0<3, 1<2, 1<3, 2<3} or, equivalently R = {(0,1), (0,2), (0,3), (1,2), (1,3), (2,3)} AA More generally, a relation on A is a subset R of A  A

Relations (continued) Mathematicians sometimes use the symbol ‘~’ to denote a relation. I.e. if a,b A, and if (a,b) R we write a ~ b or aRb The set of possible relations on A is equal to the set of all possible subsets of A  A i.e. P (A  A) The number of possible relations on A is therefore 2|A  A| For example, suppose A = {a,b}

Relations (example) A = {a,b} A  A = {(a,a), (a,b), (b,a), (b,b)} P(A  A ) = {, {(a,a)}, {(a,b)}, {(b,a)}, {(b,b)}, {(a,a),(a,b)}, {(a,a),(b,a)}, {(a,a),(b,b)}, {(a,b),(b,a)}, {(a,b),(b,b)}, {(b,a),(b,b)}, {(a,a),(a,b),(b,a)}, {(a,a),(a,b),(b,b)}, {(a,a),(b,a),(b,b)}, {(a,b),(b,a),(b,b)}, {(a,a), (a,b), (b,a), (b,b)}} These are also the possible relations on A.

Relations (continued) As with sets, there may be more than one way to define a given relation E.g: Let A = {2, 6, 12}. For this set, ‘divides’ is the relation {(2,2),(2,6),(2,12),(6,6),(6,12),(12,12)} ‘is less than or equal to’ gives the same relation We can describe either relation using a directed graph (or digraph)

Representation of a Relation as a Directed Graph 2 6 12 A = {2, 6, 12}. a ~ b if and only if a  b

Functions You probably have pre-conceived ideas of what a function is – f(x)=x2+2x+2, f(x)=sin(x), f(x)=exp(x),… These are all functions which associate a member x of ℝ unambiguously with another member f(x) of ℝ. Remember, ℝ is the set of real numbers They can all be written in set-theoretic notation as f = {(x,f(x)): x  ℝ}

Summary of Lecture 7 Introduction to sets Relations on sets Axioms of extensibility and comprehension Relationship with propositional logic Venn diagrams Relations on sets