0% found this document useful (0 votes)
14 views86 pages

Chapter 2 Sets

Uploaded by

rajamasadeh2013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views86 pages

Chapter 2 Sets

Uploaded by

rajamasadeh2013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 86

Basic structures:

Sets, Functions,
Sequences
and Summation

Done by: Dr. Raja’a Masa’deh


Information Technology Faculty
The World Islamic Sciences and Education University
Sets and Subsets
What is the meaning of set ?

 It is common for sets to be denoted using uppercase letters. Lowercase letters are
usually used to denote elements of sets.
 There are several ways to describe a set:
 Roster method.
 Set builder notation.
 Roster method: sets are written using curly brackets {, } with their elements
listed in between.

Example (1): The set V of all vowels in the English alphabet can be written as

V = {a, e, i, o, u}.

Example (2): The set O of odd positive integers less than 10 can be expressed by

O = {1, 3, 5, 7, 9}.

Example (3): All odd numbers ( positive and negative)

O = {…, -7, -5, -3, -1, 1, 3, 5, 7, …}.

Infinite

Curly bracket, Element Called ellipses means continue on…


set bracket, brace
EXAMPLES OF FINITE SET AND INFINITE SET

A= {1, 3, 5, 7} Finite set

B={1, 3, 5, 7, …} Infinite set

Note: Sometimes the “…” can be used in the middle to save writing long lists.

Example : The set of letters : {a, b, c, … , x, y, z}.


Is it finite or infinite
set?

It is finite set because


there are only 26
letters.
 Set builder notation: it is another way to describe a set. We characterize all those
elements in the set by stating the property or properties they must have to be
members.

Example : The set O of all odd positive integers less than 10 can be written as
O = {x | x is an odd positive integer less than 10}.
Or
O = {x ∈ Z+ | x is odd and x < 10}.
Sets Equivalence

Example 1 : A= {2, 3, 4, 5} These two sets are equal


B= { 2, 2, 3, 4, 4, 5}. because they have the
same elements.

Example 2: A= {1, 2, 3} and B={x| x is a positive integer and x2 <12}


Then A= B
The Empty Set

Empty Set:
is a special set that has no elements. This set is called the
empty set, or null set, and is denoted by ∅.
 The empty set can also be denoted by { }.

 A set with one element is called a singleton set.


Universal Set
 The universal set U contains all the objects under consideration, is represented
by a rectangle. Inside this rectangle, circles or other geometrical figures are
used to represent sets. Sometimes points are used to represent the particular
elements of the set.

Example : Draw a Venn diagram that represents V, the set of vowels in the English

alphabet.
Subset
 The set A is a subset of B if and only if every element of A is also an element of B.
We use the notation A ⊆ B to indicate that A is a subset of the set B.

U
B
Subset
Example : A= {r, s, t, u, w} and B={s, u, w}

U
B

B is a subset of A.
Subset
 The set A is a subset of B if and only if every element of A is also an element of B.
We use the notation A ⊆ B to indicate that A is a subset of the set B.
Some principles

 ∈ means “belong to”.


 Element “ a” is in a set A. Thus, we use the symbol “∈ “ to show it as ( a ∈ A).
 ∉ means “not belong to”.
 In case an element doesn’t belong to a set, use “ ∉“.

Example : A= { a, b, c, d}

c ∈ A. ( which means c belongs to A).


p ∉ A. ( which means p doesn’t belong to A).
Example : A= {r, s, t, u, w}, B={s, u, w} and C={n, o, p}.

C ⊈ A and A ⊈ C
C ⊈ B and B ⊈ C

C B
Proper Subset
Subset VS Proper Subset
A proper subset of a set A is a subset of A that is not equal to A. In
other words, if B is a proper subset of A, then all elements of B are
in A but A contains at least one element that is not in B.

 Example:

A= {1, 3, 5}
B= {1, 5}
C= {1, 3, 5}
D= {1, 4}

B is a proper subset of A (B ⊂ A)
C is a subset of A (C ⊆ A) but it is not proper subset of A since A=C
D is not a subset of A since is not an element of A.
Subset VS Proper Subset
 set A is a subset of a set B but that A ≠ B, we write A ⊂ B and say that A is a proper
subset of B. For A ⊂ B to be true, it must be the case that A ⊆ B and there must
exist an element x of B that is not an element of A. That is, A is a proper subset of B.
 In other words, If A and B are two sets, then A is called the proper subset of B if A
⊆ B but B ⊈ A i.e., A ≠ B. The symbol ‘⊂’ is used to denote proper subset.
Symbolically, we write A ⊂ B.

