程序案例-COM 2004

UNIVERSITY OF SHEFFIELD COM 2004
MODEL SOLUTIONS
SETTER: JPB
Data Provided:
None
DEPARTMENT OF COMPUTER SCIENCE AUTUMN SEMESTER 2017–2018
DATA DRIVEN COMPUTING 2 hours
Answer THREE questions.
All questions carry equal weight. Figures in square brackets indicate the percentage of avail-
able marks allocated to each part of a question.
COM 2004 1
UNIVERSITY OF SHEFFIELD COM 2004
1. This question concerns probability theory.
a) The discrete random variable X represents the outcome of a biased coin toss. X has
the probability distribution given in the table below,
x H T
P(X = x) θ 1 θ
where H represents a head and T represents a tail.
(i) Write an expression in terms of θ for the probability of observing the sequence
H, T, H, H. [5%]
ANSWER:
θ× (1 θ)×θ×θ = θ3(1 θ)
(ii) A sequence of coin tosses is observed that happens to contain NH heads and
NT tails. Write an expression in terms of θ for the probability of observing this
specific sequence. [5%]
ANSWER:
θNH (1 θ)NT
(iii) Show that having observed a sequence of coin tosses containing NH heads and
NT tails, the maximum likelihood estimate of the parameter θ is given by
NH
NH +NT
[20%]
ANSWER:
Write down the expression for p(x) in terms of the parameter θ,
P(x;θ) = θNH (1 θ)NT
Find maximum by

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

differentiating w.r.t. the parameter θ and setting to 0,
dP(x;θ)
dθ
= NHθ
NH 1(1 θ)NT θNH NT (1 θ)
NT 1 = 0
Solve for θ,
NHθ
NH 1(1 θ)NT θNH NT (1 θ)
NT 1 = 0
NH(1 θ) θNT = 0
NH = NHθ+NT θ
θ =
NH
NH +NT
COM 2004 2
UNIVERSITY OF SHEFFIELD COM 2004
b) The discrete random variables X1 and X2 represent the outcome of a pair of independent
but biased coin tosses. Their joint distribution P(X1,X2) is given by the probabilities in
the table below,
X1 = H X1 = T
X2 = H λ 3λ
X2 = T 2λ ρ
(i) Write down the probability P(X1 = H,X2 = H). [5%]
ANSWER:
λ
(ii) Calculate the probability P(X1 = H) in terms of λ. [5%]
ANSWER:
λ+2λ = 3λ
(iii) Calculate the probability P(X2 = H) in terms of λ. [5%]
ANSWER:
λ+3λ = 4λ
(iv) Given that the coin tosses are independent and that λ is greater than 0, use your
previous answers to calculate the value of λ. [15%]
ANSWER:
Independence implies that
P(X1 = H,X2 = H) = P(X1 = H)×P(X2 = H)
So
λ = 3λ×4λ
λ =
1
12
COM 2004 3
UNIVERSITY OF SHEFFIELD COM 2004
(v) Calculate the value of ρ. [5%]
ANSWER:
Also entries in the table must sum to one so
λ+3λ+2λ+ρ = 1
Therefore
ρ =
1
2
COM 2004 4
UNIVERSITY OF SHEFFIELD COM 2004
c) Consider the distribution sketched int the figure below.
0 1
2λ
λ
b
p(x)
x
p(x) =

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