0% found this document useful (0 votes)
80 views63 pages

Mathematical Notations and Set Theory

The document discusses basic mathematical concepts including sets, sequences, tuples, functions, and relations. Some key points: 1) A set is a collection of distinct objects, which can be defined by listing its elements or using set-builder notation. Sets do not consider order or repetition of elements. 2) Sequences differ from sets in that they consider order and repetition of elements. Finite sequences are often called tuples. 3) A function maps inputs to unique outputs, and can be defined by a rule or table. The domain is the set of inputs, and range is the set of outputs.

Uploaded by

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

Mathematical Notations and Set Theory

The document discusses basic mathematical concepts including sets, sequences, tuples, functions, and relations. Some key points: 1) A set is a collection of distinct objects, which can be defined by listing its elements or using set-builder notation. Sets do not consider order or repetition of elements. 2) Sequences differ from sets in that they consider order and repetition of elements. Finite sequences are often called tuples. 3) A function maps inputs to unique outputs, and can be defined by a rule or table. The domain is the set of inputs, and range is the set of outputs.

Uploaded by

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

Mathematical Notions and

terminology

• Prerequisite knowledge.
• Review as necessary.
• Skim this chapter.
o As in any mathematical subject, we begin
with a discussion of the basic mathematical
objects, tools, and notation that we expect
to use.
Set(s) … {a, b, c}
• A set is a group of objects represented as a
unit.
• Sets may contain any type of object, including
numbers, symbols, and even other sets.
• The objects in a set are called its elements or
members.
• Sets may be described formally in several
ways.
 One way is by listing a set’s elements inside
braces. Thus the set ……….. S = { 7, 21, 57 }.
Set(s) … (Cont.)
• The set S = { 7, 21, 57 },
o Contains the elements 7, 21, and 57.
o The symbols ∈ and ∉ denote set membership
and non-membership. We write 7 ∈ { 7, 21, 57
} and 8 ∉ { 7, 21, 57 }.
• For two sets A and B,
o We say that A is a subset of B, written A ⊆ B, if
every member of A also is a member of B.
o We say that A is a proper subset of B, written
A ⊊ B, if A is a subset of B and not equal to B.
Set(s) … (Cont.)
• An infinite set contains infinitely many
elements.
• We cannot write a list of all the elements of an
infinite set, so we sometimes use the “. . .”
notation to mean “continue the sequence
forever.”
• Thus we write the set of natural numbers N as
{ 1, 2, 3, . . . }.
 N = Natural numbers = { 1, 2, 3, . . . }.
Set(s) … (Cont.)
• The order of describing a set doesn’t matter,
nor does repetition of its members.
• We get the same set S by writing { 57, 7, 7, 7,
21 }.
• If we do want to take the number of
occurrences of members into account, we call
the group a multiset instead of a set.
• Thus { 7 } and { 7, 7 } are different as multisets
but identical as sets.
Set(s) … (Cont.)
• The set of integers Z is written as { . . . , − 2, − 1, 0,
+ 1, + 2, . . . }.
• The set with zero members is called the empty
set and is written ∅.
 ∅ = {}, empty set.
• A set with one member is sometimes called a
singleton set, and a set with two members is
called an unordered pair.
Set(s) … (Cont.)

• When we want to describe a set containing


elements according to some rule,
o We write { n | rule about n }.
o Thus { n | n = m2 for some m ∈ N } means the
set of perfect squares.
Set(s) … (Cont.)
• If we have two sets A and B,
• The union of A and B, written A ∪ B, is the set we
get by combining all the elements in A and B into
a single set.
• The intersection of A and B, written A ∩ B, is the
set of elements that are in both A and B.
• The complement of A, written Ȧ, is the set of all
elements under consideration that are not in A.
Set(s) … (Cont.)
• As is often the case in mathematics, a picture
helps clarify a concept.
• For sets, we use a type of picture called a
Venn diagram.
o It represents sets as regions enclosed by
circular lines.
Set(s) … (Cont.)
• Let the set START-t be the set of all English words
that start with the letter “t”.
o For example, in the figure, the circle
represents the set START-t.
o Several members of this set are represented as
points inside the circle.
START-t
theory
tundra

FIGURE 0.1 terrific


Venn diagram for the set of English words starting with “t”
Set(s) … (Cont.)
• Similarly, we represent the set END-z of
English words that end with “z” in the
following figure.

END-z

quartz
jazz
razzmatazz

FIGURE 0.2
Venn diagram for the set of English words ending with “z”
Set(s) … (Cont.)
• To represent both sets in the same Venn diagram, we
must draw them so that they overlap, indicating that
they share some elements, as shown in the following
figure. END-z

