WTW152 Online Semester Test-2020 ST1 WTW152 Online Semester Test-2020 ST1
WTW152 Online Semester Test-2020 ST1 WTW152 Online Semester Test-2020 ST1
UNIVERSITY OF PRETORIA
FACULTY OF NATURAL AND AGRICULTURAL SCIENCES
DEPT OF MATHEMATICS AND APPLIED MATHEMATICS
Q1 Q2 Q3 Q4 Q5 Total
14 10 10 9 17 60
(1) The paper consists of pages 1 to 9. Check whether your paper is complete.
(2) Read all questions and instructions carefully. Any failure to follow instructions will be penalized.
(3) This test is individual. You are not permitted to discuss this test with anyone in any forum. Any case
of dishonesty will be reported.
(4) This test is open book. You may use any study material provided on clickUP. Use of material found on
the internet is permitted, but such material is used at your own risk and may be arbitrarily penalized
at the discretion of the examiner/grader.
(5) Submit your answers for each question separately on the provided forms on clickUP.
(6) Answers to any given question may be submitted at any time before the deadline. It is not required to
submit your answers to all questions all at once, or even on the same day.
(7) It is assumed that you are using the software packages Anaconda and LibreOffice. Use of any other
software is permitted, but you do so at your own risk and may be arbitrarily penalized at the discretion
of the examiner/grader.
(8) Use of any package in the Python3 standard library is permitted. You may only use the following
3rd party Python3 packages: numpy, sympy and matplotlib. Use of other 3rd party packages is not
permitted.
(9) It is assumed that you have all required software installed and functioning correctly on an appropriate
device. Any IT issue occurring on a personal device remains solely the responsibility of the owner of
the device. UP IT-help ([email protected]) may be contacted for assistance in the event of any IT issues.
(10) Any sick notes should be handed in within 3 days of the test deadline. Note that sick notes are required
to cover all days that submission is active to be accepted.
Question 1.
Save all files created in completing this question and upload them when filling out the online
submission form.
In this question let a, b, and c equal last three NON-ZERO digits of your student number. (E.g., if your
student number is u04535080, then a := 3, b := 5, c := 8).
Function Specification :
Input :
n : a non - negative integer
Output :
The value of gn .
The following Python3 function claims to implement the above function specification. Replace the #’s with
the values determined from your student number.
def g_recursive ( n ):
a = #
b = #
c = #
if n == 0:
return a
elif n == 1:
return b
elif n == 2:
return c
else :
return g_recursive ( a *( n -2)) + g_recursive (n -3)
Page 2 of 9
Page 3 of 9
Question 2.
Save all files created in completing this question and upload them when filling out the online
submission form.
In this question let s equal the number formed by the last three NON-ZERO digits of your student number.
(E.g., if your student number is u04535080, then s := 358.) Set A := 1000 × s and B := 10 × s.
By setting up a well-documented spreadsheet. Answer the following questions by reading off the answer from
your spreadsheet AND/OR performing an appropriate GOALSEEKs.
An investment account is opened with principal amount P rand and accrues interest of 10% per annum,
compounded monthly. After every 12th month, counting from the moment when the account is opened, a
deposit is made into the investment account. No deposits are made in the intervening months. The first
deposit amount of Q rand is made 12 months after the moment that the account is opened, and every one of
subsequent deposits is increased by 4% from the directly previous deposit amount
Page 4 of 9
Question 3.
Save all files created in completing this question and upload them when filling out the online
submission form.
Obtain the function f : R → R that is assigned to your student number from the provided appendix. Use
this function to answer the following questions.
With r0 > 0, define the difference equation rn := f (rn−1 ) for all n = 1, 2, 3....
Triple check whether you are using the correct function assigned to your student number. Triple check whether
you copied your function correctly, including all digits and signs. Any error or typos in reading/copying the
function may result in severe penalties.
Page 5 of 9
Question 4.
Save all files created in completing this question and upload them when filling out the online
submission form.
Foot-and-Mouth-Disease (FMD) is a highly infectious disease of both domestic and wild hoofed animals.
Outbreaks of FMD in farms can have devastating economic effects and severely disrupt food supply chains.
Wildlife managers at the Kruger National Park are preparing for scenarios in managing an outbreak of FMD
in the african buffalo population, by using the logistic difference equation as a mathematical model.
With M, r, y0 > 0, the logistic difference equation is defined, for n = 1, 2, 3, 4 . . ., as
Let Mbuffalo := 48000 denote the total buffalo population in the Kruger National Park. Let y0 := 1 and, with
n = 1, 2, 3, ..., let yn denote the predicted number of infected individuals in the buffalo population, n days after
the moment that a first individual buffalo became infected with FMD.
The World Veterinary Association (WVA) has developed a protocol for preventative measures to mitigate the
spread of FMD under populations of wild hoofed animals. Although these measures do not prevent outbreaks
entirely, they do slow the spread of the disease initially before an outbreak is detected. This allows more time
to allow for an active response to be mounted when an outbreak is detected.
Data measured from previous outbreaks of FMD, give values of the parameter r under the scenarios with–,
and without the suggested preventative measures. They are:
Function Specification :
Name :
logistic
Input :
n : a non - negative integer
r : a positive real number
M : a positive real number
Output :
The value of yn as defined by the logistic difference equation ,
using provided values for the parameters r and M .
Page 7 of 9
Question 5.
Save all files created in completing this question and upload them when filling out the online
submission form.
Obtain the dataset referred to in this question from the provided appendix.
A friendly military base is located on a 300m high cliff facing the ocean. With an edge on view, the sea
surface is represented by the set of points {(x, 0) ∈ R2 : x ∈ (−∞, 0]}. Ground level on the cliff is represented by
the set of points {(x, 300) ∈ R2 : x ∈ [0, ∞)}. The cliff face is represented by the set {(0, y) ∈ R2 : 0 ≤ y ≤ 300},
with the base of the cliff at the origin.
Critical buildings in the military base along with their locations are:
• The RADAR installation located at the coordinates (200m, 300m).
• The ammunition DEPOT located at the coordinates (300m, 300m).
• The missile defence LASER located at the coordinates (1000m, 300m).
An enemy submarine has sneaked into our coastal ocean undetected. The submarine has launched a number
of ballistic missiles, travelling in the positive x-direction, toward our friendly military base. A dataset of the
(x, y)-coordinates (in meters) of all incoming missiles measured over the last few minutes has just arrived from
the radar station. The radar operator is incompetent, so the data is all scrambled up.
Below is a diagram, not to scale, depicting the situation.
For future reference, we label the missiles as “missile A”, “missile B”, “missile C” and “missile D” according
to their measured y-coordinates, from highest to lowest, “missile A” being the highest, and “missile D” being
the lowest.
Page 8 of 9
Hints:
• Use the plot you made to determine an interval in which the y-coordinates of each missile falls. Write
conditional list comprehensions with each having an appropriate condition on the y-coordinate.
• There are exactly nine data points for each missile.
END
Page 9 of 9