Marissa Mayer is interviewing candidates to be her secretary. As she interviews
ID: 3173457 • Letter: M
Question
Marissa Mayer is interviewing candidates to be her secretary. As she interviews the candidates, she can determine the relative rank of the candidates but not the true rank. Thus, if there are six candidates and their true rank is 6, 4, 2, 3, 5. (where 1 is best) then after she had interviewed the first three candidates she would rank them 3, 1, 2, As she interviews each candidate, she must either accept or reject the candidate. If she does not accept the candidate after the interview, the candidate is lost to her. She wants to decide on a strategy for deciding when to stop and accept a candidate that will maximize the probability of getting the best candidate. Assume that there are candidates and they arrive in a random rank order. Also assume is even. What is the probability that Marissa gets the best candidate if she interviews all of the candidates? What is it if she chooses the first candidate? Assume that Marissa decides to interview the first half of the candidates and then continue interviewing until getting a candidate better than any candidate seen so far. Show that she has a better than 25 percent chance of ending up with the best candidate.Explanation / Answer
1
k
+
1
k + 1
+ · · · +
1
n 1
1
Using this strategy the probability of getting the best candidate is approxi- mately 1/e.
Write a program to simulate Barbara Smith’s interviewing if she uses this optimal strategy, using n = 10,
and see if you can verify that the probability of success is approximately 1/e.
Hint: make sure you understand the code below. Then run the pieces separately to see what each one is
doing. You’ll have to repeat the entire things many times to estimate the relevant probability.
n.cand = 6
n.pass = 3
candid = sample(1:n.cand, n.cand, replace=FALSE)
done=FALSE
for (i in (n.pass+1):n.cand){
if(candid[i] < min(candid[1:(i-1)])){
hire = candid[i]
done=TRUE
break}
if(!done){hire=candid[n.cand]}
}
hire
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.