Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Lecture 01 - Set and Operations

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lecture 01 - Set and Operations

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Lecture – 01

Set and its Operations

Discrete Structures (CSAL-1213)


Course Instructor: Hina Alam
What is a SET?
Set
Unordered Collection of Objects

▪ A set is a well-defined collection of distinct unordered objects (working definition)

Well defined? Object?


Well defined Not Well defined Set
Set
Set
Unordered Collection of Objects

▪ A set is a well-defined collection of distinct unordered objects (working definition)

Object
?
In the context of sets, the term objects refers to the individual
items or elements that are contained within a set.

- These objects can be anything: numbers, letters, symbols,


or even more complex entities like other sets or real-world
items.

Objects in a set named classroom


How to define a Set?
Notation:

▪ Sets are typically denoted using curly braces:

▪ A = {1, 2, 3}
▪ Students in Class: {ali, amna, hadi, sara}
▪ Cities of Pakistan: {Lahore, Karachi, Islamabad, Faisalabad, Multan, …}

In the set "Cities of Pakistan: {Lahore, Karachi, Islamabad, Faisalabad, Multan}," the
elements (city names) are capitalized because city names are proper nouns, and in
English, proper nouns are always capitalized. This rule applies to all names of
specific places, people, or organizations.

▪ Sets can contain non-related elements as well, {red, 5, Ali,


@}

▪ We’ll use set of numbers


▪ Set of all Prime numbers: {1,3,5,7, ….}
▪ Set of Natural Numbers: {1,2,3,4,5,6,7…}
▪ Set of Whole Numbers: {0,1,2,3,4,5,6,7, …..}
Activity
Consider the set

A={1,′a′,3.14,{2,3}}

A1​={1},
A2​={1,2},

Explain whether this set is valid?


Activity - Solution
Consider the set

A={1,′a′,3.14,{2,3}}

A1​={1}
B2={1,2}

Explain whether this set is valid?


Specifying a Set Sets = Capital letters
Elements = Lower case letters
▪ Set Name should be in capital letters (A,B,C,S,….)

A={1,2,3,4,…} B={a,e,i,o,u}

▪ Set elements should be represent in small case letters (a,x,y,…)

▪ Its easiest way to list elements if finite i.e.


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

▪ For infinite set: use Ellipsis (…) i.e.


B = {0,1,2,3, …..}
▪ Ellipsis may cause confusion: what's Next??? i.e. C = {3,5,7,….}
Activity
Consider the set

Alphabets={a,b,c}

Explain whether this set name is valid?


Activity
Consider the set

Alphabets={a,b,c}

YES, But are more suitable for programming contexts or specific applied math areas.

Concatenation of Letters: Names like "AB" or "Set1" are


generally not traditional.

Long Names or Words: Names like "Fruits" or "MySet" are


uncommon in traditional math; they are more suitable for
programming contexts or specific applied math areas.
How to define a Set?
Properties of Sets

▪ Order does not matter:


i.e {1,2,3,4,5} is equivalent to {2,5,4,1,3}

▪ Does not have duplicate elements, always Unique/ distinct elements


▪ Such as list of students ID in class

C = {2,4,4,6,8}
● C would still be represented as {2,4,6,8} because sets do not
allow for repeated elements.
Elements of a Set
An object in a set is called an element.
▪ A set contains the various members or elements that makeup
the set

Membership:

If an object x is in a set A, we write x ∈ A.


• Example: 2 ∈ {1, 2, 3} means 2 is an element of the set.
x ∈ A, which reads
“x belongs to A” or
If an object is not in the set, we write x ∉ A. “x is in A”.
• Example: 4 ∉ {1, 2, 3}.
Activity
.Determine whether each of the following statement is true or false.

If K = { 3, 4, 7, 8}
L = { 4, 7, 9 }
M = { 2}

Question: 7∈K
Question: 7 ∈ K && 6 ∈ K
FINITE SETS: INFINITE SETS:

D = {Monday, Tuesday, Friday, Saturday, Sunday} D = {1, 2, 3 …. }


D = {1, 2, 3 …. 100} D = {0, 2, 4, 6 …}
Remember!!!
(Must Read)

Countable Infinite Sets

● Definition: A set is countable if you can list its elements in a sequence and can map to natural numbers
● Example:

Uncountable Infinite Sets

● Definition: Uncountable sets have too many elements to be listed individually. (Cannot map to natural numbers)
● Example: The set of real numbers between 0 and 1. You cannot list them because there are infinitely many (like 0.1, 0.01, 0.001,
etc.) and you can't even get close to listing them all.

