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

被折叠的 条评论
为什么被折叠?



