The solution of a generalized secretary problem via analytic expressions

Given integers $1\leq k<n$, the Gusein-Zade version of a generalized secretary problem is to choose one of the $k$ best of $n$ candidates for a secretary, which are interviewing in random order. The stopping rule in the selection is based only on the relative ranks of the successive arrivals. It is known that the best policy can be described by a non--decreasing sequence $(s_1, \ldots, s_k)$ of integers with $l\leq s_l<n$ for every $1\leq l\leq k$, and conversely, any such a sequence determines the general structure of the best policy. We found a finite analytic expression for the probability of success when using the optimal policy with a sequence $(s_1, \ldots, s_k)$. We also study the problem of the construction of the optimal sequence, i.e. a sequence which maximizes the corresponding probability of success. We discovered finite analytic expressions which enable to calculate the elements $s_l$ of an optimal sequence one by one, from $l=k$ to $l=1$. Until now, such expressions were derived separately, and only for the values $k\leq 3$.


Introduction and the main results
In the paper we study the Gusein-Zade version of a generalized secretary problem (see [11]). There are many ways for presenting this optimal stopping problem. In the romantic version, instead of interviewing the candidates for a secretary, we have a bachelor who has an occasion to meet a certain number of girls during his bachelorhood and who found out about this number (denoted further by n) in some miraculous way. The bachelor wants to marry one of the k best girls, where k is fixed and less than n. He can not be sure of success as he follows in his live the following principles: in every time he gets to know only one of the girls and after some time he must decide to marry her or to split up. In the latter case he starts to meet the next girl, but later on he can not go back to any girl he decided to split up. The order in which he gets to know the girls is random, thus there are n! equally likely orderings. The bachelor is able to judge only the present girl or the girls he met previously, and he has no idea about the attraction of the future girls. However, we assume that no two girls will turn out equally attractive for him. The problem is to find the best policy for the bachelor, i.e. the policy which maximizes the probability of the marriage to the girl that is one of the k best. In the paper [11] it was proved the following general structure of such a policy: Proposition 1 ( [11]). The best policy for a bachelor who wants to marry one of the k best girls is described by a certain non-decreasing sequence (s 1 , . . . , s k ) of integers with l ≤ s l < n for every 1 ≤ l ≤ k in the following way: marry the i 0 -th girl, where 1 ≤ i 0 ≤ n is the smallest integer such that there is 1 ≤ l ≤ k which satisfies: (i) s l < i 0 ≤ s l+1 (assume s k+1 := n − 1), (ii) the i 0 -th girl is one of the l best of i 0 girls met so far.
If such a number i 0 does not exist, then marry the n-th girl.
Given an arbitrary non-decreasing sequence (s 1 , . . . , s k ) of integers such that l ≤ s l < n for every 1 ≤ l ≤ k, it is natural to ask about the probability of success when using the above described policy with the sequence (s 1 , . . . , s k ). Namely, we would like to know how this probability depends on the elements of this sequence and how to construct a sequence which maximizes this probability. Definition 1. We call a sequence (s 1 , . . . , s k ) which maximizes the probability of success for the policy described in Proposition 1 as an optimal sequence.
The classical version, i.e. the case k = 1, was solved by Lindley ([13]) by using equations arising from the principle of dynamic programming. He solved these equations by simple backward recursion and obtained that the only element of an optimal sequence is equal to the smallest integer 1 ≤ x ≤ n − 1 such that H(n − 1) − H(x) ≤ 1, where H(x) := x j=1 1/j is the x-th harmonic number, as well as that the probability of success when using the optimal policy with an element s 1 is equal to s 1 (H(n − 1) − H(s 1 − 1))/n (see also [9] for the survey paper). The cases k = 2, 3 were solved by using backward induction and exploiting the existence of an imbedded Markov chain. In the case k = 2 the corresponding analytic expressions were stated by Gilbert and Mosteller ( [10]) and the proof was outlined by Dynkin and Yushkevich ( [6]). The case k = 3 was derived by Quine and Law ([14]).
In the present paper, we extended to an arbitrary value of k the formula for an optimal sequence in the following way.
Theorem 2. Let (s 1 , . . . , s k ) be a sequence such that s l = t l + l − 1 for every 1 ≤ l ≤ k, where each t l is defined as the smallest integer 1 ≤ x ≤ n−l satisfying the inequality where δ k,n := and the map d l : {1, . . . , n − l} → R is defined for each 0 ≤ l ≤ k as follows: Then (s 1 , . . . , s k ) is an optimal sequence.
In the right side of (1) we use the standard conventions for the empty sum and the empty product and evaluate them to 0 and to 1, respectively. In particular, for l = k the right side of (1) just equals δ k,n /k. Hence, the above formula allows to calculate the elements s l (1 ≤ l ≤ k) one by one, from l = k down to l = 1.
In the present paper we also proved the following Theorem 3. The probability of success for the policy described in Proposition 1 is equal to where t l := s l − l + 1 for 1 ≤ l ≤ k.
The known constructions of the optimal sequence via analytic expressions were presented in the similar form as in Theorem 2 but, as we have mentioned above, only in the cases k = 1, 2, 3. For higher values of k, as well as for some other versions of this problem, the algorithms computing the probability of success and the elements of an optimal sequence can be found in various of papers (see [1,2,3,4,5,7,8,11,12,15]). However, in contrast to the analytic solution, these methods apply mechanisms via dynamic or linear programming, and hence only numerically allow to determine the elements of an optimal sequence.

