Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1528979
  • 博文数量: 399
  • 博客积分: 8508
  • 博客等级: 中将
  • 技术积分: 5302
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-14 09:28
个人简介

能力强的人善于解决问题,有智慧的人善于绕过问题。 区别很微妙,小心谨慎做后者。

文章分类

全部博文(399)

文章存档

2018年(3)

2017年(1)

2016年(1)

2015年(69)

2013年(14)

2012年(17)

2011年(12)

2010年(189)

2009年(93)

分类: LINUX

2010-09-18 23:50:48

http://hi.baidu.com/fredyl/blog/item/5aa4d6309c93a848ad4b5f73.html

Question

In HIRE-ASSISTANT, assuming that candidates are presented in a random order, what is probability that you will hire exactly twice.

Answer

We make three observations:

1 Candidate 1 is always hired.

2 The best candidate ,i.e.,the one whose rank is n , is always hired.

3 If the best candidate is candidate 1, then that is the only candidate hired.

Therefore, in order for HIRE-ASSISTANT to hire exactly twice, candidate 1 must have rank i<=n-1 and all candidates whose ranks are i+1, i+2,...,n-1 must be interviewed after the candidate whose rank is n.

Let Ei be the event in which candidate 1 have rank i, clearly, P(Ei) = 1/n for any given value of i.

Letting j denote the position in the interview order of the best candidate , let F be the event in which candidate 2,3 ,j-1 have ranks strictly less than the rank of candidate 1, Given that event Ei has occurs,event F occurs when the best candidate is the first one interviewed out of the n-i candidates whose ranks are i+1, i+2,...n. Thus, P(F | Ei) = 1/(n-i).

Our final event is A, which occurs when HIRE-ASSISTANT hires exactly twice.Noting that the events E1,E2,...En are disjoint, we have

A = F && ( E1 || E2 || ... || En) = (F && E1) || (F && E2) || ... || (F && En)

P(A) = 1/n *(1+1/2 +1/3 +... + 1/(n-1))


阅读(1080) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~