MetNum1 2023 1 Week 9 With Worked Examples
MetNum1 2023 1 Week 9 With Worked Examples
Semester 2023/1
Week 9
1
Course overview
2
Evaluation for Part 2
1. Quiz (10%)
2. Homework assignment (10%)
3. Final exam (30%)
Note: There will be at least 1 quiz and 3 homework assignments. However, the
schedule and topics depend on the flow of the class.
3
Topics covered in Part 2
Week Title
Week 9 Introduction to statistics and probability
Week 10 Descriptive statistics and sampling techniques
Week 11 Probability theory
Week 12 Discrete and continuous probability distributions
Week 13 Variance, co-variance, and correlation
Week 14 Statistical inference methods
Week 15 Statistical analysis using Octave/MATLAB
Week 16 UAS
4
Course Materials
All materials used in the class (e.g. lecture slides, worked examples) will be
uploaded to the e-learning system.
Note that the content of this course is very introductory in nature and can be
found in many books or sources. Some suggested references include:
5
Outline
6
Topic 1:
What is statistics?
7
Quote of the week
8
Definition of statistics
üMake decisions
ü Solve problems
9
What is data?
10
Types of data
11
Interval vs ratio scales
An interval scale is one where there is order and the difference between two
values is meaningful (e.g. time, temperature in Celsius).
A ratio scale has all the properties of an interval scale, but the minimum value
(starting point) is 0. Hence, the ratio between two quantities is meaningful (e.g.
weight, length, temperature in Kelvin).
12
Statistics in daily life
13
Statistics in daily life
14
Sampling
15
Example: population and sample
Clearly, it would not be feasible to telephone every single adult, so the survey
makers generalize about the whole population based on the sample!
16
Branches of statistics
17
Variability
19
Dot diagrams
• A dot diagram is a useful plot for displaying small sets of data (up to 20
observations).
• This plot allows us to easily see two features of the data: the location (or the
central value), and the scatter (or how spread apart the measurements are).
20
Worked Example 1: dot diagrams
A water treatment plant is designed to
ensure that the chlorine (Cl−) concentration
of effluent water varies between 12 and 14
ppm. For monitoring purposes, 8 effluent
samples were collected at different times
over a period of 24 hours and their Cl−
concentrations (in ppm) were measured,
as follows:
21
Worked Example 1: dot diagrams
Solution:
Cl− concentration
Using this diagram, we can easily see that the water treatment plant achieved its
target.
22
Class Exercise 1: variability
23
Topic 2:
Simple probability
24
What is probability?
For example, if you roll a die (plural: dice), how likely are you to get a 6? If
you toss a coin, how likely are you to get a head?
25
Quantifying probability
26
Random experiment
Another example would be choosing an object from a set of objects that look
identical, but all have different properties (e.g., a deck of playing cards face
down).
27
Simple probability
In general, for a random event, the probability of the event occurring is given
by
number of favorable outcomes
𝑃 event =
number of possible outcomes
28
Worked Example 1: simple probability
If I toss two coins in succession, what is the probability of getting one head (H)
and one tail (T)?
Solution:
The four possible outcomes for tossing two coins are
HT, HH, TT, TH
2 1
𝑃 HT or TH = =
4 2
29
Visualizing probability
In probability, it is often
helpful to visualize the
problem, especially for
more complex situations.
30
Tree diagrams
A tree diagram consists of ‘branches’ that are labelled with probabilities. For
example, consider tossing a single coin:
Note that the sum of the probabilities for all the branches leaving a single point
(or node) is 1.
31
Worked Example 2: tree diagrams
32
Worked Example 2: tree diagrams
To find the probability over multiple distinct outcomes (draws), multiply the values
on each branch. Hence, ! ! #
P(R1 and R2) = =
"" "" "$"
33
Venn diagrams
S Here, S
A represents a
single coin toss,
H and the event A
T
represents
getting a head.
34
Venn diagrams
Consider again the set of total outcomes for tossing two coins. We can write this as
S = { HT, HH, TT, TH }
If we define two events A and B, where A is getting tails on the first coin flip and B is getting tails on
the second coin flip. Hence,
A = { TT, TH } and B = { TT, HT }
On a Venn diagram, we can illustrate this as:
35
Worked Example 3: Venn diagrams
36
Worked Example 3: Venn diagrams
Solution:
37
Class exercise 2: probability
A survey found that 60% of Jakartans like to eat rice-based dishes for breakfast
(such as nasi kuning), 25% like to eat noodle-based dishes (such as mie goreng),
and 15% like to eat bubur ayam. If a person selects a rice-based breakfast, 60%
like to drink teh and the rest like to drink kopi. If they select mie goreng, 70% like to
drink kopi and the remainder like to drink teh. If they select bubur ayam, they are
equally likely to drink kopi or teh.
(a) Draw a probability tree diagram to show the possible outcomes.
(b) Based on this, calculate the probability that a randomly-selected Jakartan likes
to:
i. Eat rice-based dishes and drink teh for breakfast.
ii. Have kopi with their breakfast.
38
Topic 3:
Interpolation
39
Relationships between variables
40
What is interpolation?
41
Types of interpolation
42
Types of interpolation
43
Types of interpolation
Linear interpolation (lerp): data points are connected by straight lines, hence a
point (x,y) between two known points (x1,y1) and (x2,y2) is given by:
44
Types of interpolation
45
Types of interpolation
46
Polynomial vs spline interpolation
You might notice that the polynomial and spline interpolation curves in the previous two
slides look quite similar. However, they follow very different equations!
47
Multivariate interpolation
All the types of interpolation described in the previous slides can also be applied to
systems with more than two variables. This is known as multivariate interpolation.
48
Accuracy of linear interpolation
49
Accuracy of linear interpolation
50
Accuracy of linear interpolation
At
𝑥" = 2.5
𝑦" = cos 2.5$ − 2.5 + 3 = 1.4994
At
𝑥$ = 3
𝑦$ = −0.9111
51
Accuracy of linear interpolation
Therefore,
𝜀 = 2.81 − 2.83 = −0.02
53
Worked Example 4: interpolation
Solution:
The interval we are interested in is (30, 62.0) to (40, 93.2). Hence, x1 = 30, x2 = 40,
y1= 62.0, y2 = 93.2. Use the linear interpolation formula:
#!.$&'$.(
At x = 35, y = 62.0 + 35 − 30 = 77.6
)(&!(
54
Class Exercise 3: interpolation
55
Problem Set 1
56
Question 1
Toss a 6-sided die 24 times (if you do not have a real die, use a
virtual one on your smartphone/computer) and record your
results, then answer the following:
(a) Make a dot diagram of the results
(b) Based on the dot diagram, did all the different outcomes occur
the same number of times? If not, which outcome occurred the
most times?
(c) What would you expect the dot diagram to look like if you
tossed the die 600 times instead?
57
Question 2
58
Question 3
The Venn diagram shows the different majors that a group of high
school students have chosen to study in university.
59
Question 4
A chemical engineering student wants to find out the specific heat capacity of water at 70
oC and 16 bar. She looks in her thermodynamics textbook and sees the following table:
Using linear interpolation, help the student find the desired value based on the given table.
Note: you will need to interpolate in two dimensions (bilinear interpolation)!
60