数学|MOCK EXAM 2020-2021 INTRODUCTION TO DATA SCIENCE AND SYSTEMS

TODO 2021,
Available from TODO:TODO BST,
Expected Duration: 2 hours,
Time Allowed: 4 hours,
Timed exam within 24 hours
DEGREE of MSc
—!!!— MOCK EXAM 2020-2021 —!!!—
INTRODUCTION TO DATA SCIENCE AND
SYSTEMS (M)
Answer all 3 questions
This examination paper is worth a total of 60 marks.
1. Linear algebra and probability
In the fabrication of semiconductors, an industrial manufacturer has a process that produces
silicon wafers. Sometimes, the wafers come out defective, and have to be discarded.
(a) Every wafer has a production cost c. Every correct wafer can be sold for v; defective wafers
cannot be sold and bring in no money. Assuming the probability of a defective wafer is
written P(D = 1), where D is a random variable that may take on the values 0 and 1, write
down the expression for the expected profit of manufacturing a single wafer. [4]
Solution:
(Bookwork for knowledge of the concepts, Problem solving otherwise)
Expectation is: sum over every state (product of (probability of states, value of states))
E[ f(X)] = ∑
x
P(X = x)f(x) [1 mark for correct concept of expectation]
The profit of a correct wafer is v?c. The profit of an incorrect wafer is ?c. [1 mark for
correct idea of profit and loss]
E[ f(D)] = (correct probability)*(correct profit) + (defect probability)*(defect product)
E[ f(D)] = (1?P(D = 1))(v?c) +P(D = 1)(?c)
E[ f(D)] = (1?P(D = 1))(v?c)?P(D = 1)c [2 mark]
(b) The defect rate in one production line is 1:100000. The company learns of a new device that
can predict whether the wafer will be defective after only a few seconds with a reliability of
99%. This will allow the fabricator to pull the wafer and abort the production process before
a more expensive process begins. Explain how Bayes’ rule would help the fabricator decide
if this device is a worthwhile investment and give your recommendation based on these
figures. You do not have to provide an exact calculation but you should give approximate
figures. State any assumptions you make.
[7]
Solution: (Problem solving)
Writing T=0 to mean test is negative, and T=1 to mean test is positive (T=1 means that
the test indicates an error). Assuming that 99% reliability means that: [note: this is an
assumption and must be stated; other assumptions are valid answers]
P(T = 1|D = 1) = 0.99
P(T = 0|D = 0) = 0.99
1 CONTINUED OVERLEAF
then
P(T = 1|D = 0) = 0.01
P(T = 0|D = 1) = 0.01 [1 marks]
The probability that a wafer is defective given that the test is positive is:
P(D = 1|T = 1) = P(T = 1|D = 1)P(D = 1)/P(T = 1) [2 mark for Bayes’ Rule]
P(D = 1|T = 1) = 0.99?0.00001/[P(T = 1|D = 1)P(D = 1)+P(T = 1|D = 0)P(D =
0)]
≈ 0.00001/[0.00001+0.01] [note: 0.99 has been rounded off to 1]
≈ 0.00001/0.01 [rounding 0.00001 off to 0.0]
≈ 0.001 [1 mark for any answer within an order of magnitude]
For every thousand wafers pulled when the test was positive, just one would be expected
to ac

💡 Buy the answer for only $12 Get it now →

tually be faulty [1 mark]. Unless the cost of pulling the wafer is extremely small,
this test is nearly useless given the rarity of defects [2 mark].
(c) The production system is to be optimized to minimize the number of defects. The fabrication
process has two adjustable parameters: temperature and slice thickness (that have been
normalised so they are on a unit-less scale).
(i) Slice thickness (st) and temperature (temp) have been set every day at noon over ten
days. The raw data:
day 0 1 2 3 4 5 6 7 8 9
st 0.00 0.80 0.90 0.10 -0.80 -1.00 -0.30 0.70 1.00 0.40
temp 0.07 -0.84 -0.84 -0.02 0.88 0.97 0.14 -0.72 -1.08 -0.45
Make a sketch of a scatter plot of scale thickness (”x-axis”) vs temperature (”y-axis”)
and include an indication of the two principle components. Define what principal
components are and how they can be computed.
[5]
Solution: (Bookwork for defining the concepts, Problem solving otherwise )
– Principal components (PCs) indicate the major axes/direction of variation (other
sensible explanation also accepted) [1 for concept and explanation]
– PCs can be found by first computing the empirical covariance matrix, then
computing the eigenvectors (and values) of the covariance matrix. [1 for correct
explanation]
Correct sketch with the data points [1] and the directions of the eigenvectors
[2]. The following only shows with an indication of the directions (i.e. not the
eigenvectors per se) which is acceptable for full marks:
2 CONTINUED OVERLEAF
Any sketch showing the correct directions of two eigenvectors, e.g. the unscaled
eigenvectors starting in (0,0) and unit length, will be awarded full marks for this
aspect.
(ii) You manger has formulated the optimisation problem and it turns out the optimisation
requires some vectorised code, which uses a matrix multiplication and inversion to
compute the equation:
y = A
?1
x
At the moment, the implementation uses the SVD. However, you have learned that A
is in fact a square diagonal matrix. Suggest a much faster approach, and write (a one
line) vectorised NumPy code that computes the value of y from A and x. The diagonal
of a matrix A is returned by np.diag(A). [4]
Solution:
The inverse of a diagonal matrix is just the reciprocal of its entries [1]. And
the product of a diagonal matrix with a vector is the elementwise product of
the diagonal with that vector. [1] Therefore a more efficient solution would be:
y = 1.0/np.diag(A) * x [2]
3 CONTINUED OVERLEAF
2. Linear algebra, visualisation and optimisation
Your data science team has been asked to analyse a subsystem for a car manufacturer. After
some experimentation it is clear that the system you are considering can be described by
the following set of coupled equations:
?14+xα +zγ = ?yβ
2xα ?yzβ +8 = ?xγ +xα
?zγ = ?5?yβ
(1)
where x = 1, y = 2,z = 3 are scalar inputs to the system and the output of the system is denoted by c = f

💡 Buy the answer for only $12 Get it now →