Example :
A= {a, b, c, d}, B={a, c, d}, C= {d, c, b, a}
 C ⊆ A because all elements in C are found in A.
Moreover, they are equal sets.
But C is not proper subset of A.
 B ⊂ A; B is proper subset of A because the set B has less elements
than A.
 A is a subset of B if and only if every element of A is in B.
 ⊆ means “ Subset ”.
 ⊈ means “not subset”.

Example : A= {1, 2, 3, 4, 5}

B= { 1, 2, 3, 3, 4, 5, 5}.
B ⊆A , which means B is subset of A.

Question : A= {1, 3, 4}

B= { 1, 2, 3, 4}.
Is A a subset or proper subset of B?
Example : Let A be all multiples of 4 and B be all multiples of 2.
Is A a subset of B? and Is B a subset of A?

A= { …, -8, -4, 0, 4, 8, …}
The answer B= { …, -8, -6, -4, -2, 0, 2, 4, 6, 8, …}
A ⊂ B but B ⊄A.
Some conclusions

 For any sets A, B and C:


 ∅ ⊂A ⊂ U
 A⊆A
 If A ⊂ B and B ⊂ C, then A ⊂ C
 A = B if and only if A ⊆ B and B ⊆ A.
The size of a set
 Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative
integer, we say that S is a finite set, and that n is the cardinality of S. The cardinality
of S is denoted by |S|.
 Remark: The term cardinality comes from the common usage of the term cardinal number
as the size of a finite set.

Example (1): Let A be the set of odd positive integers less than 10.

Then |A|= 5.

Example (2): Let S be the set of letters in the English alphabet.

Then |S| = 26.

Example (3): Because the null set has no elements, it follows that |∅| = 0
Examples :

S = { a, b, c, {7}}
|S| = 4.

A = {2, 4, 6, {4, 6}, 8}


|A| = 5.

{Ꝋ} = {{}}
|{Ꝋ}| = 1.
Power Set
 Given a set S, the power set of S is the set of all subsets of the set S. The power
set of S is denoted by P(S).
 If a set has n elements, then its power set has 2n elements.

Example (1) : What is the power set of the set S {0, 1, 2}?

The power set P({0, 1, 2}) is the set of all subsets of {0, 1, 2}.
Hence, P({0, 1, 2}) = {∅,{0},{1},{2},{0, 1},{0, 2},{1, 2},{0, 1, 2}}.
P (S) = 8.

Example (2) :
What is the power set of the empty set? What is the power set of the set { ∅}?

 The empty set has exactly one subset, namely, itself. Consequently, P( ∅) = { ∅}.
 The set {∅} has exactly two subsets, namely, ∅ and the set {∅} itself. Therefore,
P({∅}) = {∅,{∅}}.
Set Operations
Set Operations
Union: A ⋃ B= { X: X∈ A or X ∈ B}

Example :
A= {a, b, c} and B= {b, c, d, e}
Then A ⋃ B= { a, b, c, d, e}.
 Intersection: A ⋂ B= { X: X∈ A and X ∈ B}

Example : A= {a, b, c} and B= {b, c, d, e}


Then A ⋂ B= {b, c}.
 Disjoint
 Difference: A - B= { X: X∈ A and X ∉ B}

Example : A= {1, 2, 3, 4, 5, 6} and B= {3, 5}

Then A - B= {1, 2, 4, 6}.


 Complement: AC= { X: X∈ U and X ∉ A}

Example (1):

Example (2): U= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and A= {1, 3, 5, 7, 9}

Then AC = {2, 4, 6, 8, 10}.


Example (3): A= {1, 2, 3, 4, 5} and B= {2, 3, 4}

Then BC = { 1, 5}.
Example
Let A= {8, 7, 2}, E= { 1, 2, 3, 4, 5, 6, 7, 8, 9} and S= {2, 3, 5, 7}.
Find AC, SC , EC , (A ⋂ S )C and (A ⋃ S )C ?

AC= { 1, 3, 4, 5, 6, 9}
SC = { 1, 4, 6, 8, 9}
EC= { }.
(A ⋂ S )C= {1, 3, 4, 5, 6, 8, 9}
(A ⋃ S )C= { 1, 4, 6, 9}
ti e s
t I d enti
S e
Use set builder notation and logical equivalences to show
that:
𝑨 ∩ ( 𝑩 − 𝑨 )=∅

¿ [ ( 𝒙 ∈ 𝑨 ) ∧ ¬ ( 𝒙 ∈ 𝑨 ) ]∧( 𝒙 ∈ 𝑩) Note:

¿ 𝑭 ∧ ( 𝒙 ∈ 𝑩)
, which means

