Professional Documents
Culture Documents
Lecture 2
1
Subsets of numbers
There are 5 basic subsets of numbers:
2
Subsets of numbers
Integers (Z)
• The integer numbers constitute of the natural numbers
and their negative values.
• Example: …., -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, …..
3
Subsets of numbers
Irrational Numbers
• Numbers that cannot be written as a ratio of two integers
• Example: π, 2, 3 4
Subsets of numbers
5
Subclasses of the integers
6
Subclasses of the integers
Prime numbers
7
Error Analysis
Absolute error
Consider two values, as one being the true value (m) and the other is the
computed value (p).
Absolute Error (AE) is the absolute difference between the measured
value and the true value.
𝐴𝐸 = 𝑝 − 𝑚
Relative error
𝑝−𝑚 𝐴𝐸
𝑅𝐸 = =
𝑚 𝑚
8
Error Analysis
Square error
Square error (SE) between two measurements is the square of the
absolute error between the two measurements.
2
𝑆𝐸 = 𝑝 − 𝑚
𝑛
1 2
𝑀𝑆𝐸 = 𝑝𝑖 − 𝑚𝑖
𝑛
𝑖=1
10
Error Analysis
𝑛
1 2
𝑅𝑀𝑆𝐸 = 𝑝𝑖 − 𝑚𝑖
𝑛
𝑖=1
11
Error Analysis
Example
Suppose that the output of a machine learning model is 23.7. Compute
the absolute and relative error for the model if the target value is 25.
Solution
Predicted value (computed value): p= 23.7
Target value (True value): m= 25
𝐴𝐸 = 𝑝 − 𝑚 𝑝−𝑚 𝐴𝐸
𝑅𝐸 = =
𝑚 𝑚
𝐴𝐸 = 23.7 − 25 = 1.3
1.3
𝑅𝐸 = = 0.052
25
12
Error Analysis
Example
A student made a new device which Reading New device reading Reference value
1
used to measure the heart rate. He 88 88
2 107 104
recorded 10 measurements taken 3 78 78
from the new device and the 4 100 99
corresponding values which 5 68 67
measured with a calibrated device. 6 107 108
7
The measurements of the calibrated 83 82
8 88 85
device are taken as reference. 9 93 91
10 78 78
13
Error Analysis
Solution
1
1) 𝑀𝐴𝐸 = σ𝑛𝑖=1 𝑝𝑖 − 𝑚𝑖
𝑛
1
= ሾ 88 − 88 + 107 − 104 + 78 − 78 + 100 − 99 + 68 − 67
10
+ 107 − 108 + 83 − 82 + 88 − 85 + 93 − 91 + 78 − 78 ሿ = 1.2
1 𝑝𝑖 −𝑚𝑖
2) 𝑀𝑅𝐸 = σ𝑛𝑖=1
𝑛 𝑚𝑖
14
Error Analysis
Solution
3)
𝑛
1 2
𝑅𝑀𝑆𝐸 = 𝑝𝑖 − 𝑚𝑖
𝑛
𝑖=1
1
= ቆ ൣ 88 − 88 2 + 107 − 104 2 + 78 − 78 2 + 100 − 99 2
10
+ 68 − 67 2 + 107 − 108 2 + 83 − 82 2 + 88 − 85 2 + 93 − 91 2
0.5
+ 78 − 78 2 ൧ቇ = 1.61
15
Chapter 2
Solutions of Equations in One Variable
16
Solution of an equation
The solution of an equation is the value‐or values‐that a variable can take
on such that they make the equation true.
Example
Given the equation 4x - 8 = 4
It is possible for an equation to have more than one solution. This occurs
when the degree of the polynomials used is not 1
Example
Linear equations:
Degree (max power of the variable) =1
Ex. 𝟐𝒙 + 𝟑 = 𝟎 3(𝒙 + 𝟕) = 𝟓 𝟐 𝒙 + 𝟑 − 𝟏 = 𝟒𝒙
Solution Steps:
1. Carry out all distributions;
2. Regroup the variables on one side of the equal sign and the numbers
on the other;
3. Divide both sides by the coefficient of the variable.
18
Solution of linear equations in one variable
Example
Solve the equation
Solution
▪ Carry out all the distributions; ▪ Divide the two sides by the coefficient of the variable
3𝑥 27
=
3 3
𝑥=9
▪ Regroup the variables in one side
Thus, the solution for the equation is 𝑥 = 9
6𝑥 − 3𝑥 = 7 + 20
We can validate the solution by substituting 𝑥 = 9
3𝑥 = 27 in the equation
19
Solution of linear equations in one variable
Example
Solve the equation 6 2𝑥 + 3 + 𝑥 − 7 = 3 5𝑥 + 7 + 2𝑥
Solution
▪ Carry out all the distributions; ▪ Divide the two sides by the coefficient of the variable
−4𝑥 = 10
20
21