aa r X i v : . [ m a t h . P R ] S e p A GENERALIZED COVER’S PROBLEM
BENJAMIN E. DIAMOND
Abstract
Generalizing a problem posed by Cover [Cov87], we propose an adversarial game in whicha permutation is incrementally constructed in a setting of partial information. As in thesecretary problem, this permutation is exposed in stages via the successive components of itsLehmer code. Extending Cover’s result, which constitutes the case n = 2, we establish thata random permutation of n adversarially constructed real numbers can be reconstructed withbetter-than-random probability, provided that certain among the numbers it permutes aremade visible during the process. Player 1 writes down any two distinct numbers on separate clips of paper. Player 2randomly chooses one of these slips of paper and looks at the number. Player 2 mustdecide whether the number in his hand is the larger of the two numbers. He can beright with probability one-half. It seems absurd that he can do better.We argue that Player 2 has a strategy by which he can correctly state whether or notthe other number is larger or smaller than the number in his hand with probability strictly greater than one-half .Thomas Cover’s well-known paradox [Cov87], reproduced in part above, asserts that one can identifythe larger of two unequal numbers chosen by an adversary, having seen only one of them, withprobability surpassing that of a randomized strategy.This setting has been generalized in a number of directions. Most prominent among these is the secretary problem , or, more properly, the game of googol —distinguished by Player 2’s seeing theactual values of the numbers as they come, as opposed their relative ranks alone—identified assuch apparently by Ferguson [Fer89], and solved ultimately by Samuels [Sam81], Ferguson [Fer89],Silverman and N´adas [SN90], and Gnedin [Gne94], among others. The problem’s classical solution,based only on relative ranks, performs well; as long as n >
2, however, no additional—or rather,actionable—information is conveyed by the numbers’ actual values (see especially [Gne94, 4. Finalremarks]).Further extensions are surveyed in Ferguson [Fer89]. Modern generalizations include Kesselheim,Radke, T¨onnis, and V¨ocking [KRTV13], which studies weighted matching to multiple targets, andGnedin [Gne16], which studies guessing which among two piles of numbers contains the largestnumber. 1he extension of Cover’s problem to the game of googol entails viewing Player 2’s choice as thatmandated by a stopping procedure, which seeks, at each stage k , for k ∈ { , . . . , n − } , to inferproperties of an unknown permutation σ ∈ S n given only the first k elements of its Lehmer code.Precisely, in googol, Player 2 seeks to stop exactly when k is such that σ ( n ) = k .We propose a different generalization, in which, at each such stage k , Player 2 attempts to determinethe next element of σ ’s Lehmer code. (This version also recovers Cover’s problem in the case n = 2.)About this k + 1 st element, of course, no information is conveyed by the first k . Contrarily to thecase of googol, however, access to the numbers, in this problem, continues to bestow an advantage,even for n greater than 2. Indeed, generalizing Cover’s result, we demonstrate that, for arbitrary n ≥ n adversarially generated real numbers permuted by a uniformly random permutation σ canbe used to reconstruct σ (through its Lehmer code, in n − n ! , provided that, at each stage k , the first k of these permuted numbers are made visible.This direction carries forward the spirit of Cover’s original observation, and aims to answer hisquestion: “Does this result generalize?” In an appendix, we discuss further extensions to the case n = 2. n = 2 We summarize the classical treatment of Cover. Cover suggests the following strategy [Cov87,Solution]:
Strategy 1 (Cover) . Player 2 fixes a real-valued random variable T which is absolutely continuouswith everywhere-positive density. Selecting a random variate t from T , and calling the number hechooses x , Player 2 states that the other number is smaller than x just in case t ≤ x . Otherwise,he states that it is larger.We establish the correctness of Strategy 1 a fortiori by realizing it as a special case of a slightlymore general strategy: Strategy 2.
Player 2 picks a strictly increasing function f : R → [0 , x , Player 2 states that the other number is smaller than x with probability f ( x ). Otherwise,he states that it is larger.Any instance of Strategy 1, with random variable T say, can be realized as an instance of Strategy2 by setting T ’s cumulative distribution function as f . Proposition 1.
Strategy 2 is dominant for Player 2 in the above game.Proof.
We name Player 1’s two numbers, which are distinct, s and l , for smaller and larger . Breaking2own the probability of winning along the two outcomes of Player 2’s random choice, we have that: P (win) = P (chooses l ) · P (states “smaller”) + P (chooses s ) · P (states “larger”)= 12 · f ( l ) + 12 (1 − f ( s ))= 12 + f ( l ) − f ( s )2 > , where in the final step we use the increasingness of f . We prepare definitions which will be key in what follows. We fix an n ≥ Lehmer code , and originating appar-ently with Hall (see Sedgewick [Sed77, pp. 154-155]):
Definition 1 (Lehmer code) . To each element σ ∈ S n , viewed as a bijection on { , . . . , n } , weassociate a tuple ( c , . . . , c n ), which we will call σ ’s Lehmer code , by setting c = 0 and declaring,for each k ∈ { , . . . , n − } , that c k +1 ∈ { , . . . , k } be the cardinality (cid:12)(cid:12)(cid:8) i ∈ { , . . . , k } | σ − ( i ) < σ − ( k + 1) (cid:9)(cid:12)(cid:12) . Conversely, any such tuple ( c , . . . , c n ) corresponds to the permutation given by σ : i P [ i ], wherethe array P [ i ] , i ∈ { , . . . , n } is defined through the following procedure (see Sedgewick [Sed77, p.155]): procedure Lehmer ( c , P ): for i = 1 to n do : for j = 1 to c i do : P [ n − i + j ] ← P [ n − i + j + 1] P [ n − i + c i + 1] ← i In what follows, we often freely identify elements σ ∈ S n with Lehmer codes ( c , . . . , c n ).Intuitively, each successive element c k +1 encodes the relative position with respect to the numbers { , . . . , k } that k + 1 occupies, in the list σ (1) , . . . , σ ( n ). An example is visible in Sedgewick [Sed77,p. 155]. Definition 2.
By the standard k -simplex ∆ k we will mean the set:∆ k = ( ( p , . . . , p k ) ∈ R k +1 | k X i =0 p i = 1 , p i ≥ i ) . We identify categorical distributions on { , . . . , k } with elements of this set.3 Results
Continuing an apparent tradition, we describe the key game in verbal form.Player 1 writes down any n distinct numbers on separate clips of paper. Player 2randomly chooses one of these slips of paper and looks at its number. As long as thereremain further slips on the table, now, Player 2 repeatedly enacts a procedure whereby,randomly selecting a further slip, he must guess its hidden number’s ordinal positionwith respect to the collection of slips which are already visible, before, finally, revealingthis slip’s number, continuing to the next only if his guess had been correct.We argue that Player 2 has a strategy by which he can correctly order the entire collec-tion of n slips with probability strictly greater than 1 divided by n factorial .We enrich this game with definitions. Writing without loss of generality the adversary’s (real)numbers as x > · · · > x n , we denote by σ ∈ S n that unique permutation for which these slips’numbers are, in the order in which they are revealed, x σ − (1) , . . . , x σ − ( n ) . We index the stages ofthe game by k ∈ { , . . . , n − } . At each stage k , then, the numbers x σ − (1) , . . . , x σ − ( k ) are visible,as are, hence, the elements ( c , . . . , c k ) of σ ’s Lehmer code. Player 2’s task in this stage k is exactlyto guess, on the basis of these visible numbers, the element c k +1 of σ ’s Lehmer code. Player 2 winsif he completely reconstructs σ .We point out that strategies in this game are effectively family of maps (cid:8) f k : R k → ∆ k (cid:9) k ∈{ ,...,n − } .We propose the following particular strategy: Strategy 3.
At each stage k ∈ { , . . . , n − } , Player 2 guesses c k +1 on the basis of a sample fromthat categorical distribution on { , . . . , k } given as the image of x σ − (1) , . . . , x σ − ( k ) under the map: f k : ( η , . . . , η k ) softmax (cid:0) , η σ k (1) . . . , η σ k ( k ) (cid:1) = (1 , e η σk (1) , . . . , e η σk ( k ) )1 + e η σk (1) + · · · + e η σk ( k ) , where, for each ( η , . . . , η k ) ∈ R k , σ k ∈ S k is chosen to be that unique permutation for which η σ k (1) > · · · > η σ k ( k ) . In other words, at each stage, Player 2 sorts his visible numbers in descendingorder, before prepending a leading zero and applying the softmax. Remark . The permutation σ k ∈ S k as defined above coincides with that given by the truncatedLehmer code ( c , . . . , c k ) available as of stage k . Remark . Considering in particular the case k = 1, we point out that f coincides with the logisticfunction x e x e x , provided that the 1-simplex is identified with the unit interval [0 , Remark . This strategy appears related to the theory of exponential families. Indeed, interpretingthe point (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) = ( η , . . . , η k ) = (cid:16) log (cid:16) p p (cid:17) , . . . , log (cid:16) p k p (cid:17)(cid:17) ∈ R k as the naturalparameter of an underlying categorical distribution ( p , . . . , p k ) ∈ ∆ k , we realize Strategy 3 as amap from the k -simplex to itself (we refer for example to [LC98, 1.5, Ex. 5.3 and 3.6, (6.2)]).This map is exactly that which sorts in descending order the trailing (that is, nonzero-indexed)coordinates.We come to the main theorem: 4 heorem 2. Strategy 3 is dominant for Player 2 in the generalized game above.Proof.
We show that, for any numbers x > · · · > x n , the uniform weighted average X σ ∈ S n n ! · n − Y k =1 f k (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) ( c k +1 ) > n ! , (1)where, for each σ and at each stage k , c k +1 is the (as yet unknown) k + 1 st component of σ ’s Lehmercode. We multiply both sides of this equation by n ! once and for all. Noting also that the case n = 2 is proven by Proposition 1 above, we assume that n ≥ k , f k immediately sorts its arguments x σ − (1) , . . . , x σ − ( k ) ,we may as well view f k as a function on the unordered collection of these arguments.We now note that, for each fixed d n ∈ { , . . . , n − } , those permutations σ = ( c , . . . , c n ) ∈ S n for which c n = d n yield identical (unordered) sets { x σ − (1) , . . . , x σ − ( n − } (namely, they equal { x , . . . , x n }\{ x d n +1 } ). As a first consequence, we rewrite the left-hand side of the inequality (1): X d n ∈{ ,...,n − } X σ =( c ,...,c n ) ∈ S n c n = d n n − Y k =1 f k (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) ( c k +1 ) · f n − ( { x , . . . , x n }\{ x d n +1 } ) ( d n ) . (2)In fact, for any fixed trailing Lehmer code ( d m +1 , . . . , d n ), m ∈ { , . . . , n − } , those permuta-tions σ = ( c , . . . , c n ) ∈ S n for which c m +1 = d m +1 , . . . , c n = d n yield identical chains of sets { x σ − (1) , . . . , x σ − ( m ) } ⊂ · · · ⊂ { x σ − (1) , . . . , x σ − ( n ) } (for which, however, when m < n − n > n = 3 is effectively exhausted by theexpression (2) above.) For any trailing code ( d m +1 , . . . , d n ), m ∈ { , . . . , n − } , then, we have that: X σ =( c ,...,c n ) ∈ S n c m +1 = d m +1 ,...c n = d n m − Y k =1 f k (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) ( c k +1 ) = X d m ∈{ ,...,m − } X σ =( c ,...,c n ) ∈ S n c m = d m ,...c n = d n m − Y k =1 f k (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) ( c k +1 ) · f m − (cid:0)(cid:8) x σ − (1) , . . . , x σ − ( m − (cid:9)(cid:1) ( d m ) , (3)where, for each d m ∈ { , . . . , m − } , the set (cid:8) x σ − (1) , . . . , x σ − ( m − (cid:9) does not depend on the choiceof σ = ( c , . . . , c n ) ∈ S n for which c m = d m , . . . c n = d n .By induction, therefore, (where the base case m = 3 is exactly the classical Proposition 1, in lightof Remark 2) we may assume that, for each trailing code ( d m +1 , . . . , d n ), m ∈ { , . . . , n − } , each5nstance d m of the inner expression above features an inequality: X σ =( c ,...,c n ) ∈ S n c m = d m ,...c n = d n m − Y k =1 f k (cid:0) x σ − (1) , . . . , x σ − ( k ) (cid:1) ( c k +1 ) > , leaving unproven, only, the inductive step X d m ∈{ ,...m − } f m − (cid:0)(cid:8) x σ − (1) , . . . , x σ − ( m − (cid:9)(cid:1) ( d m ) > , where, again, the components ( d m +1 , . . . , d n ) are fixed.Each set (cid:8) x σ − (1) , . . . , x σ − ( m − (cid:9) in the above inequality differs from (cid:8) x σ − (1) , . . . , x σ − ( m ) (cid:9) only inits lacking some particular element of the latter set (determined by the element d m ). This situationthus mimics that of expression (2), and for notational convenience (that is, up to a reindexing), weadopt its setting in what follows. We are thus reduced to the inequality: n X i =1 f n − ( { x , . . . , x n }\{ x i } ) ( i −
1) = n X i =1 softmax (0 , x , . . . , b x i , . . . , x n ) ( i − > , (4)where, in the right-hand sum, a hat indicates that its corresponding argument is removed.Pulling back the right-hand sum along the (surjective) recoordinatization˚∆ n → R n , ( p , . . . , p n ) (cid:18) log (cid:18) p p (cid:19) , . . . , log (cid:18) p n p (cid:19)(cid:19) = ( x , . . . , x n )from the interior of the n -simplex to R n (cf. Remark 3), the right-hand expression simplifies,yielding the inequality (note that p > · · · > p n ): n X i =1 p i − p + p + · · · + b p i + · · · + p n > . On the other hand, we have that: n X i =1 p i − p + p + · · · + b p i + · · · + p n > n X i =1 p i − p + · · · + p n − + c p n (using p i > p n , i ∈ { , . . . , n − } )= 1 . (common denominator)This calculation completes the proof. Remark . We note a correspondence between permutations σ ∈ S n and upward paths through theHasse diagram, or rather the cube graph Q n (see for example Biggs [Big74]), on (the power set of) { x , . . . x n } , mediated by the Lehmer code. To each permutation σ ∈ S n we attach that upward paththrough Q n given by ∅ → { x σ − (1) } → · · · → { x σ − (1) , . . . , x σ − ( n − } → { x σ − (1) , . . . , x σ − ( n ) } .The specification of a trailing code ( d m +1 , . . . , d n ), m ∈ { , ..., n − } , then, identifies exactly those σ ∈ S n sharing a certain trailing path { x σ − (1) , . . . , x σ − ( m ) } → · · · → { x σ − (1) , . . . , x σ − ( n ) } .The inductive structure (3) thus relies on the fact that the subgraph beneath any fixed such trail-ing path is itself a cube graph, namely the cube graph Q m on { x σ − (1) , . . . , x σ − ( m ) } , and thatan inequality of the form (4) holds regarding those nodes immediately beneath any fixed node { x σ − (1) , . . . , x σ − ( m ) } . 6 The case n = 2 : further directions In this appendix, we study a further family of extensions of Cover’s classical game, in which wegrant Player 1 a more flexible form of choice.A relationship has been noted between Cover’s game and the so-called “two-envelope paradox” (seefor example Clark and Shackel [CS00] for a thorough treatment), in which an intuitively compelling“switching” argument must be refuted. We note in particular the paper [SSS04] of Samet, Samet,and Schmeidler, which places these two games into a common framework, whereby, in each case, anadversary begins by selecting a pair of points in the plane which straddles the main diagonal.In a problem related to the two-envelope paradox, one might seek to explain the insolubility of thegame in which:Player 1 writes down any number on a clip of paper. Player 2 takes this slip and looks atthe number. Player 1, then, randomly decides whether respectively to write a numberwhich is higher than or lower than the first number onto a second slip. Player 2 mustdecide whether the number in his hand is the larger of the two numbers.in the face of this game’s apparent similarity to the original game of Cover.In light of these considerations, we propose a general adversarial game. Following [SSS04], wedenote by A = (cid:8) ( x , x ) ∈ R | x < x (cid:9) and B = (cid:8) ( x , x ) ∈ R | x > x (cid:9) , respectively, theregions strictly above and below the main diagonal in R . We now have:Player 1 selects a pair ( x A , x B ) ∈ A × B , subject to a fixed ruleset R ⊂ A × B . Player 2randomly chooses one point, say x , from this pair and looks at its x -coordinate. Player2 must decide whether x resides in A or in B .Player 2 seeks a strategy by which he can correctly state whether x belongs to A or B with probability strictly greater than one-half .Cover’s original game is the special case of this game in which R = { (( a, b ) , ( b, a ) ∈ A × B | a < b } is the set consisting of those pairs of points which are mirror reflections about thediagonal. The “paradoxically unsolvable” game above corresponds to that R = { (( x, x + ǫ A ) , ( x, x − ǫ B )) ∈ A × B | ǫ A , ǫ B > } consisting of those pairs ( x A , x B ) which occupya shared vertical line. We have a general question: for which rulesets R does Player 2 have adominant strategy? Definition 3.
To any ruleset R ⊂ A × B as defined above, we associate a set X R equipped with abinary relation P R , defined as: X R = [ ( x A , x B ) ∈ R { π ( x A ) } ∪ { π ( x B ) } , P R = [ ( x A , x B ) ∈ R ( π ( x B ) , π ( x A )) , where π : R → R is the projection onto the first coordinate. In other words, we declare x B P R x A just when ( x A , x B ) arises as the pair of x -coordinates of some pair ( x A , x B ) ∈ R .This association has the property that the winning strategies under any ruleset R correspond exactlyto the order-preserving maps of X R into the unit interval.7 roposition 3. A strategy f : X R → [0 , is dominant for Player 2 if and only if x B P R x A = ⇒ f ( x B ) > f ( x A ) .Proof. We identify each map f : X R → [0 ,
1] with that strategy which declares that any x = ( x , x )resides in B with probability f ( x ).Such a strategy is winning, moreover, if and only if, for each ( x A , x B ) ∈ R , the quantity P (win) = P (chooses x B ) · P (states “ B ”) + P (chooses x A ) · P (states “ A ”)= 12 · f ( x B ) + 12 (1 − f ( x A ))= 12 + f ( x B ) − f ( x A )2strictly exceeds . This is true if and only if f ( x B ) > f ( x A ) for each pair ( x A , x B ) permitted under R .A result of Herden [Her89] establishes necessary and sufficient conditions under which at least onesuch map exists: Theorem 4 (Herden) . An order-preserving map f : X R → [0 , exists if and only if P R is acyclicand there exists a countable descending chain { D i } i ∈ N of subsets of X R within which, for each pair x B P R x A , some D i exists which satisfies x B ∈ D i but x A D i .Proof. This is [Her89, Prop. 3.1].Cover’s original game’s corresponding ordered set is R with its usual ordering, the order-preservingmaps of which into the unit interval are exactly the strictly increasing functions (cf. Strategy 2above). The unsolvable game, on the other hand, yields X R = R with P R the diagonal relation P R = (cid:8) ( x, x ) ∈ R | x ∈ R (cid:9) . This relation is evidently not acyclic. References [Big74] Norman Biggs.
Algebraic Graph Theory , volume 67 of
Cambridge Tracts in Mathematics .Cambridge University Press, 1974.[Cov87] Thomas M. Cover.
Open problems in communication and computation , chapter 5.1. Pickthe Largest Number. Springer-Verlag, 1987.[CS00] Michael Clark and Nicholas Shackel. The two-envelope paradox.
Mind , 109(435), 415-442 2000.[Fer89] Thomas S. Ferguson. Who solved the secretary problem?
Statistical Science , 4(3):282–296, 1989.[Gne94] Alexander V. Gnedin. A solution to the game of googol.
The Annals of Probability ,22(3):1588–1595, 1994. 8Gne16] Alexander Gnedin. Guess the larger number.
Mathematica Applicanda , 44(1):183–207,2016.[Her89] G. Herden. On the existence of utility functions.
Mathematical Social Sciences , 17:297–313, 1989.[KRTV13] Thomas Kesselheim, Klaus Radke, Andreas T¨onnis, and Berthold V¨ocking. An opti-mal online algorithm for weighted bipartite matching and extensions to combinatorialauctions. In Hans L. Bodlaender and Giuseppe F. Italiano, editors,
Algorithms – ESA2013 , volume 8125 of
Lecture Notes in Computer Science . Springer, 2013.[LC98] E. L. Lehmann and George Casella.
Theory of Point Estimation . Springer Texts inStatistics. Springer, second edition, 1998.[Sam81] S. M. Samuels. Minimax stopping rules when the underlying distribution is uniform.
Journal of the American Statistical Association , 76:188–197, 1981.[Sed77] Robert Sedgewick. Permutation generation methods.
ACM Computing Surveys ,9(2):137–164, 1977.[SN90] Stephen Silverman and Arthur N´adas. On the game of googol as the secretary problem.In Thomas F. Bruss, Thomas S. Ferguson, and Stephen M. Samuels, editors,
Strate-gies for Sequential Search and Selection in Real Time , volume 125 of
ContemporaryMathematics . American Mathematical Society, 1990.[SSS04] Dov Samet, Iddo Samet, and David Schmeidler. One observation behind two-envelopepuzzles.
The American Mathematical Monthly , 111(4):347–351, 2004.
Benjamin E. Diamond
JPMorgan Chase & Co.email: [email protected]@gmail.com