Probability and Statistics I 概率与统计 I
Final Exam 期末考试 SDS, CUHK(SZ)
13:30-16:30, December 21, 20232023 年 12 月 21 日 13:30-16:30
Name: 名称:
Student ID: 学生证:
Answer the questions in the Answer Book.回答答题卡上的问题。
I Regular Questions (100 points)I 常规问题(100 分)
Let
X
X
X X equal the number of flips of a fair coin that are required to observe the same face on consecutive flips.让
X
X
X X 等于连续掷一枚公平的硬币观察到相同面所需的掷硬币次数。
(a) (4 points) Find the pmf of
X
X
X X . Hint: Draw a tree diagram.(a) (4 分)求
X
X
X X 的 pmf。提示:画树状图。
(b) (3 points) Find the moment generating function of
X
X
X X .(b) (3 分)求
X
X
X X 的矩生成函数。
© (3 points) Use the mgf to find the values of the mean of
X
X
X X .(3分) 使用mgf求出
X
X
X X 的平均值。
Solution: 解决方案
(a)
f
(
x
)
=
(
1
2
)
x
−
1
,
∀
x
=
2
,
3
,
4
,
⋯
f
(
x
)
=
1
2
x
−
1
,
∀
x
=
2
,
3
,
4
,
⋯
f(x)=((1)/(2))^(x-1),AA x=2,3,4,cdots f(x)=\left(\frac{1}{2}\right)^{x-1}, \forall x=2,3,4, \cdots
(b)
M
(
t
)
=
e
2
t
2
−
e
t
,
t
<
ln
2
M
(
t
)
=
e
2
t
2
−
e
t
,
t
<
ln
2
M(t)=(e^(2t))/(2-e^(t)),t < ln 2 M(t)=\frac{e^{2 t}}{2-e^{t}}, t<\ln 2
©
M
′
(
t
)
=
4
e
2
t
−
e
3
t
(
2
−
e
t
)
2
M
′
(
t
)
=
4
e
2
t
−
e
3
t
2
−
e
t
2
M^(')(t)=(4e^(2t)-e^(3t))/((2-e^(t))^(2)) M^{\prime}(t)=\frac{4 e^{2 t}-e^{3 t}}{\left(2-e^{t}\right)^{2}} and
E
[
X
]
=
M
′
(
0
)
=
3
E
[
X
]
=
M
′
(
0
)
=
3
E[X]=M^(')(0)=3 \mathbb{E}[X]=M^{\prime}(0)=3 .
M
′
(
t
)
=
4
e
2
t
−
e
3
t
(
2
−
e
t
)
2
M
′
(
t
)
=
4
e
2
t
−
e
3
t
2
−
e
t
2
M^(')(t)=(4e^(2t)-e^(3t))/((2-e^(t))^(2)) M^{\prime}(t)=\frac{4 e^{2 t}-e^{3 t}}{\left(2-e^{t}\right)^{2}} 和
E
[
X
]
=
M
′
(
0
)
=
3
E
[
X
]
=
M
′
(
0
)
=
3
E[X]=M^(')(0)=3 \mathbb{E}[X]=M^{\prime}(0)=3 。
Teaching Objective: Probability Mass Function, Moment Generating Function. Difficulty Level: Moderate.
教学目标概率质函数、矩产生函数。难度: 中等中等
2. A batch of 4 products is known to contain 2 that are defective. The products are to be tested, one at a time, until the defective ones are identified. Denote by
X
X
X X the number of tests made until the first defective is identified and by
Y
Y
Y Y the number of additional tests until the second defective is identified.
2.已知一批 4 件产品中有 2 件有缺陷。这些产品将逐一进行测试,直到找出次品为止。用
X
X
X X 表示直到找出第一个次品为止的测试次数,用
Y
Y
Y Y 表示直到找出第二个次品为止的额外测试次数。
(a) (4 points) Find the joint probability mass function of
X
X
X X and
Y
Y
Y Y .
(a) (4 分) 求
X
X
X X 和
Y
Y
Y Y 的联合概率质量函数。
(b) (3 points) Find
P
(
X
≤
Y
)
P
(
X
≤
Y
)
P(X <= Y) P(X \leq Y) .
(b) (3 分)找出
P
(
X
≤
Y
)
P
(
X
≤
Y
)
P(X <= Y) P(X \leq Y) .
(b) (3 points) Find
E
[
X
+
Y
]
E
[
X
+
Y
]
E[X+Y] \mathbb{E}[X+Y] .
(b) (3 分)找出
E
[
X
+
Y
]
E
[
X
+
Y
]
E[X+Y] \mathbb{E}[X+Y] .
Solution: 解决方案
(a)
Note that
X
X
X X and
Y
Y
Y Y take positive values such that
X
+
Y
≤
4
X
+
Y
≤
4
X+Y <= 4 X+Y \leq 4 , i.e.,
X
=
1
,
…
,
3
X
=
1
,
…
,
3
X=1,dots,3 X=1, \ldots, 3 and
Y
=
1
,
…
,
4
−
X
Y
=
1
,
…
,
4
−
X
Y=1,dots,4-X Y=1, \ldots, 4-X . Each pair of values for
X
X
X X and
Y
Y
Y Y are equally likely, and there are 6 such pairs. So
请注意,
X
X
X X 和
Y
Y
Y Y 取正值,使得
X
+
Y
≤
4
X
+
Y
≤
4
X+Y <= 4 X+Y \leq 4 ,即
X
=
1
,
…
,
3
X
=
1
,
…
,
3
X=1,dots,3 X=1, \ldots, 3 和
Y
=
1
,
…
,
4
−
X
Y
=
1
,
…
,
4
−
X
Y=1,dots,4-X Y=1, \ldots, 4-X 。
X
X
X X 和
Y
Y
Y Y 的每一对值的可能性相同,这样的值有 6 对。所以
f
(
x
,
y
)
=
1
6
,
x
=
1
,
2
,
3
y
=
1
,
…
,
4
−
x
f
(
x
,
y
)
=
1
6
,
x
=
1
,
2
,
3
y
=
1
,
…
,
4
−
x
f(x,y)=(1)/(6),quad x=1,2,3quad y=1,dots,4-x f(x, y)=\frac{1}{6}, \quad x=1,2,3 \quad y=1, \ldots, 4-x
(b)
There are 4 pairs of
X
X
X X and
Y
Y
Y Y such that
X
≤
Y
X
≤
Y
X <= Y X \leq Y , so
P
(
X
≤
Y
)
=
4
6
P
(
X
≤
Y
)
=
4
6
P(X <= Y)=(4)/(6) P(X \leq Y)=\frac{4}{6} .
有 4 对
X
X
X X 和
Y
Y
Y Y ,使得
X
≤
Y
X
≤
Y
X <= Y X \leq Y ,所以
P
(
X
≤
Y
)
=
4
6
P
(
X
≤
Y
)
=
4
6
P(X <= Y)=(4)/(6) P(X \leq Y)=\frac{4}{6} 。
©
E
[
X
+
Y
]
=
1
6
(
2
+
3
+
4
+
3
+
4
+
4
)
=
20
6
E
[
X
+
Y
]
=
1
6
(
2
+
3
+
4
+
3
+
4
+
4
)
=
20
6
E[X+Y]=(1)/(6)(2+3+4+3+4+4)=(20)/(6) \mathbb{E}[X+Y]=\frac{1}{6}(2+3+4+3+4+4)=\frac{20}{6} .
Teaching Objective: Joint Probability Mass Function, Bivariate Random Variable. Difficulty Level: Fundamental.
教学目标联合概率质量函数、双变量随机变量。难易程度: 基础:基础。
3. Let
X
X
X X be a continuous random variable with probability density function (pdf) defined as follows
3.假设
X
X
X X 是一个连续随机变量,其概率密度函数(pdf)定义如下
f
(
x
)
=
1
2
π
e
−
1
2
x
2
,
x
∈
(
−
∞
,
∞
)
f
(
x
)
=
1
2
π
e
−
1
2
x
2
,
x
∈
(
−
∞
,
∞
)
f(x)=(1)/(sqrt(2pi))e^(-(1)/(2)x^(2)),quad x in(-oo,oo) f(x)=\frac{1}{\sqrt{2 \pi}} e^{-\frac{1}{2} x^{2}}, \quad x \in(-\infty, \infty)
(a) (4 points) Use the moment generating function for
X
X
X X to show that
E
[
X
]
=
0
E
[
X
]
=
0
E[X]=0 \mathbb{E}[X]=0 ,
Var
(
X
)
=
1
Var
(
X
)
=
1
Var(X)=1 \operatorname{Var}(X)=1 .
(a) (4 分) 利用
X
X
X X 的矩生成函数证明
E
[
X
]
=
0
E
[
X
]
=
0
E[X]=0 \mathbb{E}[X]=0 ,
Var
(
X
)
=
1
Var
(
X
)
=
1
Var(X)=1 \operatorname{Var}(X)=1 .
(b) (3 points) Define a random variable
Y
=
a
X
+
b
Y
=
a
X
+
b
Y=aX+b Y=a X+b . What is the distribution of
Y
Y
Y Y ? Show the proof in details.
(b) (3 分)定义随机变量
Y
=
a
X
+
b
Y
=
a
X
+
b
Y=aX+b Y=a X+b 。
Y
Y
Y Y 的分布是什么?请详细证明。
© (3 points) What is
E
[
(
Y
−
b
)
177
]
E
(
Y
−
b
)
177
E[(Y-b)^(177)] \mathbb{E}\left[(Y-b)^{177}\right] ?
(3分) 什么是
E
[
(
Y
−
b
)
177
]
E
(
Y
−
b
)
177
E[(Y-b)^(177)] \mathbb{E}\left[(Y-b)^{177}\right] ?
Solution: 解决方案
(a)
The MGF of
X
X
X X is
X
X
X X 的 MGF 为
M
(
t
)
=
exp
[
t
2
2
]
M
(
t
)
=
exp
t
2
2
M(t)=exp[(t^(2))/(2)] M(t)=\exp \left[\frac{t^{2}}{2}\right]
We can obtain that
M
′
(
t
)
=
t
exp
[
t
2
2
]
M
′
(
t
)
=
t
exp
t
2
2
M^(')(t)=t exp[(t^(2))/(2)] M^{\prime}(t)=t \exp \left[\frac{t^{2}}{2}\right] and
E
[
X
]
=
M
′
(
0
)
=
0
;
M
′
′
(
t
)
=
E
[
X
]
=
M
′
(
0
)
=
0
;
M
′
′
(
t
)
=
E[X]=M^(')(0)=0;quadM^('')(t)= \mathbb{E}[X]=M^{\prime}(0)=0 ; \quad M^{\prime \prime}(t)=
(
t
2
+
1
)
exp
[
t
2
2
]
t
2
+
1
exp
t
2
2
(t^(2)+1)exp[(t^(2))/(2)] \left(t^{2}+1\right) \exp \left[\frac{t^{2}}{2}\right] and
Var
(
X
)
=
M
′
′
(
0
)
−
(
E
[
X
]
)
2
=
1
Var
(
X
)
=
M
′
′
(
0
)
−
(
E
[
X
]
)
2
=
1
Var(X)=M^('')(0)-(E[X])^(2)=1 \operatorname{Var}(X)=M^{\prime \prime}(0)-(\mathbb{E}[X])^{2}=1 .
我们可以得到
M
′
(
t
)
=
t
exp
[
t
2
2
]
M
′
(
t
)
=
t
exp
t
2
2
M^(')(t)=t exp[(t^(2))/(2)] M^{\prime}(t)=t \exp \left[\frac{t^{2}}{2}\right] 和
E
[
X
]
=
M
′
(
0
)
=
0
;
M
′
′
(
t
)
=
E
[
X
]
=
M
′
(
0
)
=
0
;
M
′
′
(
t
)
=
E[X]=M^(')(0)=0;quadM^('')(t)= \mathbb{E}[X]=M^{\prime}(0)=0 ; \quad M^{\prime \prime}(t)=
(
t
2
+
1
)
exp
[
t
2
2
]
t
2
+
1
exp
t
2
2
(t^(2)+1)exp[(t^(2))/(2)] \left(t^{2}+1\right) \exp \left[\frac{t^{2}}{2}\right] 和
Var
(
X
)
=
M
′
′
(
0
)
−
(
E
[
X
]
)
2
=
1
Var
(
X
)
=
M
′
′
(
0
)
−
(
E
[
X
]
)
2
=
1
Var(X)=M^('')(0)-(E[X])^(2)=1 \operatorname{Var}(X)=M^{\prime \prime}(0)-(\mathbb{E}[X])^{2}=1 。
(b)
E
[
exp
(
t
Y
)
]
=
exp
[
t
b
+
1
2
a
2
t
2
]
E
[
exp
(
t
Y
)
]
=
exp
t
b
+
1
2
a
2
t
2
E[exp(tY)]=exp[tb+(1)/(2)a^(2)t^(2)] \mathbb{E}[\exp (t Y)]=\exp \left[t b+\frac{1}{2} a^{2} t^{2}\right]
Therefore,
Y
∼
N
(
b
,
a
2
)
Y
∼
N
b
,
a
2
Y∼N(b,a^(2)) Y \sim N\left(b, a^{2}\right) .
因此,
Y
∼
N
(
b
,
a
2
)
Y
∼
N
b
,
a
2
Y∼N(b,a^(2)) Y \sim N\left(b, a^{2}\right) 。
©
Since
Y
−
b
=
a
X
,
E
[
(
Y
−
b
)
177
]
=
a
177
E
[
X
177
]
Y
−
b
=
a
X
,
E
(
Y
−
b
)
177
=
a
177
E
X
177
Y-b=aX,E[(Y-b)^(177)]=a^(177)E[X^(177)] Y-b=a X, \mathbb{E}\left[(Y-b)^{177}\right]=a^{177} \mathbb{E}\left[X^{177}\right] .
因为
Y
−
b
=
a
X
,
E
[
(
Y
−
b
)
177
]
=
a
177
E
[
X
177
]
Y
−
b
=
a
X
,
E
(
Y
−
b
)
177
=
a
177
E
X
177
Y-b=aX,E[(Y-b)^(177)]=a^(177)E[X^(177)] Y-b=a X, \mathbb{E}\left[(Y-b)^{177}\right]=a^{177} \mathbb{E}\left[X^{177}\right] .
E
[
X
177
]
=
∫
−
∞
∞
x
177
1
2
π
e
−
1
2
x
2
d
x
=
0
(the integrand is an odd function).
E
X
177
=
∫
−
∞
∞
x
177
1
2
π
e
−
1
2
x
2
d
x
=
0
(the integrand is an odd function).
E[X^(177)]=int_(-oo)^(oo)x^(177)(1)/(sqrt(2pi))e^(-(1)/(2)x^(2))dx=0" (the integrand is an odd function). " \mathbb{E}\left[X^{177}\right]=\int_{-\infty}^{\infty} x^{177} \frac{1}{\sqrt{2 \pi}} e^{-\frac{1}{2} x^{2}} d x=0 \text { (the integrand is an odd function). }
Therefore,
E
[
(
Y
−
b
)
177
]
=
0
E
(
Y
−
b
)
177
=
0
E[(Y-b)^(177)]=0 \mathbb{E}\left[(Y-b)^{177}\right]=0 .
因此,
E
[
(
Y
−
b
)
177
]
=
0
E
(
Y
−
b
)
177
=
0
E[(Y-b)^(177)]=0 \mathbb{E}\left[(Y-b)^{177}\right]=0 。
Teaching Objective: Moment Generating Function, Normal Distribution. Difficulty Level: Moderate.
教学目标矩生函数、正态分布。难度: 中等中等。
4. Two envelopes have i.i.d rewards
R
1
,
R
2
R
1
,
R
2
R_(1),R_(2) R_{1}, R_{2} that are drawn from a uniform
[
0
,
1
]
[
0
,
1
]
[0,1] [0,1] distribution. Because the rewards are i.i.d, selecting any of the envelopes gives you a
50
%
50
%
50% 50 \% chance of selecting the one with the largest reward. Suppose that you select envelope one, but are allowed to switch to envelope two upon seeing the realization of the first envelope. A friend of yours proposes the following switching policy: pick a number
t
∈
(
0
,
1
)
t
∈
(
0
,
1
)
t in(0,1) t \in(0,1) . If
R
1
>
t
R
1
>
t
R_(1) > t R_{1}>t , then keep
R
1
R
1
R_(1) R_{1} and otherwise switch to
R
2
R
2
R_(2) R_{2} .
4.两个信封的奖励
R
1
,
R
2
R
1
,
R
2
R_(1),R_(2) R_{1}, R_{2} 都来自均匀分布
[
0
,
1
]
[
0
,
1
]
[0,1] [0,1] 。因为奖励是 i.i.d,所以选择任何一个信封都有
50
%
50
%
50% 50 \% 的机会选择奖励最大的那个。假设你选择了信封一,但允许你在看到第一个信封实现后切换到信封二。你的一个朋友提出了如下的转换策略:选择一个数字
t
∈
(
0
,
1
)
t
∈
(
0
,
1
)
t in(0,1) t \in(0,1) 。如果
R
1
>
t
R
1
>
t
R_(1) > t R_{1}>t ,则保留
R
1
R
1
R_(1) R_{1} ,否则切换到
R
2
R
2
R_(2) R_{2} 。
(a) (4 points) What is the probability of selecting the envelope with higher reward under this strategy for arbitrary
t
t
t t ?
(a) (4 分) 在任意
t
t
t t 的情况下,该策略下选择奖励更高的信封的概率是多少?
(b) (3 points) What would be the optimal choice of
t
t
t t ?
(b) (3 分)
t
t
t t 的最佳选择是什么?
© (3 points) What would be the expected reward under the optimal
t
t
t t ?
(3分) 最佳
t
t
t t 下的预期收益是多少?
Solution: 解决方案
(a)
Let
τ
(
t
)
τ
(
t
)
tau(t) \tau(t) be the probability of selecting the envelope with higher reward with this strategy. Then
假设
τ
(
t
)
τ
(
t
)
tau(t) \tau(t) 是使用该策略时选择奖励更高的信封的概率。那么
τ
(
t
)
=
P
(
R
2
>
R
1
,
R
1
<
t
)
+
P
(
R
1
>
R
2
,
R
1
>
t
)
=
∫
0
t
∫
u
1
d
v
d
u
+
∫
t
1
∫
0
u
d
v
d
u
=
∫
0
t
(
1
−
u
)
d
u
+
∫
t
1
u
d
u
=
t
−
0.5
t
2
+
0.5
(
1
−
t
2
)
=
0.5
+
t
−
t
2
τ
(
t
)
=
P
R
2
>
R
1
,
R
1
<
t
+
P
R
1
>
R
2
,
R
1
>
t
=
∫
0
t
∫
u
1
d
v
d
u
+
∫
t
1
∫
0
u
d
v
d
u
=
∫
0
t
(
1
−
u
)
d
u
+
∫
t
1
u
d
u
=
t
−
0.5
t
2
+
0.5
1
−
t
2
=
0.5
+
t
−
t
2
{:[tau(t)=P(R_(2) > R_(1),R_(1) < t)+P(R_(1) > R_(2),R_(1) > t)],[=int_(0)^(t)int_(u)^(1)dvdu+int_(t)^(1)int_(0)^(u)dvdu],[=int_(0)^(t)(1-u)du+int_(t)^(1)udu],[=t-0.5t^(2)+0.5(1-t^(2))],[=0.5+t-t^(2)]:} \begin{aligned}
\tau(t) & =\mathbb{P}\left(R_{2}>R_{1}, R_{1}<t\right)+\mathbb{P}\left(R_{1}>R_{2}, R_{1}>t\right) \\
& =\int_{0}^{t} \int_{u}^{1} d v d u+\int_{t}^{1} \int_{0}^{u} d v d u \\
& =\int_{0}^{t}(1-u) d u+\int_{t}^{1} u d u \\
& =t-0.5 t^{2}+0.5\left(1-t^{2}\right) \\
& =0.5+t-t^{2}
\end{aligned}