算法导论(第三版)参考答案:练习5.2-1,练习5.2-2,练习5.2-3,练习5.2-4,练习5.2-5
Exercise 5.2-1
In
HIRE-ASSISTANT
, assuming that the candidates are presented in a random order, what is the probability that you hire exactly one time? What is the probability you hire exactly n times?
概率分别为:
Exercise 5.2-2
In
HIRE-ASSISTANT
, assuming that the candidates are presented in a random order, what is the probability that you hire exactly twice?
分析:雇佣两次的情况有, (rank(i),rank(n)) ,其中 i∈{
1,...,n−1} ,且 rank(i) 第一个出现。现在只对 (rank(i),rank(n)) 情况,计算概率 P(Ri) 。有
P((Ri,Rn))=1n⋅1n−i
第二个概率的解释:在剩余次数面试中,