Lower and Upper Bounds for the Discrete Bi-Directional Preemptive Conversion Problem with a Constant Price Interval

: In the conversion problem, wealth has to be distributed between two assets with the objective to maximize the wealth at the end of the investment horizon. The bi-directional preemptive conversion problem with a constant price interval is the only problem, of the four main variants of the conversion problem, that has not yet been optimally solved by competitive analysis. Assuming a given number of monotonous price trends called runs, lower and upper bounds for the competitive ratio are given. In this work, the assumption of a given number of runs is rejected and lower and upper bounds for the bi-directional preemptive conversion problem with a constant price interval are given. Furthermore, an algorithm based on error balancing is given which at minimum achieves the given upper bound. It can also be shown that this algorithm is optimal for the single-period model.


Introduction
In the conversion problem (CP), an initial wealth W 0 is distributed between two assets, e.g., dollars and yen. At the beginning, the wealth is fully invested in dollars. The objective is to maximize the terminal wealth W T at time T which is the end of the investment horizon. The distribution of wealth can be redone at specific points in time t = 1, . . . , T. Conversion can only be done at the price q t which is valid at time t. At time T all wealth has to be invested in one certain asset. Let q = q 1 , . . . , q T be the sequence of the prices, and let b = b 1 , . . . , b T be the sequence of the wealth distributions, where b t is the percentage of wealth which is invested in dollars. In fact, the CP is able to find the optimal sequence b, depending on the price sequence q.
The difficulty of this problem follows from the fact that the sequence q is not known in advance. At each time t = 1, . . . , T, a new element q t of the sequence q is revealed and a decision has to be made with incomplete information. These kind of problems are called online problems (see [1]).
There are many variants of the CP which can be differentiated by the nature of the search, the nature of conversion, and the given information (see [2]). The nature of the search describes the direction(s) in which conversion is allowed. In the uni-directional CP, it is only allowed to convert from one asset into another asset, but not to convert back. In contrast, in bi-directional conversion it is allowed to convert back and forth between the two assets. The nature of conversion describes the amount that can be converted at once. In non-preemptive conversion it is only allowed to convert all or nothing. Thus, at each time t the wealth is fully invested in one of the two assets. In contrast, in preemptive conversion it is allowed to convert an arbitrary part of the wealth. From both characteristics, the four main variants of the CP follow: uni-directional non-preemptive CP, uni-directional preemptive CP, bi-directional non-preemptive CP, and bi-directional preemptive CP.
Given information refers to the input sequence. In this work, it is assumed that q t lies within a constant price interval [m, M]. So each price has to be between a lower bound m and an upper bound M. It holds that 0 < m ≤ q t ≤ M, with t = 1, . . . , T. Another given information often used in bi-directional conversion is the number of runs k (see [3][4][5]). A run is a partial sequence of consecutive prices which monotonously increase or decrease. The number of runs k can be given in addition to or instead of the number of points in time T.
Algorithms which solve online problems are called online algorithms. In the conversion literature, competitive analysis is one common measure to evaluate online algorithms introduced by [6]. In competitive analysis an online algorithm (ON) is compared with the optimal offline algorithm (OPT). This algorithm has all information about the price sequence and makes optimal decisions. Let OPT(q) be the optimal solution on sequence q, and let ON(q) be the solution of the algorithm which has to be evaluated. Furthermore, let Ω be the set of all possible input sequences. To evaluate an online algorithm with competitive analysis, that value c is searched, for which holds true. Then c is called the competitive ratio. From Equation (1) follows that the ratio between the optimal solution and the evaluated algorithm can never be greater than c. An algorithm with a smaller c is better. An online algorithm that achieves the smallest possible c is called optimal. Another performance measure is the performance ratio (see [7]). Here, it is assumed that a class of distributions can be determined where the distribution of the input sequences is part of it. That means, only a subset Ω ∈ Ω is considered. Thus, the performance ratio is a bound for the ratio between OPT(q) and ON(q), which holds only for a part of the possible input sequences. The performance ratio is a lower bound for the competitive ratio.
Three of the four main variants of the CP are optimally solved. Reference [8] considers the uni-directional non-preemptive CP and provides the online algorithm RPP, which solves the variant of the CP optimally, in the case that M and m are given. The algorithm uses a reservation price q * . If the first price q t ≤ q * appears, the algorithm converts all wealth. The uni-directional preemptive CP with given M, m, and T is considered by [3,9]. They provide the optimal online algorithm uTH. The competitive ratio c(uTH) of uTH is for a given T and discrete time. The authors provide also a formula for the competitive ratio in the case of continuous time.
The bi-directional non-preemptive CP with given M and m is optimally solved by [5]. The optimal algorithm MRPR(k) calculates depending on the number of runs for each run an own reservation price.
The competitive ratio of MRPR(k) is close to . The bi-directional preemptive CP has not yet been optimally solved. Authors in [3] provide the non-optimal online algorithm bTH. Depending on the number of runs, k bTH considers the bi-directional preemptive CP as k separate uni-directional preemptive conversion problems. For each of the k runs, bTH applies the algorithm uTH, such that an upper bound U and a lower bound L for even k can be provided. The authors in [4] provide the algorithm bTH'. Analogous to bTH, bTH' applies the uni-directional algorithm uTH', which is based on uTH, on each run k. The competitive ratio of uTH' and bTH' are (see [4]) and Based on bTH', the authors in [4] provide an improved lower bound for the bi-directional preemptive CP and continuous time.
In the literature, there are alternative assumptions on the price sequence. One of these assumptions is that prices are interrelated. That means, two consecutive prices can maximally differ by two given factors, θ 1 and θ 2 , with 0 < θ 1 < 1 < θ 2 (see [10][11][12]). Researchers in [12] provide (among other things) an optimal algorithm for the bi-directional preemptive CP with interrelated prices.
Some authors have also considered additional constraints. Those in [13], considered the uni-directional non-preemptive CP with decreasing M over time. Authors in [14] considered the uni-directional preemptive CP, but they divided the wealth into u equal valued units and it is only allowed to convert one unit per point in time t. Based on this, the authors in [15] considered a problem that is allowed to convert an integer number of units per point in time. Researchers in [16,17] considered the bi-directional non-preemptive CP with a bounded number of transactions.
The authors in [8,18] show that the CP is a special case of the portfolio selection problem (PSP). In the PSP, wealth can be distributed on n ≥ 2 assets. For n = 2, the PSP corresponds to the bi-directional preemptive CP.
In this work, the upper and lower bounds for the competitive ratio of the bi-directional preemptive CP are given. These bounds hold for a given T, discrete time, and a constant price interval between the price bounds m and M.