START-t START-j
FIGURE 0.3
Overlapping circles indicate common elements topaz jazz

o For example, the word topaz is in both sets.


o The figure also contains a circle for the set START-j.
o It doesn’t overlap the circle for START-t because no word
lies in both sets.
Set(s) … (Cont.)
• The next two Venn diagrams depict the union
and intersection of sets A and B.

FIGURE 0.4
Diagrams for (a) A ∪ B and (b) A ∩ B
Sequences and Tuples
• A sequence of objects is a list of these objects
in some order.
• We usually designate a sequence by writing
the list within parentheses.
• For example, the sequence 7, 21, 57 would be
written (7, 21, 57).
Sequences and Tuples (Cont.)
• The order doesn’t matter in a set, but in a
sequence it does.
o Hence (7, 21, 57) is not the same as (57, 7, 21).
• Similarly, repetition does matter in a sequence,
but it doesn’t matter in a set.
o Thus (7, 7, 21, 57) is different from both of the
other sequences, whereas the set { 7, 21, 57 }
is identical to the set { 7, 7, 21, 57 } .
Sequences and Tuples (Cont.)
• As with sets, sequences may be finite or infinite.
• Finite sequences often are called tuples.
• A sequence with k elements is a k-tuple.
• Thus (7, 21, 57) is a 3-tuple.
• A 2-tuple is also called an ordered pair.
Sequences and Tuples (Cont.)
• Sets and sequences may appear as elements of other
sets and sequences.
• For example, the power set of A “i.e., P(s)” is the set
of all subsets of A.
o If A is the set { 0, 1 } ,the power set of A is the set
{ ∅ , { 0 } , { 1 } , { 0, 1 } } .
o The set of all ordered pairs whose elements are 0s
and 1s is { (0, 0), (0, 1), (1, 0), (1, 1) } .
• The power set (or powerset) of any set S is the set of
all subsets of S, including the empty set and S itself,
denoted as 𝒫(S).
Sequences and Tuples (Cont.)
• If A and B are two sets, the Cartesian product or cross
product of A and B, written A × B, is the set of all
ordered pairs wherein the first element is a member of
A and the second element is a member of B, A × B = { (a,
b) | a ∈ A and b ∈ B }.
 Example 0.1: If A = { 1, 2 } and B = { x, y, z },
― A × B = { (1, x), (1, y), (1, z), (2, x), (2, y), (2, z) }.
• The set N2 equals N × N .
o It consists of all ordered pairs of natural numbers.
o We also may write it as N × N { (i, j) | i, j ≥ 1 }.
Sequences and Tuples (Cont.)
• We can also take the Cartesian product of k sets,
― A1, A2, . . ., Ak, written A1 × A2 × · · · × Ak.
― It is the set consisting of all k-tuples (a1, a2, . . ., ak),
where ai ∈ Ai.
― A × B × C = { (a, b, c) | a ∈ A, b ∈ B, and c ∈ C }.
― A1 × A2 × Ak = { (a1, a2, ak) | ai ∈ Ai for all i}.
 Example 0.2: If A = { 1, 2 } and B = { x, y, z },
― A × B × A = { (1, x, 1), (1, x, 2), (1, y, 1), (1, y, 2), (1, z,
1), (1, z, 2), (2, x, 1), (2, x, 2), (2, y, 1), (2, y, 2), (2, z,
1), (2, z, 2) }.
― A × ∅ = {} = ∅.
Sequences and Tuples (Cont.)
• If we have the Cartesian product of a set with itself,
we use the shorthand:
𝑘
• A × A × … × A = 𝐴𝑘
• Example 0.3: The set N2 equals N × N . It consists of
all ordered pairs of natural numbers. We also may
write it as N × N ={ (i, j) | i, j ≥ 1 } .
Functions and Relations
― Functions are central to mathematics.
― A function is an object that sets up an input–
output relationship.
― A function takes an input and produces an
output.
― In every function, the same input always
produces the same output.
― If f is a function whose output value is b when
the input value is a, we write, f(a) = b.
Functions and Relations (Cont.)
• A function also is called a mapping, and, if f(a)
= b, we say that f maps a to b.
• For example, the absolute value function abs
takes a number x as input and returns x if x is
positive and x if x is negative.
• Thus abs(2) = abs( − 2) = 2.
• Addition is another example of a function,
written add. The input to the addition
function is an ordered pair of numbers, and
the output is the sum of those numbers.
Functions and Relations (Cont.)
• The set of possible inputs to the function is called
its domain.
• The outputs of a function come from a set called
its range.
• The notation for saying that f is a function with
domain D and range R is f : D → R.
• In the case of the function abs, if we are working
with integers, the domain and the range are Z , so
we write abs : Z → Z.
Functions and Relations (Cont.)
• In the case of the addition function for integers,
the domain is the set of pairs of integers Z × Z and
the range is Z, so we write add : Z × Z → Z.
• Note that a function may not necessarily use all
the elements of the specified range.
• The function abs never takes on the value − 1
even though − 1 ∈ Z .
• A function that does use all the elements of the
range is said to be onto the range.
Functions and Relations (Cont.)
• We may describe a specific function in several
ways.
 One way is with a procedure for computing an