se : Use set builder notation and logical equivalences to


rci show that: 𝑨 ∪ ( 𝑩− 𝑨 )= 𝑨 ∪ 𝑩
Exe
Notes:
𝒙 ∈ 𝑨 ≡ 𝒙 ∉ 𝑨 ≡¬( 𝒙 ∈ 𝑨)

𝑨 ∪ 𝑩 ≡( 𝒙 ∈ 𝑨 )∨( 𝒙 ∈ 𝑩)
𝑨 ∩ 𝑩 ≡( 𝒙 ∈ 𝑨)∧( 𝒙 ∈ 𝑩)
𝑨 − 𝑩 ≡( 𝒙 ∈ 𝑨)∧( 𝒙 ∉ 𝑩 )
Use a truth table to show that A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
Computer Representation of Sets

 Represent a subset A of U with the bit string of length n, where the ith bit in
this string is 1 if ai belongs to A and is 0 if ai does not belong to A

Example:

Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of elements of U has the


elements in increasing order; that is, ai = i. What bit strings represent the subset of
all odd integers in U?

Answer :
the set of odd integers in U, namely, {1, 3, 5, 7, 9}, the bit string is:

10 1010 1010.
Functions
The function f Maps A to B

A is the domain of f B is the codomain of f

𝑓 ( 𝑎 )=𝑏

a is a preimage of b b is the image of a


Domain Codomain

F(Adams)= A
F(Chou)=C

a
b 1
c 2
d 3
e 4
One-to-One Function:(Injunction)
Onto Function:(Surjection)
One-to-One correspondence Function:(Bijection)
( One-to-One and Onto)
One-to-One function

Onto function
Inverse Functions
Invertible
• A one-to-one correspondence (Bijection) is called invertible because we can
define an inverse of this function. A function is not invertible if it is not a one-
to-one correspondence, because the inverse of such a function does not exist.

Example : Let be the function from to such that ,


, and . Is f invertible, and if it is, what is its inverse?
Answer:
The function f is invertible because it is a one-to-one correspondence.
, ,.

a 1 1 a  One-to-One
 One-to-One
b 2 2 b  Onto
 Onto
c 3 3 c

𝒇 ( 𝒂 )=𝟐 , 𝒇 ( 𝒃 )=𝟑 , 𝒇 ( 𝒄 ) =𝟏 𝒇
−𝟏
( 𝟏 )=𝒄 , 𝒇 − 𝟏 ( 𝟐 ) =𝒂 , 𝒇 − 𝟏 ( 𝟑 )=𝒃
Example :
Let f : Z → Z be such that . Is f invertible, and if it is, what is its
inverse?
The function is a one-to-one correspondence. ⸫ it is invertible.

Example :
Let f be the function from R to R with . Is f invertible?

, f is not one-to-one ⸫ f is not invertible (Note we can also show that f is not
invertible because it is not onto.)
COMPOSITION

The The
function g function f
Maps A to B Maps B to C
Example:
Let g be the function from the set {a, b, c} to itself such that , ,
and . Let be the function from the set to the set such that , , and . What
is the composition of f and g, and what is the composition of g and
f?
Answer:
,
,
.

Note that is not defined, because the range of is NOT a subset of the
domain of .
Example:
( 𝒇 ∘𝒈 )( 𝒙 )= 𝒇 (𝒈 ( 𝒙 ) )

a a 1
( 𝒇 ∘ 𝒈 ) ( 𝒂 )= 𝒇 ( 𝒈 ( 𝒂 ) )= 𝒇 ( 𝒃 )=𝟐
b b 2 ( 𝒇 ∘ 𝒈 ) ( 𝒃 ) = 𝒇 ( 𝒈 ( 𝒃 ) ) = 𝒇 ( 𝒄 ) =𝟏
c c 3
g f ( 𝒇 ∘ 𝒈 ) ( 𝒄 ) = 𝒇 ( 𝒈 ( 𝒄 ) ) = 𝒇 ( 𝒂 )=𝟑

( 𝒈 ∘ 𝒇 )( 𝒙 )=𝒈 ( 𝒇 ( 𝒙 ) )
a a 1 ( 𝒈 ∘ 𝒇 ) ( 𝒂 )=𝒈 ( 𝒇 ( 𝒂 ) )=𝒈 ( 𝟑 ) =𝒖𝒏𝒅𝒆𝒇𝒊𝒏𝒆𝒅
b b 2
c c 3
( 𝒈 ∘ 𝒇 ) ( 𝒃 ) =𝒈 ( 𝒇 ( 𝒃 ) ) =𝒈 ( 𝟐 )=𝒖𝒏𝒅𝒆𝒇𝒊𝒏𝒆𝒅
g f ( 𝒈 ∘ 𝒇 ) ( 𝒄 ) =𝒈 ( 𝒇 ( 𝒄 ) ) =𝒈 ( 𝟏 )=𝒖𝒏𝒅𝒆𝒇𝒊𝒏𝒆𝒅

