Professional Documents
Culture Documents
MAT9004 - Week 1
Topics for week 1
Notation
What is a set?
Notation for sums and products
Functions
What is a function?
Zeroes
Inverse functions
Convexity
2 / 35
Sets
Examples:
{1, 2, 3, 4, 5} is the set of integers 1, . . . , 5.
{a, b, c, d} is the set of letters a, . . . , d.
{{a, b}, {c, d}} is the set of sets {a, b}, {c, d}.
3 / 35
We write x ∈ S if x is an element of the set S.
We write x ∈
/ S if x is not an element of S.
Examples:
1 ∈ {1, 2, 3, 4, 5}.
−3 ∈ Z.
1
3 ∈
/ N.
Examples:
{x ∈ N : x is even} = {0, 2, 4, 6, 8, . . .}.
{x ∈ {1, . . . , 6} : x is a prime number} = {2, 3, 5}.
{x ∈ Z : −1 6 x 6 1} = {−1, 0, 1}.
4 / 35
Intervals
For real numbers a and b with a < b:
The set [a, b] contains all real numbers between a and
b (including a, b); [a, b] is called the closed interval
from a to b.
The set (a, b) contains all elements of [a, b] except for
a and b; (a, b) is called the open interval from a to b
6 / 35
Sigma notation
If a and b are integers with a 6 b and f is a function, then
b
X
f (x) = f (a) + f (a + 1) + · · · + f (b).
x=a
Examples.
3 4
X 1 1 1 X
=1+ + . x 2 = 4 + 9 + 16.
x 2 3
x=1 x=2
X
f (x) denotes the sum of f (x) over all x ∈ S.
x∈S
Example. X
x 2 = (−2)2 + 22 = 8
x∈{−2,2}
7 / 35
Product notation
Examples.
4
Y 5
Y
x = 1 × 2 × 3 × 4 = 24, (x 2 − 1) = 8 × 15 × 24.
x=1 x=3
Y
Again, f (x) denotes the product of f (x) over all x ∈ S.
x∈S
8 / 35
Exercise
Rewrite without using Sigma or product notation.
X3
ax = a + a2 + a3
x=1
X
(2x − 5) = (−1) + 5 + 9 = 13
x∈{2,5,7}
5
Y 1 1 1 1
= 4 × 5 = 20
y
y =4
5
X
1 = 1+1+1+1+1=5
x=1
9 / 35
Exercise
Rewrite in Sigma notation
X4
1+3+5+7 = (2x − 1)
x=1
10
X
1 − 2 + 3 − 4 + · · · − 10 = (−1)i+1 i
i=1
Rewrite in product notation
4
1 1 1
Y 1
4 × 9 × 16 =
x2
x=2
10 / 35
Why do we need functions?
11 / 35
Functions
Suppose that X and Y are two sets
Examples.
The function f : R → R, f (x) = x 2 , assigns to each real
number x the square x 2 of the number.
We can also define a function by listing its values:
x 1 2 3
defines a function f : {1, 2, 3} → {1, 2}.
f(x) 1 1 2
12 / 35
Function graphs
The graph of f : X → Y is the set {(x, f (x)) : x ∈ X }.
-2 -1 1 2
2
Figure: The graph of f (x) = x
13 / 35
The image f (X ) of a function f is the set {f (x) : x ∈ X }
14 / 35
Zeroes
Examples. 20
15 / 35
Inverse Functions
f −1 : Y → X is called inverse function of f : X → Y if
f −1 (f (x)) = x and f (f −1 (y )) = y for all x ∈ X and y ∈ Y .
Examples.
f (x) = 2x + 1 is bijective
f : R → R with f (x) = x 2 is neither injective nor surjective
f : [0, ∞) → [0, ∞) with f (x) = x 2 is bijective
17 / 35
Exercise
Consider the functions f1 : R → R and f2 : R → R below.
What are the zeroes of the functions?
Are the functions injective? Are they surjective?
4 y
20
3
15
10
2
5
x
-3 -2 -1 1 2 3
1
-5
-10
-2 -1 1 2 -15
18 / 35
Exercise
A function is convex if, for any two points in its plot, the
straight line between both points is entirely above (or touch-
ing) the plot of the function.
Example 1
4 4
3 3
2 2
1 1
-2 -1 1 2 -2 -1 1 2
20 / 35
Concave functions
A function is concave if, for any two points in its plot, the
straight line between both points is entirely below (or touch-
ing) the plot of the function.
Example
-1
-2
-3
21 / 35
Side note
22 / 35
Predicting data with functions
250
4
200
3
150
y
y
100
1
50
5 10 15 20 5 10 15 20
x x
16
14
5.0
12
4.5
10
y
y
8
4.0
6
3.5
4
10 15 20 25 10 15 20 25 30 35 40
x x
23 / 35
Linear functions
f (x) = mx + b
Examples
f (x) = 21 x − 1
f (x) = −2x + 3
f (x) = 1
24 / 35
Geometric interpretation of m and b
f (x) = mx + b
For each ‘step’ to the right take m steps up (if m > 0)
If m is negative, say m = −q, take q steps down instead
b is the y -coordinate where f intersects with the y -axis.
Figure: f (x) = 12 x − 1
25 / 35
Fitting a linear function through two data points
5
4
3
y
2
1
5 10 15 20
26 / 35
Example
Finding a linear function passing through (1, 3) and (2, 4):
Option 1.
A linear function is of the form f (x) = mx + b.
Passing through the points means f (1) = 3 and f (2) = 4, i.e.
3 = m × 1 + b,
4 = m × 2 + b.
29 / 35
Example: Market of watermelons
n − th year: price Pn , supply Qn .
Experience: When Qn increases, Pn decreases. When Pn
increases, Qn+1 increases.
Mathematical model:
(
Pn = a − bQn ,
Qn+1 = c + dPn .
where a, b, c, d are parameters, to be determined.
30 / 35
Polynomial functions
A polynomial function of degree n is a function with
Examples
f (x) = x 3 + 2x 2 − x + 21 is a polynomial function of degree 3
f (x) = −0.3 is a polynomial function of degree 0
f (x) = 21 (x − 2)2 + 3 is a polynomial function of degree 2
Linear functions (with m 6= 0) are polynomials of degree 1
Sigma notation. Recall that we can also write
n
X
f (x) = ai x i .
i=0
31 / 35
Approximation with polynomials
In Theory
Suppose we are given n + 1 data points (x0 , y0 ), . . . , (xn , yn ).
We can always try to find a polynomial of degree n that
passes through all data points
This requires solving a system of n + 1 linear equations. We
will learn how to do that in a couple of weeks
In Practice
For very large data sets (large n) this might be unnecessarily
complicated and inefficient
We might permit some “noise” into the model – find simple
functions that are a reasonable approximation of data
32 / 35
How about these data points?
250
200
150
y
100
50
5 10 15 20
33 / 35
600
500
20
400
15
y^(1/2)
300
y
200
10
100
5
0
5 10 15 20 25 30 35 5 10 15 20 25 30 35
x x
34 / 35
Exercise
Find real numbers a and c such that the function
f (x) = ax 2 + c passes through the points (2, 4) and (4, 10)
a × 22 + c = 4,
a × 42 + c = 10
4 − 4a = 10 − 16a.
35 / 35