output from a specified input.
 Another way is with a table that lists all
possible inputs and gives the output for each
input.
Functions and Relations (Cont.)
 Example 0.4:
• Consider the function f: { 0, 1, 2, 3, 4 } → { 0, 1, 2, 3, 4 }.
• This function adds 1 to its input and then outputs the
result modulo 5.
• A number modulo m is the remainder after division by
m.
n f(n)
0 1
1 2
2 3
3 4
4 0
Functions and Relations (Cont.)
 Example 0.5:
• Sometimes a two-dimensional table is used if the domain
of the function is the Cartesian product of two sets.
• Here is another function, g: Z4 × Z4 → Z4.
• The entry at the row labeled i and the column labeled j in
the table is the value of g(i, j).
• The function g is the addition function modulo 4.
g 0 1 2 3
0 0 1 2 3
1 1 2 3 0
2 2 3 0 1
3 3 0 1 2
Functions and Relations (Cont.)
• When the domain of a function f is A1 × · · · × Ak
for some sets A1 , . . . , Ak, the input to f is a k-
tuple (a1, a2, . . . , ak) and we call the ai the
arguments to f.
― A function with k arguments is called a k-ary
function, and k is called the arity of the function.
― If k is 1, f has a single argument and f is called a
unary function.
― If k is 2, f is a binary function.
Functions and Relations (Cont.)
―Binary function g(a, b)
―K-ary function h(a, b, c, d)
―Unary function f(a)
 Certain familiar binary functions are written in a
special infix notation, with the symbol for the
function placed between its two arguments (e.g., a +
b), rather than in prefix notation, with the symbol
preceding (e.g., - a).
o For example, the addition function add usually is
written in infix notation with the + symbol between
its two arguments as in a + b instead of in prefix
notation add(a, b).
Functions and Relations (Cont.)
• A predicate or property is a function whose range is {
TRUE, FALSE }. “P: Domain −→ {TRUE, FALSE}”
o For example, let even be a property that is TRUE if its
input is an even number and FALSE if its input is an odd
number.
o Thus even(4) = TRUE and even(5) = FALSE.
 A property whose domain is a set of k-tuples A × · · · × A
is called a relation, a k-ary relation, or a k-ary relation
on A.
 A common case is a 2-ary relation, called a binary
relation.
Functions and Relations (Cont.)
• When writing an expression involving a binary
relation, we customarily use infix notation.
― Relation: “R: A × A × · · · × A −→ {TRUE, FALSE}”
 For example, “less than” is a relation usually written
with the infix operation symbol <. “Equality”, written
with the = symbol, is another familiar relation.
o If R is a binary relation, the statement aRb means that
aRb = TRUE.
o Similarly, if R is a k-ary relation, the statement R(a1, . . .
, ak) means that R(a1, . . . , ak) = TRUE.
Functions and Relations (Cont.)
 In a children’s game called Scissors–Paper–Stone, the two
players simultaneously select a member of the set { SCISSORS,
PAPER, STONE } and indicate their selections with hand
signals.
o If the two selections are the same, the game starts over.
o If the selections differ, one player wins, according to the
relation beats.
 From this table we determine that SCISSORS beats PAPER is
TRUE and that PAPER beats SCISSORS is FALSE.
beats SCISSORS PAPER STONE
SCISSORS FALSE TRUE FALSE
PAPER FALSE FALSE TRUE
STONE TRUE FALSE FALSE
Functions and Relations (Cont.)
• Sometimes describing predicates with sets instead of
functions is more convenient.
• The predicate P : D −→{ TRUE, FALSE } may be written
(D, S), where S = { a ∈ D | P (a) = TRUE } , or simply S if
the domain D is obvious from the context.
 Hence the relation beats may be written