Problem Formulation
In the bi-directional preemptive CP, a player converts wealth between two assets, e.g., dollars and yen. At the beginning, the initial wealth, W 0 , is invested in dollars. At each time t = 1, . . . , T a price q t is given. Converting dollars leads to q t yen and converting yen leads to 1 q t dollar. The objective is to maximize the wealth at time T. At time T all wealth has to be invested in dollars, i.e., b t = 1. At each time t = 1, . . . , T − 1 the player can choose an arbitrary distribution of wealth, i.e., b t ∈ [0, 1]. For the terminal wealth W T , it holds that . In the following, the problem description is summarized as a mathematical program: Note that the mathematical program describes a problem in which the wealth has to be invested in dollars at the end. It is also possible that the wealth has to be invested in yen at the end. The asset in which the wealth has to be invested at the end is indicated by b T . However, b T does not influence the objective function. Therefore, the competitive ratio is independent from the final wealth distribution. Thus, it is sufficient to consider only the case where wealth has to be invested in dollars at the end.
In this work, the player has the given information that the price will stay within a price interval, i.e., q t ∈ [m, M] for all t = 1, . . . , T, where m represents a lower bound and M an upper bound.

Calculating the Lower Bound
To determine a lower bound for an online optimization problem, it is sufficient to find an algorithm that is optimal on a part of the possible input sequences (see [4]). As the algorithm is optimal even if it holds only for certain input sequences, there is no algorithm that can achieve a smaller performance ratio on these sequences. Therefore, no algorithm can achieve a smaller competitive ratio than this performance ratio.
To determine the performance ratio, the worst-case-sequences are searched, which maximize the ratio between OPT and ON. Therefore, the errors which can occur have to be identified. An error describes a type of deviation from the optimal decision. In the CP, there are two possible errors which may occur. It is possible to convert too much or too little wealth into yen. If the price raises, the best decision is to invest all of the wealth in dollars, and if the price drops, the best decision is to invest all of the wealth in yen. As it is not known in advance if a price will raise or drop, both errors are possible at each time. These errors are negatively correlated. For example, if the player converts more to yen, the too-little error decreases, but at the same time, the too-much error increases. Let E i be the maximum value for a specific error type i = 1, . . . , J, where J is the number of types of errors which can occur using a specific online algorithm. The competitive ratio of this algorithm holds: Using error balancing, decisions are made in the way that the highest possible values for all errors are equal. This minimizes the maximum value over all errors.

