SECTION A – Multivariable Calculus and Linear Algebra
Multivariable Calculus and Linear Algebra
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ENGSCI 211
ENGINEERING SCIENCE
Mathematical Modelling 2
Term Test 2
(Time allowed: TWENTY FOUR hours)
NOTE: This test should take approximately one hour to complete.
This test is made up of TWO sections:
* Section A – Multivariable Calculus and Linear Algebra: Answers are to
be written on paper, and a PDF, DOC or DOCX file with your scanned
or photographed answers is to be submitted to the Canvas Assignment
dropbox for Section A.
* Section B – Data Analysis: Answers to each part (including R commands
and output) are to be typed into the R Notebook or Word template for
this section. Submit your knitted Notebook as a PDF, DOCX or HTML
file or your final Word document with your answers to Section B into the
Canvas Assignment dropbox for Section B.
Show all working. Marks may be deducted if key steps are missing.
An appendix containing R output for Section B, and the formula sheet, is
attached to the back of this booklet.
Question 1 2 3 4 Total
Out of 8 7 10 10 35
Page 1 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
SECTION A – Multivariable Calculus and Linear Algebra
Question 1 – Multivariable Integration (8 marks)
Consider the following double integral:∫ 16
4
∫ √y
1
f(x, y) dx dy
(a) Sketch the region of integration. Label all intercepts and axes. (2 marks)
1 2 3 4
4
8
12
16
x =
√
y ⇒ y = x2
x
y
(b) Re-write the integral after changing the order of integration. (3 marks)
Between x = 1 to x = 2 (rectangular bit):
∫ 2
1
∫ 16
4
f(x, y) dy dx
Between x = 2 to x = 4 (curved bit):
∫ 4
2
∫ 16
x2
f(x, y) dy dx
(c) We wish to integrate the function g(x, y) = x2 + y2 + 2 in the area bounded by a circle
of radius 5 centered at the origin, and where y ≥ 0.
Re-write this integral in polar coordinates.
Do NOT evaluate this integral – there are no marks for this. (3 marks)
Substituting x = r cos θ and y = r sin θ gives:∫∫
(x2 + y2 + 2) dx dy =
∫ pi
0
∫ 5
0
(r2 + 2)r dr dθ
Page 2 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
Question 2 – Linear Algebra (7 marks)
(a) Find the PLU factorisation of:
A =
2 3 02 3 2
−4 −7 3
such that PA = LU . Show all working. (3 marks)
Initialisation:
P (0) = I L(0) =
1 0 0? 1 0
? ? 1
U (0) =
2 3 02 3 2
−4 −7 3
After row operations R2 −R1 → R2 and R3 + 2R1 → R3:
P (2) = I L(2) =
1 0 01 1 0
−2 ? 1
U (2) =
2 3 00 0 2
0 −1 3
After row operation R2 ↔ R3:
P =
1 0 00 0 1
0 1 0
L =
1 0 0−2 1 0
1 0 1
U =
2 3 00 −1 3
0 0 2
Page 3 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
(b) Consider the system of linear equations, A~x = ~b: 0 2 11 2 −1
−1 −6 −1
x1x2
x3
=
1−4
2
Use the PLU factorisation of A:0 1 01 0 0
0 0 1
0 2 11 2 −1
−1 −6 −1
=
1 0 00 1 0
−1 −2 1
1 2 −10 2 1
0 0 0
to determine the rank of A. If a unique solution to A~x = ~b exists, find it. If many
solutions exist, find the solution vector that satisfies x3 = 1. (4 marks)
The rank of A is equal to the the number of non-zero rows of U i.e. rank (A) = 2
A unique solution does not exist. Solving step 1:
L~y = P~b 1 0 00 1 0
−1 −2 1
x1x2
x3
=
0 1 01 0 0
0 0 1
1−4
2
~y =
−41
0
Solving step 2 with x3 = 1:
U~x = ~y1 2 −10 2 1
0 0 0
x1x2
1
=
−41
0
~x =
−30
1
Page 4 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
SECTION B – Data Analysis
Answers for Section B (Questions 3 and 4) are to be typed into the R Notebook or Word
template provided for Test 2 – Section B.
Submit your knitted R Notebook as a HTML, DOCX or PDF file, or your final Word
document, to the Canvas Assignment dropbox for Section B.
Question 3 (10 marks)
Question 3 requires you to conduct an analysis in RStudio or R on the dataset described
below. The dataset is available on Canvas as the file bus25Data.txt.
It is claimed that bus services in Auckland are busier on Mondays than on Fridays. To verify
this claim, data was collected on the number of people that board the Dominion Road bus
services (25B and 25L) on Mondays and Fridays during University of Auckland teaching
weeks in 2019. In 2019, the University was open for teaching on 23 Mondays and 24 Fridays.
Estimate the difference in the average number of boardings between Mondays and Fridays,
and hence comment on whether the collected data support the claim.
The file bus25Data.txt contains the following variables:
Boardings Number of recorded boardings on the Dominion Road bus services 25B and 25L.
Weekday Weekday of observation, either Monday or Friday
Source: Auckland Transport.
(a) Why is this NOT an example of a paired analysis? What additional information is
required to conduct a paired analysis on this dataset? (2 marks)
We do not have the same number of observations on Mondays as on Fridays OR we do
not know the date of each observation so cannot pair them by week. 3
We require the date that each observation is made to make it a paired analysis. 3
NOT SUFFICIENT: We need an extra Monday observation OR we need to track indi-
vidual people’s behaviour.
(b) Conduct the appropriate analysis in R to answer the question. Your analysis should
contain the following, similar to the Case Studies and Assignment:
exploratory analysis
checking modelling assumptions
appropriate statistical inference, i.e. hypothesis tests and/or confidence intervals
Either prepare your analysis in the R Notebook, or copy and paste your R commands
and output into the Word template. You are not required to annotate your analysis.
If you are using R 4.0.0, you may need to explicitly make Weekday a factor.
See Block 4 Slide 6 for an example of the command required. (2 marks)
Page 5 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
library(s20x)
bus25.df = read.table("bus25Data.txt", header = TRUE)
boxplot(Boardings ~ Weekday, data = bus25.df)
Friday Monday
95
00
10
50
0
11
50
0
Weekday
Bo
ar
di
ng
s
normcheck(lm(Boardings ~ Weekday, data = bus25.df))
eovcheck(Boardings ~ Weekday, data = bus25.df)
Theoretical Quantiles
Sa
m
pl
e
Qu
an
tile
s
Fitted values
R
es
id
ua
ls
t.test(Boardings ~ Weekday, data = bus25.df, var.equal = TRUE)
##
## Two Sample t-test
##
## data: Boardings by Weekday
## t = 3.9502, df = 45, p-value = 0.0002722
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 314.3441 968.3479
## sample estimates:
## mean in group Friday mean in group Monday
## 10785.04 10143.70
3Exploratory plot (box plot or onewayPlot())
3inference with confidence interval
Also acceptable: Welch test – interval (314.6684, 968.0236), or
confint(bus25.lm)
## 2.5 % 97.5 %
## (Intercept) 10556.2895 11013.7939
## WeekdayMonday -968.3479 -314.3441
multipleComp(bus25.lm)
## Estimate Tukey.L Tukey.U Tukey.p
## 641.3460 314.3441 968.3479 0.0003
Page 6 of 8
QUESTION / ANSWER BOOKLET
UoA Username:
ENGSCI 211
(c) Comment on the exploratory analysis you conducted on this dataset. (3 marks)
Center: Fridays higher than Mondays 3
Spread: About the same 3
Skew: Both look relatively symmetrical 3
Alternatively, can discuss each group separately (approx numbers are OK):
Center: Mon: approx 10000, Fri: approx 11000
Spread: Mon: Between 9000 to 11000, Fri: Between 9700 to 11700.
Skew: Both symmetrical
(d) Write a brief Executive Summary explaining the findings of the analysis that you
have conducted. (3 marks)
Our interest in the data is to estimate the difference in the average number of boardings
on Dominion Road bus services between Mondays and Fridays. 3 Intro
We estimate that the average number of Boardings on Fridays is between 314 to 968
persons more than that on Mondays. 3 CI interpretation, deduct 0.5 marks if average
or mean not mentioned somewhere or inappropriate rounding (0 or 1 dp acceptable).
No marks if 641 is the only difference reported.
The claim that buses are busier on Mondays than Fridays does not appear to be sup-
ported by this dataset. 3 conclusion that answers question.
Deduct 1 mark for technical language: e.g. Normality, equal variance, R2, ...
Page 7 of 8
ENGSCI 211QUESTION / ANSWER BOOKLET
UoA Username:
Question 4 (10 marks)
(a) Comment on the validity of the following claim:
For any statistical analyses, a 90% confidence interval will provide a more
accurate estimate of the true population mean than the corresponding 95%
confidence interval.
(2 marks)
The 90% CI will generally be narrower than the 95% CI 3
But the 90% CI is more likely to ‘miss’ the true population mean (under repeated
sampling) as a result / 95% CI more likely to contain the true mean. 3
The following questions refer to the analysis shown in Appendix: Scottish Hill Races.
(b) Comment on the output of eovcheck(hills.fit1). (1 mark)
The equality of variance assumption does not appear to be satisfied, as we see a clear
‘fan effect’ or non-constant scatter. 3
(c) With reference to appropriate diagnostic plot(s), comment on whether the Normality
assumption is satisfied by the model hills.fit2. (1 mark)
The Q-Q plot shows the residuals are not normally distributed as points are not all on
straight line / have short tails. (0.5 marks for any reasonable comment on Q-Q plot)
The Central Limit Theorem applies as we have 35 observations, so Normality is satisfied
(0.5 marks)
(d) Write a brief Executive Summary explaining the findings of the analysis carried out
in the Appendix. (4 marks)
Our interest in the data is to determine the relationship between map distance and the
total vertical elevation gained in Scottish hill races. 3 Intro
We estimate that, for a 1 mile increase in map distance, the median total vertical
elevation gained increases by between 1.10 and 1.21 times / 10% to 21%.
3 Interpretation of the back-transformed interval (NOT 0.096, 0.188). An interval
must be reported.
3 Refer to median, and in multiplicative (... times) or percentage change terms
Our model explains 55% of the total variation in total elevation gain. 3R2 interpretation
Deduct 1 mark for technical language: e.g. Normality, equal variance, R2, ...
(e) Give an appropriate estimate for the average total vertical elevation, for hill races with
a map distance of 7 miles. State clearly whether your estimate relates to the mean or
median. (2 marks)
Median 3 between 1075 and 1585 ft. 3
Not acceptable:
point estimate 1305 ft, or
the non-backtransformed value 7.17, or (6.98, 7.37), or
the prediction interval (413, 4123)