Note that g ◦ f is not defined, because the range of f is NOT a subset of the domain of
g
Example:
Letand be the functions from the set of integers to the set of integers
defined by and . What is the composition of and ? What is the
composition of and ?

Answer:

Both the compositions and are defined.

.
The Graphs of Functions
Let f be a function from the set A to the set B. The graph of the function f
is the set of ordered pairs {(a, b) | a ∈ A and f (a) = b}.
Some Important Functions
Examples

⌈ 𝟏/𝟐 ⌉=𝟏

⌊ 𝟏/𝟐 ⌋ =𝟎 3


𝟏 𝟑 . 𝟏 ⌉ =𝟒
⌊− ⌋=−𝟏
𝟐
7
𝟏
− ⌈⌉𝟕
=𝟎⌉ =𝟕
𝟐
Sequences and
Summations
Definition of sequences
• Sequences are ordered lists of elements, it is a function from a subset of the set of
integers (usually either the set {0, 1, 2, . . .} or the set {1, 2, 3, . . .}) to a set S. We use
the notation an to denote the image of the integer n. We call an a term of the
sequence.
• the notation {an} to describe the sequence.
• an represents an individual term of the sequence {an}.

Example: 1, 2, 3, 5, 8 is a sequence with five terms and 1, 3, 9, 27, 81 , . . . , 3n, . . . is


an infinite sequence.
 We need an equation to find other elements which is 3 n . 1, 3, 9, 27, 81, …

Based on the location of each element


which depends on the natural number
which means starting from zero.
30, 31, 32, 33, 34, …, 3n
Definition of sequences
The location of some sequences start from 0 while others start from 1.

Example : Consider the sequence {a }, where a = 1/n .


n n

The list of the terms of this sequence, beginning with a1, namely,

a1, a2, a3, a4, . . . ,

starts with

1, 1/2, 1/3, 1/4 ,...

a1 = 1

a2 = ½

and so on…
Finite sequences
 Finite sequence is a sequence with a domain consists of the set {1,2,3,4,…,n} .

Example (1) : Find all of the terms of the finite sequence an = (-1)n /(2n +1) , 1≤n≤5

a1= - 1/3
a2= 1/5
a3= - 1/9
a4=1/17
a5= - 1/33

The five terms of the sequence are ( - 1/3, 1/5, - 1/9, 1/17, - 1/33)

Example (2)“ :{ a } = 0, 1, 4, 9, 16, 25, … “


n

an = n 2
Infinite sequences

 An infinite sequence is sequence whose domain consists of the set {1,2,3,4,…}


or in other words all positive integers.
Example :
Find the first 4th terms of the infinite sequence with nth terms of an
= 0.5n+8. where n=1,2,3,…

a1= 8.5 , a2= 9, a3=9.5, a4=10

 A sequence may contain repeated instances of an element.


Example :
“{bn} = 1, -1, 1, -1, … “ , where bn = (-1)n Of course not because
it has only two
Is it considered elements 1 and -1.
as infinite
sequence??
Example : What is the next number?

 1, 2, 3, 4, …
The next number is 5.
 1, 3, 5, 7, …
The next number could be 9 or 11
 The first case is odd numbers [ 1,3,5,7,9,11,13,…]
 The second case is prime number [1,3,5,7,11,13,…]

Sometimes there is hardness of recognition of next number, so


select the simplest way.

Example : Find the elements of {Cn} where Cn= 6 *(1/3)n


{Cn} = 2, 2/3, 2/9, 2/27, …
Arithmetic sequence
• An arithmetic progression is a sequence of the form.

( a, a + d, a + 2d, . . . , a + nd, . . . )

Note the linear function of arithmetic sequence F(x) = dx+ a


 where the initial term a and the common difference between consecutive terms d
are real numbers.
-1, 3, 7, 11, 15, …

The difference between each


successive elements is 4. 4 4 4 4

sn = −1 + 4n , is an arithmetic progressions with initial term and common


differences equal to −1 and 4, respectively.

The list of terms s0, s1, s2, s3, . . . begins with −1, 3, 7, 11, . . . ,
Example : The sequence {t } with t = 7 − 3n with initial terms and common
n n

differences equal to 7 and −3, respectively. the list of terms t0, t1, t2, t3, . . .
begins with 7, 4, 1,−2, . . . .