The strategy of the proofs
Our proofs are purely elementary and only combinatorial arguments are used. At first, since no two girls are equally attractive for the bachelor, we assign the rank to each girl, which is an integer from 1 to n, i.e. the rank 1 to the best girl, the rank 2 to the next best girl and so on. Then each of the possible n! orderings of the girls defines uniquely a permutation π of the set {1, . . . , n} such that π(i) is the rank of the i-th girl for every i ∈ {1, . . . , n}, and conversely, any permutation π of the set {1, . . . , n} defines in the obvious way the possible ordering of the girls.
Let w = (s 1 , . . . , s k ) be a non-decreasing sequence such that l ≤ s l < n for every l ∈ {1, . . . , k} and let us assume that the policy from Proposition 1 is used with the sequence w. Let π be a permutation defining the ordering of the girls. If the policy successfully chooses a candidate of top k, then we say that π is a lucky permutation corresponding to w. We distinguish the case when there exists l ∈ {1, . . . , k} such that for some i ∈ {1, . . . , n − 1} the following two conditions hold: • among the first i girls, there are at most l−1 girls which are more attractive than the i-th girl (equivalently, the set {π(1), . . . , π(i)} contains at most l elements which are not greater than π(i)).
We call such a number l a w-threshold of the permutation π, and the corresponding number i we call a (π, l, w)-element (see also Definition 2 in Section 3). Let now assume that the permutation π has a w-threshold. If l 0 ∈ {1, . . . , k} is the smallest w-threshold of π, then the bachelor using the policy will marry to the i 0 -th girl, where i 0 is the smallest (π, l 0 , w)-element. Otherwise (i.e. when π has no w-thresholds), the bachelor will marry to the n-th girl. In particular, the set Π w of all lucky permutations corresponding to the sequence w naturally splits into two subsets: the subset Π w,1 of permutations having a w-threshold and the subset Π w,2 of permutations without w-thresholds. Obviously, the probability of success when using the policy is equal to the ratio For every l ∈ {1, . . . , k} we define the following sets: and the set X (0) := {ǫ}, where ǫ is the empty sequence. Further, we refer to the elements of the sets X (l) as words and to the elements of the sets X l as letters.
In Theorem 4 (Section 3), we provide for every non-decreasing sequence w = (x 1 , . . . , x k ) ∈ X (k) the analytic formulae for the cardinalities of the sets Π w,1 and Π w,2 . To derive the formula for |Π w,1 |, we consider for each 1 ≤ l ≤ k and x l < i ≤ x l+1 the subset S(l, i) ⊆ Π w,1 of all permutations π such that the number l is the smallest w-threshold of π and the number i is the smallest (π, l, w)-element. In particular, we can write Further, for every π ∈ S(l, i), we divide the set {π(1), . . . , π(i)} into two subsets: the subset of those elements which are not greater than k and the subset of those elements which are greater than k. Conversely, given arbitrarily the sets Y, Y ′ satisfying Then, we have: where M j (j ∈ {1, . . . , k}) is the set of those pairs (Y, Y ′ ) for which |Y | = j. In Proposition 5, we characterize the elements of the set S(Y, Y ′ , l, i), which allows to find the following formula for its cardinality: We use the above formula to find the cardinality of the set S(l, i) and, consequently, the following formula for |Π w,1 |: where the map r l : {l+1, . . . , n} → R is defined for every integer l ≤ k as follows: By using a similar idea as in Proposition 5, we also characterize the elements of the set Π w,2 (see Proposition 8), which gives the following formula for |Π w,2 |: In Section 4, we derive the formula for the elements of an optimal sequence. To this aim, we introduce the notion of an optimal point (see Definition 3) of an arbitrary map f : Z → R, where Z ⊆ X (l) or Z ⊆ X l for some l ∈ {1, . . . , k}.
Next, we define for every l ∈ {0, 1 . . . , k} a map T l : X (k−l) → R (see formula (14)), which constitutes a natural generalization of the map We study the maps T l in relation to the maps c l , D l (l ∈ {0, . . . , k}) and F l,w (l ∈ {1, . . . , k}, w ∈ X (k−l) ) defined as follows: where x 1 in (7) denotes the first letter of a word w ∈ X (k−l) or x 1 := n − 1 depending on whether l < k or l = k. In particular, we obtain In Proposition 9, we show how to describe the maps D l in terms of the maps d l . As a result, we obtain for every l ∈ {1, . . . , k} that the right side of (1) is equal to where w (l) ∈ X (k−l) arises from the sequence w := (t 1 , t 2 + 1, . . . , t k + k − 1) by deleting the first l letters. In Proposition 10, for any l ∈ {1, . . . , k} and w ∈ X (k−l) , we show that if t is the smallest element x ∈ {1, . . . , n − l} such that d l (x) ≤ D l (w)/l, then the number t + l − 1 is an optimal point of the map F l,w . Next, we show (Proposition 11) that an arbitrary sequence w ∈ X (k) is an optimal point of the map T if and only if for every l ∈ {1, . . . , k} the l-th letter of w is an optimal point of the map F l,w (l) . Finally, in Proposition 12, we show that if w ∈ X (k) is an optimal point of T , then w must be a non-decreasing sequence. As a simple consequence of Theorem 4 and the above propositions, we obtain our main results (see Section 5). The proofs of Propositions 9-12 are based on various combinatorial identities and on some auxiliary properties of the maps r l , c l , D l and F l,w . We derive them in Section 6. Further, we use for all i, j ∈ Z the following notations:

