CS 29-128: Algorthms and Uncertanty Lecture 17 Date: October 26, 2016 Instructor: Nkhl Bansal Scrbe: Mchael Denns 1 Introducton In ths lecture we wll be lookng nto the secretary problem, and an nterestng varaton of the problem called the ncentve comparable secretary problem. For both of these problems we wll show how they can be solved though a correspondence between all possble strateges and the feasble soluton space to a lnear program. In both cases ths wll allow us to derve an algorthm and prove that t s the best algorthm for the problem. We wll gve an algorthm that s non-adaptve and must commt to box selecton before movng on that acheves at least 1 8 of the reward of the best adaptve algorthm even when the adaptve algorthm can choose the best box after they are all opened. The methods for solvng ths problem wll be smlar to the secretary problem, showng a correspondence between strateges of opt and the feasble soluton space of a lnear program. We wll then use the optmal soluton of the lnear program as a bound for opt and show that we are compettve wth ths bound. 2 The Secretary Problem We wll now consder the classc secretary Problem. You are tasked wth hrng a new secretary. You are gven a lst of n applcants and tasked wth ntervewng them wth the goal to hre the best applcant. Your company only wants the best applcant, and choosng the second-best wll be consdered a falure. Addtonally, you must make your decson as to whether or not to hre a specfc applcant mmedately followng the ntervew. Note that n the adversaral settng ths s completely hopeless. We cannot know any nformaton about the best secretary and thus we can always be beaten by the adversary. For ths reason we analyze the algorthm n the stochastc settng. That s, the adversary can choose the secretares but the order s random. We must choose a strategy to maxmze the chance of fndng the best applcant, gven adversarally chosen applcants n a randomly chosen order. Frst we wll consder a smple strategy that gves at least a 1 chance at success. Smply look at the frst n 2 applcants and reject them all, then choose the next applcant you see whch s better than anythng that comes before. Clearly f the second-best secretary s n the frst half and the best s the the second half ths algorthm hres the best secretary. Snce the second-best secretary s n the frst half wth roughly 1 2 probablty and the best secretary s n the second half wth roughly a 1 2 probablty ths algorthm succeeds wth probablty about 1. But we can do much better than ths. In fact, the best strategy s the above algorthm wth a cutoff at n e nstead of n 2. Ths gves a success probablty of 1 e. Later today we wll prove ths result, and prove that ths result s optmal by constructng and LP. An nterestng modfcaton of ths problem s the ncentve comparable secretary Problem. In ths varant, we want to acheve the same goal as the classcal secretary problem, but n a way that does not gve a hgher chance of gettng hred to secretares that arrve later. That s, so that any secretary, knowng our strategy for hrng, wll not be ncentvzed to choose any specfc poston n the orderng over any other. Ths necessarly means that we wll accept a sub-optmal secretary sometmes to make the probabltes even. Thus the protocol must be randomzed. We can show 1
that the optmal such protocol wll gve a 1 1 2 chance for every secretary and we wll show that ths s tght wth an LP proof. Fnally there are many other versons of ths problem that have been studed. The ones that we wll dscuss here and many others are studed n detal by Buchbnder et al. [2]. 2.1 The Secretary Problem as a LP We clam that we can descrbe any possble soluton to the secretary problem as a soluton to the followng lnear program: Let x = P(selectng the secretary at poston ) Here the probablty s taken over the executon of the algorthm over all possble n! nput orderngs. We wll show that any vald strategy for the secretary problem must satsfy the followng LP. Hence, the LP below s a relaxaton. It wll also turn out that any feasble soluton to ths LP can be converted nto a vald secretary algorthm wthout any loss n the objectve. Thus, ths LP captures the problem exactly. n =1 n x s.t., x 1 j< x j x [0, 1] Feasblty of LP: We frst show that any secretary strategy gves a feasble soluton to ths LP, and the LP objectve exactly measures the expected objectve value of the strategy. The followng s a key observaton. At any tme step, even f we condton on whch secretares arrve durng the frst steps, snce the order s random, the -th secretary s equally lke to have rank 1,..., among the frst secretares. Moreover, the only nformaton that the algorthm has at any tme s the relatve rankng of the secretares t has seen thus far. Fnally, snce the algorthm only gets value f t pcks the overall best secretary, at any step, any algorthm should only bother pckng a secretary (f at all) f t s the best among the ones seen so far. Thus the game can smply be vewed as that at any step, a secretary arrves whch has rank (thus far) equally dstrbuted among 1,...,. These observatons mply that a secretary strategy can be completely specfed by descrbng the probablty q of pckng the secretary at the -th gven that t s the best among the ones seen thus far. So vald constrant s the followng: The probablty that secretary s pcked gven that t s best so far plus the probablty that some secretary was already pcked earler s at most 1. P( pcked best so far) (1 j< x j ) As the probablty that secretary s the best so far s exactly 1/. P( s pcked) = P( pcked best so far)p(best so far) 2
and thus x (1 j< x j ) 1 Fnally, to see the objectve functon, secretary s the overall best wth probablty 1/n. Moreover, n ths case t s also the best among the frst, and hence the algorthm wll choose t proablty q = x. LP to Secretary: We have shown that algorthms for the secretary problem correspond to possble solutons for ths lnear program. However, t s stll not clear that a soluton to ths Lnear Program would be a soluton to the secretary problem. Gven any x 1, x 2,..., x n that satsfy that LP constrants we can create an algorthm that can acheves the value of the functon we are tryng to maxmze. Algorthm 1 Algorthm 1: for = 0 n do 2: f s best so far then 3: pck secretary wth probablty x 1 j< x j Snce the probablty that we have not chosen any prevous secretary s (1 j< x j ) and the probablty that ths s the best secretary so far s 1, ths algorthm would accept the secretary at wth probablty x. A formal proof can be gven by nducton and we skp that here. One can exhbt a soluton to ths LP that has objectve value 1/e. Moreover, one can show by LP dualty that 1/e s the best possble, and hence by the above connectons, so secretary strategy can perform better. 2.2 The Incentve Comparable Verson as an LP We can solve the ncentve comparable secretary problem n a smlar way as we solved the classcal verson. Let p be the probablty (over all possble n! orderngs) that we wll hre a secretary at poston. Note that p does not depend on by the ncentve compatblty assumpton. Also, we note here that unlke above, at step, the algorthm mght hre secretary even f t s not the best so far to satsfy the ncentve compatblty condton. We construct the followng LP: Let f = P(selectng the secretary at poston s the best canddate) 1 n f, f p, f + ( 1)p 1 Frst we wll show, lke before, that any algorthm for the ncentve comparable secretary problem wll be a feasble soluton to ths lnear program. For any algorthm, snce p s the probablty 3
of choosng the th secretary, t can not be more that the probablty of choosng the secretary at poston gven that t s the best so far (f ) tmes the probablty that t s the best so far( 1 ). Thus the probabltes for f taken from any algorthm wll satsfy the frst condton. The second condton of the lnear program s smply a sum of two mutually exclusve probabltes (selectng the secretary at poston or selectng one of the prevous secretares) and nsstng that the probablty s no more than 1, whch s clearly true. To see the objectve functon, condtoned on secretary beng the best so far (whch has exactly 1/ chance), there s exactly /n chance that t s the best overall. As the algorthm at step, accepts the best so far, wth probablty f, the expected value of pckng best secretary at poston s f (1/) (/n) = f /n. Thus any algorthm for the ncentve comparable secretary problem wll mply a soluton to the lnear program. As before, one can also show that any LP soluton gves an ncentve compatble strategy wth the same value. From here one can solve the lnear program to obtan a soluton wth value 1 1/ 2. By dualty one can also show that no algorthm can do better. We refer to the BJS paper for the calculatons. 3 Non-Adaptve Boxes Wth Lnear Programng We wll now use a smlar technque for the box problem. You know the dstrbuton on the boxes and we can open any k of them n any order. We wll gve a non-adaptve strategy that s O(1)- compettve to the best adaptve strategy. To do ths we need a lower bound on the best adaptve polcy. The dffculty s that adaptve polces are really complex trees wth many paths from root to leaf. To have a smpler model to work wth we wll show that any such adaptve polcy wll correspond to a feasble soluton to the followng lnear program. In dong ths, we can use the soluton to the lnear program as a relaxaton for all adaptve polces. As usual the probabltes below are over all the possble actons of the adaptve strategy. Let y be the probablty that box s opened. Let z jv be the probablty that box j selected gven that the observed reward s v. Let f jv be the probablty that reward of box j s v.., y k z jv 1 vz jv (You can only open k boxes) (You can only select 1 box), y f v z v (The Probablty Chan Rule) Note that any adaptve strategy for the box problem wll gve a feasble soluton to ths LP, thus f we can get a strategy that s compettve wth the optmum soluton for ths LP t must be compettve wth the optmal adaptve strategy. We construct our strategy as follows: Note that we are forced to stop when we reach k boxes, and the way we have desgned ths algorthm we do not choose the best value that we have seen or even wat to open k boxes. All of ths makes our job harder, but surprsngly we can stll do very well.
Algorthm 2 Algorthm 1: Solve the above LP. 2: for j = 1 n do 3: Open box j wth probablty y j. : Select the box wth probablty z jv upon seeng reward v. 5: f opened k boxes then 6: break Note that by constructon: P(Box j s selected wth value v Algorthm reaches j) = z jv P(Box j s opened and ts value s v Algorthm reaches j) = z jv f jv P(Box j s opened Algorthm reaches j) = z jv y j y j = z jv Note that the chance that k boxes have been opened before box j s never more than 1 by Markov s nequalty. Also, note that the chance that someone has been selected before box j s y < z v y f f v v. Combnng these facts we get: P(j s selected wth value v) z jv (1 P( someone was selected earler) P(k boxes were opened up earler)) z jv (3 z v ) z jv 8 < Fnally, we can calculate a lower bound on the reward by takng the weghted sum over all possble boxes and rewards: P(j s selected wth value v)v z jv v = opt 8 8. Thus wth ths method we get 1 8 of the LP soluton. More work on ths problem and tghter bounds can be found n Dean et al. [1] References [1] B. Dean, M.X. Goemans, and J. Vondrak. Approxmatng the stochastc knapsack problem: The beneft of adaptvty. In Proceedngs of the 5th Annual IEEE Symposum on Foundatons of Computer Scence, Rome, Italy, pages 208217, 200. [2] N. Buchbnder, K. Jan, and M. Sngh. Secretary Problems va Lnear Programmng. Integer Programmng and Combnatoral Optmzaton, pages 163176, 2010. 5