https://www.youtube.com/watch?v=HaB050B5a2Q
Set Notations
(Set – Mathematical Representation)

(Ways to describe a set)


Set Notations
(Set – Mathematical Representation)

1. Roster Notation: also called List Notation

Useful when there is a small or finite number of elements.

▪ List all elements of the set inside curly


braces.
▪ Syntax: 𝑆={element 1, element 2, element 3, ...}

Example:

Set of prime numbers less than 10: 𝑃={2,3,5,7}


If the set is infinite, E={2,4,6,8,10,… }
In discrete mathematics, even when using roster notation for infinite sets, they
must be countable (like the set of natural numbers, prime numbers, or integers).

Continuous sets, which are uncountable, cannot be fully represented using


roster notation.
Activity
List Notation:
Set Notations
2. Set Builder Notations:

Useful for describing sets with infinite elements or


when listing elements is impractical.

▪ We describe the properties that the elements of the set


satisfy, instead of listing them explicitly.

Syntax:
▪ S = {x ∣ condition on x} where: 𝑥 is a variable representing
the elements of the set.
▪ The condition on 𝑥 specifies which elements are included.
Set Notations
Set Builder Notations:

Examples: The set rule and variables are


separated by a vertical slash “|’ or
colon (:)
The set of all integers greater than 0:
▪ 𝑆={𝑥 ∣ 𝑥 > 0 , 𝑥 ∈ N} Read as: x such that x is greater than 0,
where x belongs to Z

The set of even numbers:


▪ 𝐸 = {𝑥 ∣ 𝑥 is an even number}
A = {x ∈ N | x ≤ 5}
B = {x ∈ E | 0 < x ≤ 50}
C = {x ∈ O | 0 < x}
Examples of Set Builder
Notations:
Sets of Numbers
1. Set of Natural Numbers N = {1, 2, 3, … }
2. Set of Whole Numbers W = {0, 1, 2, 3, … }
3. Set of Integers Z = {…, -3, -2, -1, 0, +1, +2, +3, …}
Z = {0, ±1, ±2, ±3, …}
4. Set of Even Integers E = {0, ± 2, ± 4, ± 6, …}
5. Set of Odd Integers O = { ± 1, ± 3, ± 5, …}
6. Set of Prime Numbers P = {2, 3, 5, 7, 11, 13, 17, 19, …}
7. Set of Rational Numbers (or Quotient of Integers) Q = {x | x = p/q , p, q ∈
Z, q ≠ 0}
Examples of Set-Builder Notation

▪ Finite Set: The set of integers between 1 and 5:


• S={x ∣ 1 ≤ x ≤ 5 , x ∈ Z}
• Equivalent in roster form: S={1,2,3,4,5}

▪ Infinite Set: The set of positive real numbers:


▪ R+={x ∣ x > 0, x ∈ R}
• This is an infinite set, and we can’t list all elements.
Class Activity
Class Activity
Class Activity

Set builder notation?

{0,2,4,6,8,10,12,14,16}
Class Activity

Set builder notation?

{0,2,4,6,8,10,12,14,16}

{n∈Z:0≤n≤16 and n is even}


Class Activity

Set builder notation?

{−3,−2,−1,0,1,2,3}
Class Activity The absolute value of a
number n, denoted as ∣n∣, is
the distance of that number
Set builder notation? from zero on the number line

{−3,−2,−1,0,1,2,3}
1
={n∈Z: ∣n∣ ≤3}
Explore
= {n∈N:∣n∣≤3} Ceiling and
2 Floor
= {1,2,3}
Roster (List) Form Set builder Form

A = {a, e, i, o , u} A = {x | x is a vowel}

B = {1,2,3,4,5,6} B = {x | x ∈ N, x <7}

L = {-2, -1, 0, 1, 2, 3, 4, 5, 6}
L = {x | x ∈ Z, -2 <=x < 7}

D = {0, 7, 26, 63, …} D = {x | x = x3 -1, x ∈ N}


{…,−11,−6,−1,4,9,14,…}
E= {x | 5x - 1, x ∈ Z}

C = {0, 1,4,9,16} C = {x | x < 5, c = x2 , x ∈ W, c ∈


Class Activity

Class Activity

Types of Sets
Textbook:

▪ Main Text:
▪ K. Rosen: Discrete Structures and its Applications

▪ Weekly Readings:
▪ L. Lovasz: Discrete Mathematics, Elementary and Beyond

▪ Reference:
▪ R. J. Wilson: Graph Theory

You might also like