The formula for the probability of success
Let Sym(n) be the set of all permutations of the set [n]. For every π ∈ Sym(n) and every i ∈ [n] we call the image π(i) the π-rank of the element i.
We call the element i a π-candidate if π(i) ∈ [k]. In particular, if the ordering of the girls is defined by a permutation π ∈ Sym(n), then the bachelor's win is to marry to the i 0 -th girl, where i 0 ∈ [n] is an arbitrary π-candidate.
For every π ∈ Sym(n) and every i ∈ [n] we also consider the relative π-rank of the element i, i.e. the number of the elements from the set [i] such that their π-ranks are not greater than π(i); we denote this number by ρ π (i). In other words, ρ π (i) is the number of those elements from the set π([i]) which are not greater than π(i).
Definition 2. Let π ∈ Sym(n), l ∈ [k] and let w = (s 1 , . . . , s k ) ∈ X (k) be a non-decreasing sequence. We call an arbitrary element i ∈ [s l , s l+1 ] satisfying the inequality ρ π (i) ≤ l a (π, l, w)-element. If the set [s l , s l+1 ] contains at least one (π, l, w)-element, then we call the number l a w-threshold of the permutation π. In other words, the element l ∈ [k] is a w-threshold of π if there is i ∈ [s l , s l+1 ] such that ρ π (i) ≤ l (as before, we assume s k+1 := n − 1).
Let now assume that the bachelor uses the policy from Proposition 1 with a sequence w = (s 1 , . . . , s k ) and that the ordering of the girls is defined by a permutation π ∈ Sym(n). Then π is a lucky permutation corresponding to w if and only if one of the following conditions holds: • π has a w-threshold and if l 0 ∈ [k] is the smallest w-threshold of π, then the smallest (π, l 0 , w)-element is a π-candidate, • π has no w-thresholds and the element n is a π-candidate.
Theorem 4. Let w 0 = (x 1 , . . . , x k ) ∈ X (k) be a non-decreasing sequence. Then the number of lucky permutations corresponding to w 0 and having a w 0 -threshold is equal to where the maps r l : [l, n] → R (l ∈ [≤ k]) are defined as in (5). The number of lucky permutations corresponding to w 0 and having no w 0 -thresholds is equal to Proof. Let us fix the integers l 0 , i 0 such that l 0 ∈ [k] and i 0 ∈ [x l0 , x l0+1 ]. At first, we determine the number of lucky permutations π ∈ Π w0 such that l 0 is the smallest w 0 -threshold of π and i 0 is the smallest (π, l 0 , w 0 )-element. Let us denote by S(l 0 , i 0 ) the set of all such permutations. For every permutation π ∈ Sym(n), we denote Obviously, we have , then π is a lucky permutation, and hence i 0 is a π-candidate, which implies π(i 0 ) ∈ [k] and consequently π(i 0 ) ∈ X π . Further, since i 0 is a (π, l 0 , w 0 )-element, we obtain ρ π (i 0 ) ≤ l 0 , which means that the set π([i 0 ]) contains at most l 0 elements which are not greater than π(i 0 ). Since π(i 0 ) ∈ X π ⊆ [k] and X ′ π ⊆ [k, n], all these elements must belong to the set X π . In particular, if we denote X π := {y 1 , . . . , y j0 } for some j 0 ∈ [k], where y 1 < y 2 < . . . < y j0 , then we obtain: π(i 0 ) = y ι for some 1 ≤ ι ≤ min{j 0 , l 0 }. Note that ι is the relative π-rank of the element i 0 .
Proof (of Proposition 5). Let π ∈ S(Y, Y ′ , l 0 , i 0 ) be arbitrary. By the above reasoning, the conditions (i)-(ii) directly follow from the equalities Y = X π and Y ′ = X ′ π . To justify (iii) let us assume contrary that there is Thus the set π([i 1 ]) contains at most j 1 elements which are not greater than y ′ j1 = π(i 1 ). Hence the relative π-rank of the element i 1 is not greater than j 1 , i.e. ρ π (i 1 ) ≤ j 1 . Since the sequence (x j1 , . . . , x l0+1 ) is non-decreasing, we have But ρ π (i 1 ) ≤ j 1 ≤ j 2 , and hence i 1 is a (π, j 2 , w 0 )-element. Consequently j 2 is a w 0 -threshold of π. Since j 2 ≤ l 0 and l 0 is the smallest w 0threshold of π, we obtain: j 2 = l 0 . Consequently, the element i 1 is a (π, l 0 , w 0 )element. Since i 1 < i 0 , we obtain the contradiction with the assumption that i 0 is the smallest (π, l 0 , w 0 )-element. This justifies the first part of Proposition 5.