₋ { (SCISSORS, PAPER), (PAPER, STONE), (STONE, SCISSORS) }.
Functions and Relations (Cont.)
• A special type of binary relation, called an equivalence
relation, captures the notion of two objects being
equal in some feature.
• A binary relation R is an equivalence relation if R
satisfies three conditions:
1. R is reflexive if for every x, xRx; “∀𝑥. 𝑥𝑅𝑥”
2. R is symmetric if for every x and y, xRy implies yRx;
and “∀𝑥, 𝑦. 𝑥𝑅𝑦 → 𝑦𝑅𝑥”
3. R is transitive if for every x, y, and z, xRy and yRz
implies xRz. “∀𝑥, 𝑦, 𝑧. 𝑥𝑅𝑦 𝑎𝑛𝑑 𝑦𝑅𝑧 → 𝑥𝑅𝑧“
Functions and Relations (Cont.)

• Example 0.6:
o S = R (Let R be the set of real numbers*), xRy, if x < y.
― x ≮ x, so R is not reflexive.
― If x < y, then y ≮ x, R is not symmetric.
― If x < y and y < z, then x < z, so R is transitive.
― Then, xRy IS NOT an equivalence relation.

• A real number is one that has a decimal representation.


• The numbers π = 3.1415926. . . and √𝟐 = 1.4142135. . .
are examples of real numbers.
Graphs
• An undirected graph, or simply a graph, is a set
of points with lines connecting some of the
points.
• The points are called nodes or vertices, and the
lines are called edges, as shown in the following
figure.

FIGURE 0.12
Examples of graphs
Graphs (Cont.)
• The number of edges at a particular node is
the degree of that node.
• In Figure 0.12(a), all the nodes have degree 2.
• In Figure 0.12(b), all the nodes have degree 3.
Graphs (Cont.)
 No more than one edge is allowed between any
two nodes.
 We may allow an edge from a node to itself,
called a self-loop, depending on the situation.
 In a graph G that contains nodes i and j, the pair
(i, j) represents the edge that connects i and j.
 The order of i and j doesn’t matter in an
undirected graph, so the pairs (i, j) and (j, i)
represent the same edge.
Graphs (Cont.)
• Sometimes we describe undirected edges with
unordered pairs using set notation as in { i, j } .
• If V is the set of nodes of G and E is the set of
edges, we say G = (V, E).
• We can describe a graph with a diagram or
more formally by specifying V and E.
Graphs (Cont.)
 For example, a formal description of the graph in Figure
0.12(a) is:
― “({ 1, 2, 3, 4, 5 } , { (1, 2), (2, 3), (3, 4), (4, 5), (5, 1) })”,
 And a formal description of the graph in Figure 0.12(b) is:
― “({ 1, 2, 3, 4 } , { (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4) })”.
Graphs (Cont.)
 Graphs frequently are used to represent data.
 Nodes might be cities and edges the connecting
highways,
 Or nodes might be people and edges the
friendships between them.
 Sometimes, for convenience, we label the nodes
and/or edges of a graph, which then is called a
labeled graph.
Graphs (Cont.)
• Figure 0.13 depicts a graph whose nodes are cities
and whose edges are labeled with the dollar cost of
the cheapest nonstop airfare for travel between
those cities if flying nonstop between them is
possible.

FIGURE 0.13
Cheapest nonstop airfares between various cities
Graphs (Cont.)
 We say that graph G is a subgraph of graph H if
 The nodes of G are a subset of the nodes of H, and
 The edges of G are the edges of H on the
corresponding nodes.
 The following figure shows a graph H and a subgraph
G.

FIGURE 0.14
Graph G (shown darker) is a subgraph of H
Graphs (Cont.)
 A path in a graph is a sequence of nodes connected
by edges.
 A simple path is a path that doesn’t repeat any
nodes.
 A graph is connected if every two nodes have a path
between them.
 A path is a cycle if it starts and ends in the same
node.
 A simple cycle is one that contains at least three
nodes and repeats only the first and last nodes.
Graphs (Cont.)
• A graph is a tree if it is connected and has no simple
cycles.
• A tree may contain a specially designated node called the
root.
• The nodes of degree 1 in a tree, other than the root, are
called the leaves of the tree.

FIGURE 0.15: (a) A path in a graph, (b) a cycle in a graph, and (c) a tree
Graphs (Cont.)
o Trees:

 Graph with directed edges.


 No cycles.
 Root node.
 DAG (directed acyclic graph): Shared Parents allowed.
Graphs (Cont.)
• A directed graph has arrows instead of lines, as
shown in the following figure.

Outdegree

FIGURE 0.16: A directed graph Indegree

• The number of arrows pointing from a particular