Lemma 1.
There is no deterministic algorithm that achieves a smaller competitive ratio for the bi-directional preemptive conversion problem, with given M, m, and T, than 2 Proof of Lemma 1. Lemma 1 is proven by error balancing. In the single-period model, only one decision has to be made. The following two errors can occur: convert too little or too much wealth. An algorithm is optimal for T = 2 if both errors are balanced. In the single-period model, the highest too-little error occurs if the price drops to m. In contrast, the highest too-much error occurs if the price raises to M. Thus, it is only necessary to consider sequences with q 2 ∈ {m, M}. These price sequences are q 1 = q 1 , m and q 2 = q 1 , M. On sequence q 1 , OPT invests the whole wealth in yen and obtains For the too-little error holds: In the sequence q 2 , OPT does not invest in yen and obtains OPT( For the too-much error holds: Error balancing is done by equalizing the two errors, i.e., E 1 = E 2 . Rearranging to b 1 leads to: Inserting Equation (10) into Equation (8) and Equation (9) leads to: To determine the price q 1 = q * which leads to the highest ratio of OPT and ON, the first derivative (11) is set equal to zero: Rearranging Equation (12) to q * leads to: Since q * > 0 holds true, it follows: For the second derivative holds: Inserting Equation (14) into Equation (15) leads to a negative value. That means, the function of the ratio between OPT and ON has a maximum at this price. Inserting Equation (14) into Equation (11) and rearranging leads to the highest possible error for T = 2: Equation (10) leads to an optimal decision. Therefore, it is not possible that an algorithm exists which achieves a smaller competitive ratio than 2 In the following, the EBA algorithm for the bi-directional preemptive CP is given (for more details, see [19]). The algorithm is based on Equation (10) and is optimal for T = 2: Algorithm EBA: Step 2: Set b T = 1.
Note that [12] provides the algorithm OCIP to solve the bi-directional preemptive CP with interrelated prices. OCIP is similar to EBA. The CP with a constant price interval can be reformulated as CP with interrelated prices, with the factors θ 1,t = m q t and θ 2,t = M q t ∀t = 1, . . . , T. This problem can be solved by using EBA. In contrast, OCIP can be used if θ 1,t = θ 1 and θ 2,t = θ 2 ∀t = 1, . . . , T hold true.

Theorem 1.
There is no deterministic algorithm that achieves a smaller competitive ratio for the bi-directional preemptive conversion problem with given M, m and T than Proof of Theorem 1. Let q = q 1 , . . . , q T be a price sequence for which it holds that every second price has to be m or M. On such a sequence, an algorithm which invests all wealth in yen at price m and all wealth in dollars at price M makes optimal decisions at every even t. At every odd t, the same two errors can be made. First, investing too much wealth in yen when the next price will be M. Second, investing too little wealth in yen when the next price will be m.
On a sequence with T prices, T 2 errors can be made. On each partial sequence consisting of two prices, where q 2 ∈ {m, M} holds for the second price, the same maximum ratio between OPT and ON can be achieved. From Lemma 1, it follows that the competitive ratio on a sequence with T = 2 cannot be smaller than 2 . Therefore, on a sequence with arbitrary T, the competitive ratio of an optimal algorithm cannot be smaller than this with the power of T 2 . Thus, it holds that Since EBA is optimal for T = 2, it follows that on each sequence with arbitrary T ≥ 2, using Equation (10) is the optimal decision at t = T − 1. This follows from the fact that both errors which can occur are balanced. Nevertheless, Equation (10) does not lead to optimal decisions at t ≤ T − 2 .
Lemma 2. EBA is not optimal for the bi-directional preemptive conversion problem with a constant price interval and given M, m, and T for T ≥ 3.

Proof of Lemma 2.
Consider the sequence q 1 = q 1 , q 2 , q 3 with q 1 < (M · m) ( 1 2 ) and q 2 < q 1 . From Equation (14), it follows that the first derivative of the ratio between OPT and ON for T = 2 is zero for the value (M · m) ( 1 2 ) . There is no other positive value for which the derivative is zero. Thus, the closer the price is on (M · m) ( 1 2 ) , the higher the ratio between OPT and ON within one period can be.
Furthermore, it is known that the maximum ratio of OPT and ON within one period is equal in the cases of raising or falling prices. However, due to this, the sequence q 1 cannot be a worst-case-sequence. The ratio of OPT and ON at the first period can raise by the same factor, regardless of a raising or falling price. The ratio at the second period can be higher if it holds q 2 > q 1 . Thus, there is no worst-case-sequence that fulfills the properties of sequence q 1 . It would be better to choose a wealth distribution that invests less in yen than EBA. This reduces the ratios of OPT an ON on worst-case-sequences, with q 2 > q 1 .

Calculating the Upper Bound
Authors in [19] used EBA to give an upper bound for the bi-directional preemptive conversion problem with constant price interval and unknown k. The upper bound is based on the idea that there is a sequence, on which the maximum ratio that can be achieved within a period is achieved within every period (see Theorem 2). Proof of Theorem 2. The upper bound for the competitive ratio follows from EBA. From Equation (16) follows the highest possible ratio between OPT and EBA, within one period. There are T − 1 periods in a sequence with T prices. Thus, the ratio between OPT and ON can raise T − 1 times. Therefore, an optimal algorithm has to achieve a competitive ratio smaller than or equal to the right side of Equation (16), with the power of T − 1.
Nevertheless, the upper bound is still not tight and can be improved. To achieve this, the competitive ratio of EBA for T = 3 can be determined. First the definition of a symmetric algorithm is introduced and it is shown that EBA is a symmetric algorithm. Therefore, b t is defined as function of the free variable q t , i.e., b t (q t ).
The authors in [19] showed that for a symmetric algorithm that holds that on each sequence q = q 1 , q 2 . . . , q T , the ratio between OPT and ON is the same as on sequence q = M·m q 1 , M·m q 2 , . . . , M·m q T . Thus, it is only necessary to consider a part of the possible sequences to determine the worst-case-sequences, e.g., it is sufficient to consider only sequences that start with a raising price.

Lemma 3. EBA is a symmetric online algorithm.
Proof Thus, for EBA must hold Rearranging (19) leads to Thus, it follows that EBA is a symmetric online algorithm.

Theorem 3.
For the competitive ratio of an optimal online algorithm for the bi-directional preemptive conversion problem with given M, m, and T = 3 holds Proof of Theorem 3. Using EBA, there are four possible types of worst-case-sequences for T = 3. These differ by their price development: 1. the price raises twice, 2. the price first raises and then falls, 3. the price first falls and then raises, 4. the price falls twice.
As EBA balances the errors that can occur at the last period, type 1 and 2, and also type 3 and 4 are balanced. As EBA is symmetric, the errors of type 1 and 4 are also balanced. Thus, in all four types of possible worst-case-sequences the errors are balanced and it is sufficient to consider one type of sequences. Consider the sequence q 1 = q 1 , q 2 , M with q 1 < q 2 < M. For this sequence holds: Inserting Equation (17) into Equation (22) and rearranging leads to: To find a maximum of a function with two free variables (here q 1 and q 2 ), the partial derivatives have to be calculated. Both derivatives are set equal to zero. Thus, it follows from Equation (24) after rearranging to q 2 : From Equation (25) after rearranging to q 1 follows: Note that there are two other solutions for q 2 ; however, both are independent from q 1 . Further, the denominators of the Equations (26) and (27) Inserting Equations (28) and (29) into Equation (23) leads to Equation (21).
Based on Theorem 3, an improved upper bound can be calculated for arbitrary T ≥ 3.

Theorem 4.
For the competitive ratio of an optimal online algorithm for the bi-directional preemptive conversion problem with given M, m and T holds c ≤ (21) follows, using EBA, the ratio between OPT and ON cannot grow more than the factor

Proof of Theorem 4. From Equation
within two periods. Thus, for a sequence with T − 1 periods, the competitive ratio has to be lower or equal to (30) Note that from Lemma 1 and Theorem 4 follows the upper bound for the competitive ratio of EBA.
A lower upper bound for the bi-directional preemptive CP with a constant price interval can be found by determining the competitive ratio of EBA for T > 3. However, the complexity raises. Furthermore, even if the competitive ratio for arbitrary T ≥ 2 is known, the upper bound could be improved as EBA is not optimal for T ≥ 3.

Comparison of the Competitive Ratios
One question is how EBA performs compared to the algorithms for the bi-directional preemptive CP with a constant price interval which exist in literature. The authors in [3,4] do not provide a formula for the competitive ratio which can be rearranged to c. This makes it hard to proof if one of the algorithms is better than the others. Therefore, an experimental analysis is used to compare the algorithms. Furthermore, since [3,4] use the number of runs k in the formula for their competitive ratios, new competitive ratios for these algorithms have to be determined which do not depend on k.
In fact, only lower bounds for the competitive ratio will be determined. Therefore, the performance ratio for these algorithms is calculated on sequences where the algorithms do not convert. Proof of Theorem 5. Only sequences on which bTH' does not trade are considered. The highest ratio between OPT and ON results on the sequence q 1 = c(uTH ) · m, m, c(uTH ) · m, m, . . . , c(uTH ) · m, m for even T ≥ 2. It holds that: Proof of Theorem 6. The proof is analogous to the proof of Theorem 5. It holds that Since it holds that c(uTH) < c(uTH ) (see [4]), it also holds that c(uTH) T 2 < c(uTH ) T 2 . Therefore, EBA is only compared with bTH. For the experimental analysis, the following parameters are used: M ∈ {2, 10, 100, 1000}, T ∈ {2, 5, 7, 13} and m = 1. Table 1 shows the values for the upper bound of EBA and the lower bound of bTH. From Table 1, it follows that both algorithms achieve the same competitive ratio for T = 2. This is not surprising. bTH is optimal for a sequence consisting of one run. A sequence with T = 2 points in time consists of one run. Thus, bTH is also optimal in the single-period model. The upper bounds for the competitive ratio of EBA are lower than the lower bounds of the competitive ratio of bTH for T ∈ {7, 13}. Only for T = 5 and small values of M the results of bTH are lower than the results of EBA. In these cases, it is not known which algorithm is better. The results indicate that EBA is getting better compared to bTH with increasing T and with an increasing ratio M m . This is not surprising. EBA is designed with the objective to perform well in the case of given T and unknown k. In contrast, bTH is designed with the objective to perform well in the case of given k. Nevertheless, these results show that there is a lack in the literature considering the bi-directional preemptive CP with a constant price interval, and given T and unknown k.

Conclusions
In this work, the bi-directional preemptive CP with a constant price interval is considered. For the first time upper and lower bounds that are independent from the number of runs, are given. Furthermore, the algorithm EBA is presented. EBA optimally solves the problem for T = 2. Due to this, the performance ratio of EBA for a specific type of sequences could be used to calculate the lower and upper bound. EBA is based on the idea of error balancing. The definition of a symmetric algorithm is introduced. This definition makes it easier to determine the competitive ratio of a certain type of online algorithms.
The algorithm EBA is compared with the two other competitive online algorithms for the bi-directional preemptive CP with a constant price interval that exists in the literature. For specific parameters, EBA is the best algorithm known so far. However, it is shown that EBA is not optimal in the case of T ≥ 3. Therefore, one open question is how to optimally solve the bi-directional preemptive CP with constant price interval for T ≥ 3. Another open question is how to solve the corresponding PSP with n ≥ 2 assets.