GATE Computer ScienceEasyGATE CS (PYQ pattern)

In the hiring problem 10 candidates arrive in uniformly random order. The first 3 are only interviewed (never hired); from candidate 4 on, a candidate is hired whenever she is better than everyone seen so far (including the first 3). What is the expected number of hirings?

  1. A. 2.93
  2. B. 1.83
  3. C. 1.10
  4. D. 0.70

Correct answer: C. 1.10

Candidate i is the best of the first i with probability 1/i, so the expected number of hires is Σ_{i=4}^{10} 1/i = H₁₀ − H₃ = 2.929 − 1.833 ≈ 1.10. 2.93 = H₁₀ is the plain hiring problem; 1.83 = H₃.

More Algorithms questions

Exams that ask this topic