Hindawi Publishing Corporation Journal of Probability and Statistics Volume 2013, Article ID 623183, 5 pages http://dx.doi.org/10.1155/2013/623183 Research Article On-Line Selection of c-Alternating Subsequences from a Random Sample Robert W. Chen,1 Larry A. Shepp,2 and Justín Ju-Chen Yang3 1 Department of Mathematics, University of Miami, Coral Gables, FL 33124, USA Department of Statistics, Wharton School, University of Pennsylvania, Philadelphia, PA 19104, USA 3 Department of Statistics, Harvard University, 1 Oxford Street, Cambridge, MA 02138-2901, USA 2 Correspondence should be addressed to Robert W. Chen; chen@math.miami.edu Received 24 August 2012; Accepted 4 January 2013 Academic Editor: Shein-chung Chow Copyright © 2013 Robert W. Chen et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. A sequence π1 , π2 , . . . , ππ is a π-alternating sequence if any odd term is less than or equal to the next even term −π and the any even term is greater than or equal to the next odd term +π, where π is a nonnegative constant. In this paper, we present an optimal on-line procedure to select a π-alternating subsequence from a symmetric distributed random sample. We also give the optimal selection rate when the sample size goes to infinity. 1. Introduction Given a finite (or infinite) sequence π₯ = {π₯1 , π₯2 , . . . , π₯π , . . .} of real numbers, we say that a subsequence π₯π1 , π₯π2 , . . . , π₯ππ , . . . with 1 ≤ π1 < π2 < ⋅ ⋅ ⋅ < ππ < ⋅ ⋅ ⋅ is π-alternating if we have π₯π1 + π < π₯π2 > π₯π3 + π < π₯π4 ⋅ ⋅ ⋅, where π is a nonnegative real number. When π = 0, π₯π1 , π₯π2 , . . . , π₯ππ , . . . is alternating. We are mainly concerned with the length πΌ(π₯) of the longest π-alternating subsequence of π₯. Here, we study the problem of making on-line selection of a π-alternating subsequence. That is now we regard the sequence π₯1 , π₯2 , . . . as being available to us sequentially, and, at time π when π₯π is available, we must choose to include π₯π as a term of our subsequence or reject π₯π as a member of our subsequence. We will consider the sequence to be given by independent, identically distributed, symmetric random variables over the interval [0, 1]. In [1], Arlotto et al. studied the case that the sequence to be given by independent, identically distributed, uniform random variables over the interval [0, 1] and π = 0. So this paper can be considered as an extension of their paper. Now we need to be more explicit about the set πΌπΌ of feasible strategies for on-line selection. At time π, when ππ is presented to us, we must decide to select ππ based on its value, the value of earlier members of the sequence, and the actions we have taken in the past. All of this information can be captured by saying that ππ , the index of the πth selection, must be a stopping time with respect to the increasing sequence of π-fields, πΉπ = π{π1 , π2 , . . . , ππ }, π = 1, 2, . . .. Given any feasible policy π in πΌπΌ the random variable of most interest here is π΄ππ (π), the number of selections made by the policy π up to and including time π. In other words, π΄ππ (π) is equal to the largest π for which there are stopping times 1 ≤ π1 < π2 < ⋅ ⋅ ⋅ < ππ ≤ π such that {ππ1 , ππ2 , . . . , πππ } is a π-alternating subsequence of the sequence {π1 , π2 , . . . , ππ }. In this paper, we are interested in the optimal selection and the asymptotic rate of the optimal selection. That is, we have a selection policy ππ∗ in πΌπΌ such that lim πΈ [π΄ππ (ππ∗ )] = lim supπΈ [π΄ππ (π)] . π→∞ π→∞ π∈πΌπΌ (1) 2. Main Results For each 0 ≤ π < 1 and each 0 ≤ π ≤ (1 − π)/2, we define a threshold function π∗ as follows: π∗ (π¦) = max{π+π, π+π¦} for all 0 ≤ π¦ ≤ 1 − π. We now recursively define random variables {ππ : π = 1, 2, . . .} by setting π0 = π¦ and taking ππ = ππ−1 if ππ < π∗ (ππ−1 ), ππ = 1 − ππ if ππ ≥ π∗ (ππ−1 ). Introduce a value π−1 ∗ function π(π, π¦, π) = πΈ{∑∞ π=1 π πΌ[ππ ≥ π (ππ−1 )] | π0 = π¦}, 2 Journal of Probability and Statistics where 0 < π < 1 is a constant and πΌ[ππ ≥ π∗ (ππ−1 )] is the indicator function of the event [ππ ≥ π∗ (ππ−1 )]. Let πΊ be the distribution function and π the probability density function of ππ . If ππ is not a uniform random variable over the interval [0, 1], then we will assume that πσΈ exists and is nonzero. Since ππ is symmetric over the interval [0, 1], πΊ(1 − π₯) = 1 − πΊ(π₯) and π(π₯) = π(1 − π₯) for all 0 ≤ π₯ ≤ 1. It is easy to see that π (π, π¦, π) = ππΊ [max (π, π¦) + π] π (π, π¦, π) +∫ 1 max(π,π¦)+π In summary, we have the following equations: π (1 − π − π) [1 − π + ππΊ (π)] = [1 + ππ (π)] πΊ (π) , πσΈ (π) [1 − ππΊ (π + π)] = π (π + π) {π [π (π) − π (1 − π − π)] − 1} , (7) πσΈ (1 − π − π) [1 − π + ππΊ (π)] = π (π) {π [π (1 − π − π) − π (π)] − 1} . [1 + ππ (π, 1 − π₯, π)] π (π₯) ππ₯ For all π ≤ π¦ ≤ 1 − π, let us define = ππΊ [max (π, π¦) + π] π (π, π¦, π) +∫ 1−max(π,π¦)−π 0 2 β (π¦) = [1 + ππ (π, π₯, π)] π (π₯) ππ₯ [1 − ππΊ (π¦ + π)] (1 − π + ππΊ (π¦)) . π (π¦ + π) (2) since π(π₯) = π(1 − π₯) for all 0 ≤ π₯ ≤ 1. For simplicity, we will let π(π¦) denote π(π, π¦, π) for fixed π and π. It is easy to check 1−π−π that for all 0 ≤ π¦ ≤ π, π(π¦) = ππΊ(π + π)π(π¦) + ∫0 [1 + ππ(π₯)]π(π₯)ππ₯, for all π < π¦ ≤ 1 − π, π(π¦) = ππΊ(π¦ + π)π(π¦) + 1−π¦−π ∫0 [1 + ππ(π₯)]π(π₯)ππ₯, and for all 1 − π < π¦ ≤ 1, π(π¦) = 0. Since for all 0 ≤ π¦ ≤ π, π(π¦) = π(π), π(π¦) = ππΊ(π¦ + π)π(π¦) + [1 + ππ(π)]πΊ(1 − π¦ − π) for all 1 − π − π ≤ π¦ ≤ 1 − π. Since πΊ(1 − π¦ − π) = 1 − πΊ(π¦ + π), π(π¦) = ππΊ(π¦ + π)π(π¦) + [1 + ππ(π)][1−πΊ(π¦+π)] for all 1−π−π ≤ π¦ ≤ 1−π. From now on, we will let πσΈ (π) denote the right derivative of the function π at π and πσΈ (1 − π) denote the left derivative of the function π at 1 − π. For π < π¦ < 1 − π, when we differentiate π(π¦) we have the following differential equation: πσΈ (π¦) {1 − ππΊ (π¦ + π)} = ππ (π¦ + π) π (π¦) Then we have the following equation: πσΈ (1 − π − π) = πσΈ (π) − β (π) β (1 − π − π) 1−π−π 2π (1 − π + ππΊ (π₯ − π)) π (π₯) ππ₯. ∫ β (1 − π − π) π (9) Proof of (9). Differentiate (4). Again, we have πσΈ σΈ (π¦) [1 − ππΊ (π¦ + π)] = ππ (π¦ + π) [2πσΈ (π¦) + πσΈ (1 − π¦ − π)] (3) + πσΈ (π¦ + π) {π [π (π¦) − π (1 − π¦ − π)] − 1} . − [1 + ππ (1 − π¦ − π)] π (1 − π¦ − π) . (10) Since π(1 − π¦ − π) = π(π¦ + π) and π(1 − π¦) = π(π¦). Now we have the following differential equations: πσΈ (π¦) {1 − ππΊ (π¦ + π)} = ππ (π¦ + π) π (π¦) − [1 + ππ (1 − π¦ − π)] π (π¦ + π) Replace π[π(π¦) − π(1 − π¦ − π)] − 1 by πσΈ (π¦)((1 − ππΊ(π¦ + π))/π(π¦ + π)) and replace πσΈ (1 − π¦ − π) by {−2 − πσΈ (π¦)((1 − ππΊ(π¦ + π))/π(π¦ + π))}{π(π¦)/(1 − π + ππΊ(π¦))}. And after the simplification, we have the following equation: πσΈ σΈ (π¦) [1 − ππΊ (π¦ + π)] = π (π¦ + π) {π [π (π¦) − π (1 − π¦ − π)] − 1} , (4) = ππ (π¦ + π) πσΈ (1 − π¦ − π) {1 − ππΊ (1 − π¦)} = ππ (π¦) π (1 − π¦ − π) − [1 + ππ (π¦)] π (π¦) (5) = π (π¦) {π [π (1 − π¦ − π) − π (π¦)] − 1} . Add (3) and (4) together, we have πσΈ (1 − π¦ − π) (8) 1 − ππΊ (1 − π¦) 1 − ππΊ (π¦ + π) = −πσΈ (π¦) − 2. π (π¦) π (π¦ + π) (6) −2π (π¦) + πσΈ (π¦) 1 − π + ππΊ (π¦) × {πσΈ (π¦ + π) 1 − ππΊ (π¦ + π) π (π¦ + π) +ππ (π¦ + π) [2 − π (π¦) [1 − ππΊ (π¦ + π)] ]} π (π¦ + π) [1 − π + ππΊ (π¦)] + ππ (π¦ + π) . (11) Journal of Probability and Statistics 3 Multiplying both sides of (11) by [1 − π + ππΊ(π¦)][1 − ππΊ(π¦ + π)]/π(π¦ + π), we obtain the following equation: πσΈ σΈ (π¦) 2 [1 − ππΊ (π¦ + π)] [1 − π + ππΊ (π¦)] π (π¦ + π) (iv) πσΈ (1 − π − π) ×∫ [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯. (16) 2 1 − ππΊ (π¦ + π) ] [1 − π + ππΊ (π¦)] π (π¦ + π) + πσΈ (π¦) ππ (π¦ + π) {2 1−π π+π = −2ππ (π¦) [1 − ππΊ (π¦ + π)] + πσΈ (π¦) πσΈ (π¦ + π) [ 2π β (π) − β (1 − π − π) β (1 − π − π) = πσΈ (π) [1 − π + ππΊ (π¦)] [1 − ππΊ (π¦ + π)] πσΈ (π¦ + π) Now we have four unknown variables π(π), π(1 − π − π), and πσΈ (π), πσΈ (1 − π − π) and also have four linear equations involving these four unknown variables. We solve these four linear equations and obtain the following solutions. Theorem 2. 2 −π (π¦) [ 1 − ππΊ (π¦ + π) ] }. π (π¦ + π) (i) π (π) = (ππΊ (π) [1 − ππΊ (π + π)] (12) +π ∫ [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯) π+π Notice that −1 × (π (1 − π) [1 − ππΊ (π + π)]) , 2 1 − ππΊ (π¦ + π) −β (π¦) = π (π¦ + π) [ ] [1 − π + ππΊ (π¦)] π (π¦ + π) σΈ 1−π σΈ + ππ (π¦ + π) {2 (ii) πσΈ (π) = (π (π + π) [1 − π + ππΊ (π¦)] [1 − ππΊ (π¦ + π)] πσΈ (π¦ + π) 1−π × {π ∫ π+π 2 −π (π¦) [ 1 − ππΊ (π¦ + π) ] }. π (π¦ + π) [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯ − [1 − ππΊ (π + π)] (13) × [1 − π + ππΊ (π)] }) Equation (12) can be rewritten as σΈ σΈ σΈ π (π¦) β (π¦) + π (π¦) β (π¦) = −2π [1 − ππΊ (π¦ + π)] π (π¦) . (14) By integrating both sides of (14), we have πσΈ (π¦) = πσΈ (π) −1 2 × ([1 − ππΊ (π + π)] [1 − π + ππΊ (π)]) , σΈ (iii) π (1 − π − π) = πΊ (π) {( [1 − π + ππΊ (π)] [1 − ππΊ (π + π)] π¦ 2π β (π) − ∫ [1 − ππΊ (π§ + π)] π (π§) ππ§. β (π¦) β (π¦) π (15) −π ∫ 1−π π+π [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯) × ((1 − π) [1 − ππΊ (π + π)] Therefore, we have the following theorem. −1 × [1 − π + ππΊ (π)]) } . Theorem 1. (i) π (1 − π − π) [1 − π + ππΊ (π)] = [1 + ππ (π)] πΊ (π) , (ii) πσΈ (π) [1 − ππΊ (π + π)] = π (π + π) {π [π (π) − π (1 − π − π)] − 1} , (iii) πσΈ (1 − π − π) [1 − π + ππΊ (π)] = π (π) {π [π (1 − π − π) − π (π)] − 1} , (17) By Theorem 2, πσΈ (π) = 0 if and only if π∫ 1−π π+π [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯ (18) = [1 − ππΊ (π + π)] [1 − π + ππΊ (π)] since π(π + π) and [1 − ππΊ(π + π)]2 [1 − π + ππΊ(π)] are positive. For each 0 < π < 1, let π(π) denote a solution of πσΈ (π) = 0. 4 Journal of Probability and Statistics The next theorem indicates that when π < 1 but close enough to 1, π(π) is unique and 0 ≤ π(π) < (1 − π)/2. Theorem 3. When π < 1 but close enough to 1, π(π) is unique and 0 ≤ π(π) < (1 − π)/2. Proof. For all 0 ≤ π < (1 − π)/2, let πΎ (π) = π ∫ 1−π π+π [1 − π + ππΊ (π₯ − π)] π (π₯) ππ₯ (19) − [1 − ππΊ (π + π)] [1 − π + ππΊ (π)] . Then πΎ (π) = − π {π (1 − π) [1 − π + ππΊ (1 − π − π)] +π (π) [1 − ππΊ (π + π)]} < 0, 1−π ) 2 = − [1 − π + ππΊ ( 1−π 1+π )] [1 − ππΊ ( )] < 0, 2 2 1 2 πΎ (0) = π2 ∫ πΊ (π₯ − π) π (π₯) ππ₯ − (1 − π) > 0 π Now we define these two strategies for the π-alternating subsequence as follows: (IσΈ ) the maximally π-timid strategy which can be described as follows: at the start, accept the first observation which is less than (1 − π)/2, accept the next one which is greater than (1 + π)/2, accept the next one which is less than (1 − π)/2, then accept the next one which is greater than (1+π)/2. Continue this way until we observe π observations, then we stop; σΈ πΎ( (II) the purely greedy strategy which can be described as follows: at the start, accept the first observation, then accept the next one which is greater than the first one, accept the next one which is less than the second selected one, then accept the next one which is greater than the third selected one. Continue this way until we observe π observations, then we stop. (20) if π is close enough to 1. Therefore, 0 ≤ π(π) < (1 − π)/2 and π(π) is unique if π is close enough to 1. This completes the proof of Theorem 3. A routine calculation is as follows: (IIσΈ ) the purely π-greedy strategy which can be described as follows: at the start, accept the first observation which is less than 1 − π, accept the next one which is greater than the first selected one +π, accept the next one which is less than the second selected one −π, then accept the next one which is greater than the third selected one +π. Continue this way until we observe π observations, then we stop. (22) When π = 0, the maximally π-timid strategy is the maximally timid strategy and the purely π-greedy strategy is the purely greedy strategy. In fact, the maximally π-timid strategy is the case when π = (1−π)/2 and the purely π-greedy strategy is the case when π = 0. The asymptotic selection rate for the maximally π-timid strategy is πΊ((1 − π)/2) and the asymptotic selection rate for 1−π the purely π-greedy strategy is ∫0 πΊ(π₯)π(π₯+π)ππ₯/(1−πΊ(π)). if π is close enough to 1. Therefore, (1 − π)π(π(π), π(π), π) → 2πΊ(π(1)) as π ↑ 1, where Example 6. When π = 0, then the asymptotic selection rate for both the maximally timid strategy and the purely greedy strategy is 1/2. These results are the same as those in [1]. −2ππ (π (π)) π (π (π) + π) π (π (π)) = < 0. [1 − π + ππΊ (π (π))] [1 − ππΊ (π (π) + π)] (21) σΈ σΈ So we have found the maximum of the function π. After the simplification, π (π (π) , π (π) , π) = ∫ 1−π(1) π(1)+π 1 − π + 2ππΊ (π (π)) π (1 − π) πΊ (π₯ − π) π (π₯) ππ₯ = πΊ (π (1)) [1 − πΊ (π (1) + π)] . (23) Example 4. When π = 0, then 2πΊ(π(1)) = 2 − √2. Example 5. When πΊ(π₯) = π₯ for all 0 ≤ π₯ ≤ 1, then 2πΊ(π(1)) = (1 − π)(2 − √2). In [1], the following two strategies are mentioned: (I) the maximally timid strategy which can be described as follows: at the start, accept the first observation which is less than 1/2, then accept the next one which is greater than 1/2, then accept the next one which is less than 1/2. Continue this way until we observe π observations, then we stop; Example 7. When πΊ(π₯) = π₯ for all 0 ≤ π₯ ≤ 1, then the asymptotic selection rate for both the maximally π-timid strategy and the purely π-greedy strategy is (1/2)(1 − π). It is easy to see these results are consistent with the result of Example 5. If the random variables π1 , π2 , . . . , ππ are independent, identically distributed symmetric random variables over the interval [π, π], where π < π and π, π are finite, then we can change ππ into ππ by ππ = (ππ − π)/(π − π). Then π1 , π2 , . . . , ππ are independent, identically distributed symmetric random variables over the interval [0, 1]. Let πσΈ = π/(π − π). Then selecting a π-alternating subsequence from the random sample π1 , π2 , . . . , ππ is exactly the same to select a πσΈ -alternating subsequence from the random sample π1 , π2 , . . . , ππ . So the asymptotic selection rate is still Journal of Probability and Statistics 5 Table 1: The asymptotic optimal selection rates for various distributions and π. π 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 πΊ1 (π₯) 2 − √2 0.540492 0.509190 0.489881 0.466034 0.424335 0.366680 0.294696 0.209273 0.110936 0 πΊ2 (π₯) 2 − √2 0.545962 0.506516 0.466834 0.426295 0.384147 0.339473 0.290641 0.234738 0.164273 0 πΊ3 (π₯) 2 − √2 0.527208 0.468629 0.410051 0.351472 0.292893 0.234315 0.175736 0.117157 0.058579 0 the same. Or we can find π(1) directly by solving the following equation: π−π−π(1) ∫ π+π(1)+π πΊ (π₯ − π) π (π₯) ππ₯ (24) = πΊ (π + π (1)) [1 − πΊ (π + π (1) + π)] . For 0 ≤ π ≤ (π−π), π ≤ π¦ ≤ (π−π), and π ≤ π < π+(π−π−π)/2 the threshold function π∗ is defined by π∗ (π¦) = max(π, π¦)+π for all π ≤ π¦ ≤ (π−π). This time, we recursively define random variables {ππ : π = 1, 2, . . .} by setting π0 = π¦ and taking ππ = ππ−1 if ππ < π∗ (ππ−1 ), ππ = π − ππ if ππ ≥ π∗ (ππ−1 ). Here π ≤ π¦ ≤ (π − π), { {2π₯ (1 − π₯) πΊ1 (π₯) = { {1 − 2π₯ + 2π₯2 { πΊ2 (π₯) = 1 if 0 ≤ π₯ ≤ , 2 1 if < π₯ ≤ 1, 2 2 −1 sin (√π₯) , π (25) πΊ3 (π₯) = π₯, πΊ4 (π₯) = 3π₯2 − 2π₯3 , 2 { {2π₯ πΊ5 (π₯) = { {−2π₯2 + 4π₯ − 1 { 1 if 0 ≤ π₯ ≤ , 2 1 if < π₯ ≤ 1. 2 From Table 1, it seems that when the distribution has higher chances on the tails, then the asymptotic optimal selection rate is higher. On the other hand, when the distribution has higher chance near the center, then the asymptotic optimal selection rate is lower. However, we do not have a proof for this statement. We are now considering the case when π1 , π2 , . . . , ππ have an arbitrary distribution. We have made some progress, but it is still in the premature state. We hope to be able to find the asymptotic optimal selection rate in a forth coming paper. πΊ4 (π₯) 2 − √2 0.499942 0.414948 0.332852 0.255622 0.185176 0.123399 0.072153 0.033284 0.008624 0 πΊ5 (π₯) 2 − √2 0.481120 0.380891 0.291619 0.214252 0.148786 0.095223 0.053563 0.023806 0.005952 0 References [1] A. Arlotto, R. W. Chen, L. A. Shepp, and J. M. Steele, “Online selection of alternating subsequences from a random sample,” Journal of Applied Probability, vol. 48, no. 4, pp. 1114–1132, 2011. Advances in Operations Research Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Advances in Decision Sciences Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Mathematical Problems in Engineering Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Journal of Algebra Hindawi Publishing Corporation http://www.hindawi.com Probability and Statistics Volume 2014 The Scientific World Journal Hindawi Publishing Corporation http://www.hindawi.com Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 International Journal of Differential Equations Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Volume 2014 Submit your manuscripts at http://www.hindawi.com International Journal of Advances in Combinatorics Hindawi Publishing Corporation http://www.hindawi.com Mathematical Physics Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Journal of Complex Analysis Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 International Journal of Mathematics and Mathematical Sciences Journal of Hindawi Publishing Corporation http://www.hindawi.com Stochastic Analysis Abstract and Applied Analysis Hindawi Publishing Corporation http://www.hindawi.com Hindawi Publishing Corporation http://www.hindawi.com International Journal of Mathematics Volume 2014 Volume 2014 Discrete Dynamics in Nature and Society Volume 2014 Volume 2014 Journal of Journal of Discrete Mathematics Journal of Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Applied Mathematics Journal of Function Spaces Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Optimization Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014