What is the probability that you hire exactly twice?

博客围绕招聘助手问题展开,假设候选人随机排序,探讨恰好雇佣两次的概率。分析了排名为n的候选人不能是第一个,推导了第一个候选人排名为i时的排列情况及概率,最终得出恰好雇佣两次的概率为1/n * (1/(n - 1) + 1/(n - 2) +... + 1)。

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

(NOTE: (n, k) = n! / (k! * (n - k)!))


1. The candidate whose rank is n cannot be the first candidate, because we hire only once.

2. The rank of the first candidate can be any one of 1, 2, ..., n - 1;

3. Supposed that the rank of the first candidate is i (1 <= i < n), the total number of permutation of other candidates are (n-1)!, and the number of permutation which can cause that we hire exactly twice is (n - 1, n - i) * (n - i - 1)! * (i - 1)!. Why? we can select the permutation we want in this way: there are n -1 positions to put those n - 1 candidates, first we select n - i positions to put those candidates whose ranks are in the range [i + 1 .. n], they are in the right side of the permutations, and the candidate whose rank is n must be the first one in the selected n - i position. There are (n - 1, n - i) * (n - i - 1)! ways to do this; second we permutate the remaining candidates whose ranks are in the range [1 .. i - 1], there are (i - 1)! ways to do this.

4. If the rank of the first candidate is i (1 <= i < n), the probability that we hire exactly twice is (n - 1, n - i) * (n - i - 1)! * (i - 1)! / (n - 1)! = 1 / (n - i).

5. The probability of the rank of the first candidate is i (1 <= i < n) is 1/n.

6. The probability that you hire exactly twice is 1/n * (1/(n - 1) + 1/(n - 2) + ... + 1).


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值