U9 TOPIC 2 Flashcards
Sets - why bother?
Formalises the idea of grouping objects together and viewing them as a single entity,
This way a set becomes an abstraction
Laws governing sets form part of basis for Boolean algebra
Many program languages support sets as an abstract data type
Terminology
Set is a well defined collection of objects
Objects are members or elements
A set is unordered
Each member in set can only occur
once
Set is denoted by capital letter (usually)
Member is denoted by lower case letter (usually)
Examples of Sets
Set X contains even numbers between 1-99
Set C contains the colours in the rainbow
Blue is a member of C
Listing each member
A set can be defined by listing every member
The members are enclosed by {}
The members are separated by a comma
Example - {red, orange, yellow}
What does this common set represent?
{0, 1, 2, …}
N . Set of Natural numbers
What does this common set represent?
{1, 2, 3, …}
Z^+ . Set of positive integers
What does this common set represent
{…, -2, -1, 0, 1, 2, 3, …}
Z . Set of all integers
What does this common set represent?
{2/11 , 4/25}
Q . Set of rational numbers (expressed as fractions)
What does this common set represent?
{2.1 , 3.14, …}
R . Set of real numbers
Is a member of Z also a member of Q?
Yes, because the number 12 for example, can be written as 12/1
Describe an empty set?
One with no members
How might the empty set be represented?
{ } or ∅
How many different empty sets are there?
Just one
How could you define the set of all girls born in 2000?
We need a new notation for this.
what does expression x ∈ S mean?
“x is a member of the set S”