Proposition 6. The number of elements in the set
where j 0 := |Y |.
Proof (of Proposition 6). We use the characterization of the set S(Y, Y ′ , l 0 , i 0 ) from Proposition 5. By the conditions (i)-(iii), we see that every permutation π ∈ S(Y, Y ′ , l 0 , i 0 ) can be constructed as follows. At first, we choose arbitrarily an element ι ∈ [µ j0,l0 ] and define: π(i 0 ) := y ι . We can do that in µ j0,l0 ways. Next, for every j ∈ [l 0 ] we choose an element i j ∈ [x j ] and define π(i j ) := y ′ j . We can do that in l0 j=1 (x j − j + 1) ways. Further, we define the π-ranks from the set . . , y ′ i0−1 }. Namely, for every y ∈ Y we choose an element i y ∈ [i 0 − 1] \ {i 1 , . . . , i l0 } and define π(i y ) := y. We can do that in (i 0 − l 0 − 1)! ways. Finally, we define the π-ranks from the set [n] \ (Y ∪ Y ′ ), i.e. for every i ∈ [n] \ [i 0 ] we choose an element y i ∈ [n] \ (Y ∪ Y ′ ) and define π(i) := y i . We can do that in (n − i 0 )! ways. Hence, the claim directly follows from the above construction.
Proof (of Proposition 7). We have: Since |M j | = k j n−k i0−j , we obtain from Proposition 6: where From the Vandermonde's identity, we obtain The claim now follows from (13).
Obviously, the number of all lucky permutations from Π w0 which have a w 0 -threshold is equal to k l=1 x l+1 i=x l +1 |S(l, i)|. We see by Proposition 7 that this double sum can be written as follows The crucial point for the further study, which also finishes the proof of the first part of Theorem 4, is the observation that the sum x l+1 i=x l +1 lr l (i) in the above expression can be written in a closed form as follows: The last equality follows from the identity lr l (x) = r l−1 (x) − r l−1 (x − 1) for all l ∈ [≤ k] and x ∈ [l, n], which we derive in Section 6 (see Lemma 2 (iii) therein).
To show the second part of Theorem 4, we provide the following characterization of all lucky permutations from Π w0 which have no w 0 -thresholds. Proposition 8. Let π ∈ Π w0 be an arbitrary lucky permutation without w 0thresholds. Then the following two conditions hold: . . , y k } and y 1 < y 2 < . . . < y k , then y j ∈ π([x j ]) for every j ∈ [k].
Conversely, if π ∈ Sym(n) is an arbitrary permutation which satisfies (i)-(ii), then π is a lucky permutation corresponding to w 0 and π has no w 0 -thresholds.
By using the conditions (i)-(ii) from Proposition 8, we see that every lucky permutation π ∈ Π w0 without w 0 -thresholds can be constructed as follows. At first, we choose arbitrarily an element ι ∈ [k] and we define: π(n) := ι. We can do that in k ways. Next, we choose for every j ∈ [k] an element i j ∈ [x j ] and define π(i j ) := y j . This can be done in k j=1 (x j − j + 1) ways. Finally, we define the π-ranks from the set [n] \ {ι, y 1 , . . . , y k }, which can be done in (n − k − 1)! ways. As a result of this construction, we obtain the required formula. This completes the proof of Theorem 4.