node is the outdegree of that node,
• And the number of arrows pointing to a particular
node is the indegree.
Graphs (Cont.)
• In a directed graph, we represent an edge from i to j as
a pair (i, j).
• The formal description of a directed graph G is (V, E),
where V is the set of nodes and E is the set of edges.
• The formal description of the graph in Figure 0.16 is:
 “( { 1,2,3,4,5,6 } , { (1,2), (1,5), (2,1), (2,4), (5,4), (5,6), (6,1), (6,3) } )”.
Graphs (Cont.)
• A path in which all the arrows point in the same
direction as its steps is called a directed path.
• A directed graph is strongly connected if a directed
path connects every two nodes.
• Directed graphs are a handy way of depicting binary
relations.
• If R is a binary relation whose domain is D × D, a
labeled graph G = (D, E) represents R, where E = { (x,
y) | xRy }.
Graphs (Cont.)
 Binary relation ≡ directed graph.
• (≡ equivalence, identical to)
• R(a, b) = TRUE , aRb a b
 Example 0.17:

FIGURE 0.18
The graph of the relation beats
Strings and Languages
• Strings of characters are fundamental building blocks
in computer science.
• The alphabet over which the strings are defined may
vary with the application.
• For our purposes, we define an alphabet to be any
nonempty finite set.
• The members of the alphabet are the symbols of the
alphabet.
• We generally use capital Greek letters Σ and Γ to
designate alphabets and a typewriter font for
symbols from an alphabet.
Strings and Languages (Cont.)
 The following are a few examples of alphabets.
o Σ 1 = { 0,1 }
o Σ 2 = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }
o Γ = { 0, 1, x, y, z }

― Σ = Alphabet = Set of Symbols.


― Σ= {a, b, c, d} (Always a finite set!)
― A string over an alphabet is a finite sequence of symbols from that
alphabet, usually written next to one another and not separated
by commas.
― STRING = A finite sequence of symbols. (baccadda).
Strings and Languages (Cont.)
• If Σ 1 = { 0,1 } , then 01001 is a string over Σ 1.
• If Σ 2 = { a, b, c, . . . , z } , then abracadabra is a string
over Σ 2.
• If w is a string over Σ, the length of w, written | w |,
is the number of symbols that it contains.
• The string of length zero is called the empty string
and is written ε (Epsilon).
• The empty string plays the role of 0 in a number
system.
Strings and Languages (Cont.)
• ε = Empty string = Epsilon (also ε).
• Length of a string.
• W = baccada.
• |W| = |baccada| = 7.
• | ε | = 0.
 If w has length n, we can write w = w1 w2 · · · wn where
each wi ∈ Σ.
 The reverse of w, written wR , is the string obtained by
writing w in the opposite order (i.e., wn wn−1 · · · w1).
 String z is a substring of w if z appears consecutively
within w.
― For example, cad is a substring of abracadabra.
Strings and Languages (Cont.)
• If we have string x of length m and string y of length
n, the concatenation of x and y, written xy, is the
string obtained by appending y to the end of x, as in
x1 · · · xmy1 · · · yn.
• To concatenate a string with itself many times, we
𝑘
use the superscript notation xk to mean 𝑥𝑥 … 𝑥 .
― xy = concatenation.
― xR = reverse of x.
― x = bac, y = cada, then xy= baccada and xR = cab.
Strings and Languages (Cont.)
• A language is a set of strings.
• L 1 = {ab, bc, ac, dd}.
• L 2 = {ε, ab, abab, ababab, …. }.
• ε = The empty string.
• The empty language: {} = ∅.
• The language containing only ε: L 3= {ε}.
Strings and Languages (Cont.)
 The lexicographic order of strings is the same as the
familiar dictionary order.
 We’ll occasionally use a modified lexicographic order,
called shortlex order or simply string order, that is
identical to lexicographic order, except that shorter
strings precede longer strings.
 Thus the string ordering of all strings over the
alphabet { 0,1 } is:
o (ε, 0, 1, 00, 01, 10, 11, 000, . . .).
Strings and Languages (Cont.)
 Say that string x is a prefix of string y if a string z exists where
xz = y, and that x is a proper prefix of y if in addition x ≠ y.
 A language is a set of strings.
 A language is prefix-free if no member is a proper prefix of
another member.
o How to describe languages?
― Enumeration: {b, ac, da}.
― Regular Expressions: c (ab)*(d/c)*.
― Context-Free Grammars: S → dTd, T → TT|aTb|ε
― Set Notation: {x|x ∈…}
----------------------------------------------------------------------------------
* regular expression stands for all the strings begin with the c and
then have zero or more occurrences of ab followed by either d
or c.

You might also like