Download presentation
1
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
2
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
3
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: ax b} The open interval (a,b) = {x: a<x <b} The half-open interval [a,b)={x:ax <b} (or (a,b]={x:a<x b} The infinite intervals (-,), [a, ) and (-,b] are defined similarly
4
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 ℕ}
5
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
6
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
7
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}
8
Union, Intersection, Difference
Let S and T be sets The union of S and T is the set S T = {x: (xS)(x T)} The intersection of S and T is the set S T = {x: (xS)(x T)} The difference of S and T is the set S – T = {x: (xS)(x T)} S – T is sometimes called the (relative) complement of T (in S) and written S \ T
9
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.
10
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|
11
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
12
Proof based on PL Let A and B be sets. Prove that
(AB)-(AB) = (A-B) (B-A) Proof (AB)-(AB) ={x:(xA xB)(xA xB)} ={x:(xA xB) (xA xB)} ={x:(xA xA)}{x:(xA xB)} {x:(xB xA)} {x:(xB xB)} = {x:(xA xB)} {x:(xB xB)} = (A-B) (B-A)
13
Proof using Venn Diagrams
B X X-A A B A B A-B B-A (A-B) (B-A) (A B) - (A B)
14
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
15
Cartesian Product Let A and B be sets.
The Cartesian product of A and B is the set AB = {(a,b): (aA)(bB)} | AB| = |A||B| (hence ‘product’) To see this, suppose A={a1,…,aN} and B={b1,…,bM}, then…
16
Cartesian Product
17
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)} AA More generally, a relation on A is a subset R of A A
18
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}
19
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.
20
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)
21
Representation of a Relation as a Directed Graph
2 6 12 A = {2, 6, 12}. a ~ b if and only if a b
22
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 ℝ}
23
Summary of Lecture 7 Introduction to sets Relations on sets
Axioms of extensibility and comprehension Relationship with propositional logic Venn diagrams Relations on sets
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.