The formula for an optimal sequence
Let T : X (k) → R be the map defined for every w = (x 1 , . . . , x k ) ∈ X (k) as follows: T (w) := P 1 (w) + P 2 (w), where and ξ k,n := k(n − k − 1)!/n!. We see by Theorem 4 that the probability of success for the policy described in Proposition 1 is equal to T (w 0 ), where w 0 = (s 1 , . . . , s k ).
, then we call an element w 0 ∈ Z such that f (w 0 ) ≥ f (w) for every w ∈ Z an optimal point of this map.
In particular, we see that if w 0 ∈ X (k) is an optimal point of the map T , then w 0 is an optimal sequence (see Definition 1) if and only if it is a nondecreasing sequence. In this section, we show (see Proposition 12) that every optimal point of the map T is indeed a non-decreasing sequence, which implies that every optimal point of T is simultaneously an optimal sequence. We also derive the formula for an optimal point of T (see Propositions 10,11). For this aim, we introduce certain natural generalizations of this map. Namely, for every l ∈ [k] 0 we define the map T l : X (k−l) → R as follows: where the maps R l,j , Γ l,j,j ′ : are defined as follows (in the formula for R l,j below we assume x k−l+1 := n − 1): In particular T 0 = T and T k = ξ k,n . Let us consider the maps D l (l ∈ [k] 0 ) defined by (7). In Section 6, we derive some properties of these maps (see Lemma 4 therein), which allows to describe them in terms of the maps d l defined by (3) in the following way. Proof. The case l = k directly follows from the equality D k (ǫ) = δ k,n (see Lemma 4 (i)). In the case l ∈ [k − 1] 0 , we have by Lemma 4 (ii) where the map c l is defined by (6). Hence, since c l (x l+1 ) = d l ( x l+1 ), we can write By easy induction on m, we can extend the last formula as follows: (15) for every l ∈ [k − 1] 0 and m ∈ [l − 1, k − 1]. The claim now follows by taking m := k − 1 in (15).
Let F l,w (l ∈ [k], w ∈ X (k−l) ) be the maps defined by (8). In the proof of the next proposition, we use some properties of the maps c l , which we derive in Section 6. Proposition 10. Let l ∈ [k] and w ∈ X (k−l) . If s is the smallest number x ∈ [l − 1, n − 1] such that c l (x + 1) ≤ D l (w)/l, then s is an optimal point of the map F l,w . Consequently, if t is the smallest number x ∈ [n − l] such that d l (x) ≤ D l (w)/l, then t + l − 1 is an optimal point of F l,w .
Proof. For every x ∈ [l − 1, n − 2] the following equality holds: Indeed, directly by the definition of the map F l,w , the left side of (16) is equal to Lemma 3 (iii) in Section 6), is equal to the right side of (16). Hence, the first part follows from (16) and from the fact that the map c l is non-increasing (see Lemma 3 (iv)). The second part follows now from the equalities d l ( The below proposition is based on the observation that for every word w = (x 1 , . . . , x k ) ∈ X (k) and every l ∈ [k] there are A ∈ R + , B ∈ R which do not depend on the letter x l and such that T (w) = A · F l,σ l (w) (x l ) + B (for the proof see Lemma 5 in Section 6).
Proposition 11. A sequence w = (x 1 , . . . , x k ) ∈ X (k) is an optimal point of the map T if and only if for every l ∈ [k] the letter x l is an optimal point of the map F l,σ l (w) .
Proof. Suppose, contrary, that the sequence w = (x 1 , . . . , x k ) is an optimal point of T and there is l ∈ [k] such that the letter x l is not an optimal point of F l,σ l (w) . Let x ′ l ∈ X l be an optimal point of F l,σ l (w) and let w ′ ∈ X (k) be the word arising from w by replacing the l-th coordinate with x ′ l . Since σ l (w ′ ) = σ l (w), we have: By Lemma 5, there are A ∈ R + , B ∈ R such that Consequently T (w ′ ) > T (w), which contradicts with the assumption that w is an optimal point of T . Conversely, let w = (x 1 , . . . , x k ) ∈ X (k) be such that for every l ∈ [k] the letter x l is an optimal point of the map F l,σ l (w) . We show that w is an optimal point of T . Let v = (y 1 , . . . , y k ) ∈ X (k) be an arbitrary optimal point of the map T . Let us define the words w l ∈ X (k) (0 ≤ l ≤ k) as follows: w 0 := w, w k := v and w l := (y 1 , . . . , y l , x l+1 , . . . , x k ) for every l ∈ [k − 1]. In particular, for each l ∈ [k] the two words w l−1 and w l differ only in the l-th position, which is equal to x l in w l−1 and to y l in w l . Hence, by Lemma 5, there are A ∈ R + and B ∈ R such that T (w l−1 ) = A · F l,σ l (w l−1 ) (x l ) + B, T (w l ) = A · F l,σ l (w l ) (y l ) + B.
Since the letter x l is an optimal point of F l,σ l (w) and σ l (w l−1 ) = σ l (w l ) = σ l (w), we have T (w l−1 ) ≥ T (w l ). Consequently, we obtain the inequalities: Since v is an optimal point of T , we have T (w) = T (v). Thus w is an optimal point of T .
The proof of the next proposition is based on various properties of the maps D l , c l (l ∈ [k] 0 ), which we derive in Section 6 (see Lemmas 3,4).
is an optimal point of the map T , then w is a non-decreasing sequence.
Proof. Let w = (x 1 , . . . , x k ) be an optimal point of the map T . By Proposition 11, we see that for every l ∈ [k] the letter x l is an optimal point of the map F l,σ l (w) . Let us fix l ∈ [k] \ {1} and let us denote x := x l−1 , y := x l , v := σ l (w). We have to show that x ≤ y. We can assume that x = l − 1 and y = n − 1. Since x and y are optimal points of F l−1yv and F l,v , respectively, we obtain: Since y − l + 1 > 0, we obtain from the first of the inequalities in (17): (y − l + 1) · l · c l (y + 1) ≤ (y − l + 1) · D l (v).

The proofs of Theorems 2-3
The main results are a straightforward consequence of Theorem 4 and Propositions 9-12.
Proof (of Theorem 2). Let w 0 := (s 1 , . . . , s k ) be a sequence constructed as in Theorem 2. By Proposition 9, we see that for every l ∈ [k] the right side of (1) is equal to D l (σ l (w 0 ))/l. Thus for every l ∈ [k] the number t l = s l − l + 1 is the smallest number x ∈ [n − l] which satisfies d l (x) ≤ D l (σ l (w 0 ))/l, and hence, by Proposition 10, the number s l is an optimal point of the map F l,σ l (w0) . By Proposition 11, we obtain that w 0 is an optimal point of the map T . Moreover, the sequence w 0 is non-decreasing by Proposition 12. Hence, we see by the definition of the map T and by Theorem 4 that w 0 is an optimal sequence. Proof (of Theorem 3). Let us denote w 0 := (s 1 , . . . , s k ). By Proposition 9, the expression (4) is equal to −D 0 (w 0 ), which, by the definition of the map D 0 , is equal to T 0 (w 0 ) = T (w 0 ). Hence, by the definition of the map T and by Theorem 4, this expression is equal to the probability of success for the policy described in Proposition 1.
Now, we can use the equalities (27)-(28) from Lemma 1 and obtain that the difference which finishes the proof of Lemma 2.
Lemma 3. The maps c l (l ∈ [k] 0 ) have the following properties: (iv) for every l ∈ [k] the map c l is non-increasing, Proof. By the definition of the maps c l , we can write Hence, the item (i) easily follows from the definition of the map b l−1 and from the identity j k j = k k−1 j−1 for j ∈ Z. The item (ii) in the case l ∈ {0, 1} directly follows from the definitions of the maps c l , r l−1 , r l . In the case l ∈ [1, k], we can use the item (i) for the left side and Lemma 2 (i) for the right side, and then the claim easily follows from the identities (23)-(24) from Lemma 1. To show the item (iii), we see by (ii) that the difference c l−1 (x − 1) − c l−1 (x) is equal to: Again, by Lemma 2 (iii), we have r l−1 (x − 1) = r l−1 (x) + l · r l (x), and hence The claim now follows from the item (ii). To show (iv), we obtain by the item (iii) that for every l ∈ [k −1] and x ∈ [l +1, n] the difference c l (x−1)−c l (x) is equal to (l + 1)c l+1 (x), which is a nonnegative number by the definition of the map c l+1 . Hence the map c l is non-increasing for every l ∈ [k − 1]. If l = k = 1, then the item (iv) follows directly from the definition of the map c l . If l = k > 1, then by the definition of the map c l , we obtain Hence, we see that also in this case the map c l is non-increasing. As for the item (v), the case l = 1 follows directly from the item (iii) and from the definition of the map c 2 . In the case l ∈ [1, k], by the item (i), we obtain that the difference (x + 1 − l)c l (x) − xc l (x + 1) is equal to which is equal to by the equality (26) from Lemma 1.
Lemma 4. The maps D l (l ∈ [k] 0 ) have the following properties: , where x 1 denotes the first letter of w, (iii) D l (w) > 0 for each l ∈ [1, k] and w ∈ X (k−l) .
Consequently, we have: which finishes the proof of the item (ii). The item (iii) directly follows from the items (i)-(ii) and from the inequalities c l (x) ≥ 0 for all l ∈ [1, k], x ∈ [l, n].
Lemma 5. Let w = (x 1 , . . . , x k ) ∈ X (k) be arbitrary. Then for every l ∈ [k] there exist A ∈ R + , B ∈ R which do not depend on the letter x l and such that T (w) = A · F l,σ l (w) (x l ) + B.

Conclusion
In the present paper, we obtained the analytic formulae for an optimal sequence (s 1 , . . . , s k ) in the Gusein-Zade version ( [11]) of a generalized secretary problem. In this problem, the interviewer would like to choose one of the k best of n candidates arriving in random order and the stopping rule is based on the relative ranks of the successive arrivals. For any sequence (s 1 , . . . , s k ) describing the optimal policy, we also found the analytic formula for the probability of success when using the policy with this sequence. Our original approach is purely elementary and bases on the combinatorial analysis of the problem. The obtained formulae reveal the possibility of an extension to an arbitrary value of k for closed expressions describing the elements of an optimal sequence. Until now such expressions were derived only for k ≤ 3. Since the maps d l in the inequalities (1) describing the optimal sequence are all non-increasing, our formula reduces the determination of elements in this sequence to solving a system of k equations. In other words, we need to solve a recurrence with the number of steps bounded by k, which is substantially more advantageous than the implicit solution via computing the optimum from the known mechanism of dynamic or linear programming. On the other hands, in recent years, the linear programming approach was discovered to analyze a broader class of secretary problems. For example, in [3] the authors consider a so-called J-choice K-best secretary problem (the case J = 1 was the subject of the present paper), where finding of an optimal solution reduces to solving the corresponding linear program. In [4] the authors use linear programming but to the so-called continuous and infinite models of the secretary problem (see also [2,12]). In [15] even a more general problem is studied via this technique -a so called shared Q-queue J-choice K-best secretary problem. Therefore, it seems natural to analyze and develop our combinatorial approach also for wider classes of secretary problems, which might result in finding some simplifications in the corresponding formulae. The construction of the optimal sequence from Theorem 2 could also be applied in the study of the limits τ l (k) := lim n→∞ s l /n (1 ≤ l ≤ k) and their behaviour. This could help in solving some (according to our knowledge) open questions concerning these limits, such as (see also [8,9]): Is it true that τ 1 (k) monotonically decreases with k?