I present two algorithms that determine when a secretary should be chosen to maximize the likelihood of choosing the highest-ranked secretary.
The secretary problem is as follows. There are secretaries, each with a positive valuation. A secretary is ranked higher than secretary if they have a higher valuation than secretary . A manager knows that there secretaries but must interview each secretary sequentially. The order in which the manager interviews secretaries is random. During each interview, the manager either accepts or rejects the secretary. If the manager accepts the secretary, then the manager does not interview any more secretaries. If the manager rejects the secretary, he may continue to interview more secretaries. The manager’s goal is to select the highest-ranked secretary.
In this section, I present an algorithm that determines when to stop learning in order to choose the highest-ranked secretary. One possible way to try to select the highest-ranked secretary is to observe the valuation of the first secretaries, and then if a secretary in the next secretaries has a higher valuation than any of the secretaries in the first secretaries, accept that secretary. This is what the algorithm below states.
The algorithm reject first secretaries selects the highest-ranked secretary with probability.
. Consider the law of total probability. The probability that the highest-ranked secretary is in any position is . If the highest-ranked secretary is one of the first secretaries, then they are rejected. If the highest-ranked secretary is in position , then they are selected with probability . Likewise, if they are in position , then they are selected with probability . This is because the probability of selecting the highest-ranked secretary is equal to the probability that the highest-ranked secretary among the first secretaries appears in the first positions. This continues until the highest-ranked secretary is in position . In this case, they are selected with probability . Hence, by the total law of probability, the statement is true.
Rejecting approximately the first secretaries yields the highest probability of selecting the highest-ranked secretary.
. Consider maximizing the probability of selecting the highest-ranked secretary. The probability is approximately equal to which is approximately equal to for large and . This is maximized when the derivative with respect to is equal to . Hence, .
Determining when to stop or accept a secretary can also be found by using methods from dynamic programming. The optimal stopping policy is when the expected absolute ranking of the secretary at some stage is greater than or equal to the expected absolute ranking of future secretaries. In order to present this result, I define some important notation.
Suppose that is the cardinality of a subset of the secretaries. The relative rank of the th secretary out of secretaries is a number from to . The absolute rank of the th secretary out of secretaries is a number from to . Let the random variable be the relative rank of the th secretary among the first secretaries. Assume that the variables are identically, independently, and uniformly distributed.
The probability that a secretary of relative rank among the first secretaries has absolute rank is given by the distribution
for all .
Similar to the problem above, I consider only the conditional probability of when the secretary’s absolute rank is , given their relative rank. In this case, the above lemma implies that if and if .
The dynamic programming problem can be formulated as
such that if and otherwise. The first part of the function, i.e. represents the conditional expected absolute ranking of the secretary. The second part of the max function represents the expected absolute value of future secretaries, where values closer to zero represent a future secretary with an absolute ranking of one is unlikely. Values closer to one represent a secretary with an absolute ranking of one is likely. Consider the following policy to decide when to stop.
If at secretary , , then choose secretary and stop. Otherwise, continue.
If no secretaries from is chosen, then choose secretary .
For some , the policy selects the highest-ranked secretary with probability .
Use the law of total probability. The probability that the policy selects the highest-ranked secretary is the sum of the probabilities that it selects the highest-ranked secretary at position . The probability of selecting the highest-ranked secretary at position is equal to the probability that the highest-ranked secretary is at position , given that is selected and the probability that is selected. For , the conditional probability is equal to . For secretary , the probability is equal to . Further, the lemma below describes the probability of selecting a secretary. Hence, for all , define
The probability that the policy selects the highest-ranked secretary is
The result here is incredibly similar to the probability that the reject first secretaries algorithm finds the highest-ranked secretary. It can also be shown that under the provided stopping policy, is approximately .
For some , the policy selects secretary with probability , secretary with probability , secretary with probability , and secretary with probability . Secretary is selected with probability . For all secretary , the policy selects secretary with probability .
At any specific secretary , the policy selects secretary with probability
The probability is positive only when , which occurs when . The probability of the relative rank being one out of ranks is . Further, if for some , then if . Hence, secretary is selected with probability , and a subsequent secretary is selected with the probability that secretaries to are not selected and is selected. Secretary is selected if no other previous secretaries were selected, which is