Notes Week 5
Notes Week 5
1
Lecturers: Dr Nguyen Hieu Thao & Dr Jeff Nijsse
Email: thao.nguyenhieu@rmit.edu.vn
(a) A sequence s is increasing (respectively, decreasing) if for all i and j in the domain of s,
if i < j, then si < sj (respectively, si > sj ).
(b) A sequence s is nondecreasing (respectively, nonincreasing) if for all i and j in the domain
of s, if i < j, then si ≤ sj (respectively, si ≥ sj ).
(c) A subsequence of a sequence s is a sequence obtained from s by choosing certain terms of
s in the same order in which they appear in s.
(d) If {ai }i=m is a sequence, we define
n
n n
(1)
X Y
ai = am + am+1 + · · · + an , ai = am am+1 · · · an .
i=m i=m
The formalism i=m is the sum (or sigma) notation and i=m is the product notation.
Pn Qn
In (1), i is the index, m is the lower limit and n is the upper limit.
A string over X, where X is a finite set, is a finite sequence of (repeatable) elements from
X. Since a string is a sequence, order is taken into account.
(a) Repetitions in a string can be specified by superscripts. For example, the string ‘110001’
over the binary set {0, 1} can be written as ‘12 03 1’.
(b) The string with no element is the null string and is denoted by λ.
(c) X ∗ denotes the set of all strings over X including the null string, and X + denotes the set
of all nonnull strings over X.
(d) The length of a string α, denoted by |α|, is the number of elements in α.
(e) If α and β are two strings, the string consisting of α followed by β, written αβ (or α + β),
is the concatenation of α and β.
(f) A string β is a substring of a string α if there are strings γ and δ such that α = γβδ.
1 Most of the content of this document is taken from the book [1].
2
Example. The set of all integers N is the language generated by the following grammar.
< integer > −→ < signed integer > | < unsigned integer >,
< signed integer > −→ < + >< unsigned integer > 142
| < unsigned3 integer
− >< Chapter ◆ Functions,
>, Sequences, and
< unsigned integer > −→ < digit > | < digit >< unsigned integer >,
< digit > −→ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8| | 9.
Let R be a relation from X to Y . The inverse of R, denoted by R−1 , is the relation from Y
to X defined by
R−1 = {(y, x) | (x, y) ∈ R} .
References
1. Johnsonbaugh, R.: Discrete Mathematics - Eighth Edition. Pearson Education, New York
(2018).