title: PROBABILITY HIRE- ASISTANT
body: <p>Here is an algorithm for the HIRE-ASSISTANT problem.</p>
  
  <pre><code>HIRE-ASSISTANT(n)
  best &lt;- 0
  for i &lt;- 1 to n do
        if candidate[i] is better than candidate[best]
            best &lt;- i
            hire candidate i
  </code></pre>
  
  <p>Now some observations:</p>
  
  <p>1.Candidate 1 is always hired. </p>
  
  <p>2.The best candidate,i.e., the one whose rank is n, is always hired. </p>
  
  <p>3.If the best candidate is candidate 1, then that is the only candidate hired.</p>
  
  <p>Now the problem is what is the probability of hiring twice?</p>
  
  <p>My approach:</p>
  
  <p>Now before nth rank candidate, I can interview any number of candidates as I want to but the order of their rank is fixed.Therefore for i candidates being interviewed before nth rank candidate=C(n-1,i)*(n-i-1)! total cases are possible.So varying i=1 from n-1 and summing and dividing by total possibilities that are n! I calculate the answer, but it does not match with the standard answer so I need help in finding what is wrong?</p>