t0= 7 – 3 . (0) = 7

t1= 7 – 3 . (1) = 4

t2= 7 – 3 . (2) = 1

t3= 7 – 3 . (3) = -2

And so on…
Explicit sequences

 Sequence called explicit because it tells us exactly what value any particular
terms has, depend on the given rule.
Example : the sequence 1,4,9,16,25,… is an example of explicit sequence. It is easy
to describe term using only its position number. It is the square of n, bn= n2 .
 Find the following terms:

 b5 = 52 = 25

 b9 = 92 = 81
Geometric sequence

 A geometric progression is a sequence of the form

( a, ar, ar2, . . . , arn, . . .)

Note The function of a Geometric sequence F(x)= arx.

where the initial term a and the common ratio r are real numbers.

Example: The sequences {bn} with bn = (−1)n, is a geometric progressions with

initial term and common ratio equal to 1 and −1. The list of terms b 0, b1, b2, b3, b4, . .
. begins with (1,−1, 1,−1, 1, . . . ).
Examples

2, 10, 50, 250, 1250, …


𝟏
¿ 𝟐 ∗𝟓=𝟐 ∗𝟓
𝟐
¿ 𝟐 ∗𝟐𝟓=𝟐 ∗ 𝟓
𝟑
¿ 𝟐 ∗𝟏𝟐𝟓=𝟐∗ 𝟓
Recursive sequence
 Recursive sequence is a sequence obtained from the previous term to define the
next term.
Example (1): The sequence 3,8,13,18,23,… is an example of an Recursive sequence ,
the pattern is that we are always adding a fixed number of 5 to the previous term to

get to the next term. So , we describe the sequence a1=3, an=an-1 +5.
Example (2):
find the first three terms and the 4th of the infinite sequence given by
the recursive sequence an = (an-1)2 +5, a1=-1

Solution : a2= (-1)2 +5= 6

a3= (6)2 +5=41

a4= (41)2+5=1686
Example (3):
Let {an} be a sequence that satisfies the recurrence relation

an = an−1 − an−2 for n = 2, 3, 4, . . . , and suppose that a0 = 3 and

a1 = 5. What are a2 and a3?

Solution: We see from the recurrence relation that


a2 = a1 − a0 = 5 − 3 = 2 and

a3 = a2 − a1 = 2 − 5 = −3.

We can find a4, a5, and each successive term in a similar way.
Sequence Summation
 we consider the addition of the terms of a sequence. For this we introduce
summation notation. We begin by describing the notation used to express the
sum of the terms am, am+1, . . . , an

from the sequence {an}.We use the notation

(read as the sum from j = m to j = n of aj ) to represent

am + am+1 + ・ ・ ・ +an.
 Where the variable j is called the index of summation . starting with its
lower limit m and ending with its upper limit n.
 is used to denote summation.

 Example: Use summation notation to express the sum of the first 100 terms of

the sequence {aj }, where aj = 1/j for j = 1, 2, 3, . . . .

Solution: The lower limit for the index of summation is 1, and the upper limit is
100.
Example (1) : What is the value of

Solution: We have

= 12 + 22 + 32 + 42 + 52

= 55

Example (2) : What is the value of

= (22 +1) +( 32 +1)+ ( 42 +1)


= 5 + 10+17
= 32
Example (3): What is the value of

= 1 + 2 + 3 + 4 + 5+ 6
= 21
= 21

What is
Example (4): What is the value of about this
one?

Remember
= (100 * 101 )/2
=5050
Example (5): What is the value of

= 12 + 22 + 32 + 42 + 52 + 62
= 1+ 4+ 9+ 16+ 25 + 36
= 91

Example (6): What is the value of

REMEMBER

= (100 * 101 * 201 )/6


=338350
Example (7): What is the value of
Who can solve
this one?

=-
=338350 – 40425
= 297925

Good
Job,
you
did it
Example (5): What is the value of

= 13 + 23 + 33 + 43
= 1+ 8 + 27 + 64
= 100

Example (6): What is the value of

REMEMBER

= 25502500
Geometric series

Example : What is the value of


S = 1+ 2+ 4+ 8 + … + 210 ?

= 20 + 21 + 22 + 23 + … + 210

a= 1, r= 2, n=10

=
= 2047
Example : What is the value of

=
= 1536 – 3

= 1533
ANY
QUESTION
U
𝑈={−1 , 0 , 1 , 2 ,3 , 4 , 5 , 6 }
𝑃={−1 , 0 , 1 , 2 }
2
𝑄={𝑥 : 𝑥 𝜖 𝑃 }

76

You might also like