SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
q _ {B} = q _ {B - 1} + \left(1 - q _ {B - 1}\right) \exp \left(- \frac {1}{1 - q _ {B - 1}}\right), \quad r _ {B} = \exp \left(- \frac {1}{1 - q _ {B - 1}}\right).
$$
If the oracle  $\mathcal{Q}$  delivers error-free predictions, then with the thresholds  $(r_B)_B$ , ADATHRESH with budget  $B$  has a success probability of at least  $q_{B}$  independently of the input size  $N$ .
Observe that, as  $B$  increases, the lower bound  $q_{B}$  of the success probability of ADATHRESH converges to 1 and the thresholds  $r_{B}$  converge to zero, meaning that the higher the budget, the higher the risks: there are fewer applicants in the first observation phase, thus the probability of selecting a future sub-optimal one is higher (yet this risk is hedged by the predictions), but on the other hand, it reduces the probability of naively disregarding the best applicant if it is among the first arriving ones. Although ADATHRESH is a naive algorithm that does not make full use of past information, we showed that adequately choosing the thresholds  $(r_{B})_{B}$  guarantees a success probability that goes to 1 as the budget increases. We present in Appendix B.3 an improved version of ADATHRESH that keeps in memory the maximum value  $M$  observed so far and that rejects all applicants having values below  $M$ . We show numerically in Section 5 how this increases the success probability of the algorithm.
Handling imperfect predictions If the predictions of the oracle are imperfect, then one way of guaranteeing robustness, since the objective is to maximize the success probability, is to use the  $1 / e$ -rule with probability  $\lambda$  and Algorithm 3 with probability  $1 - \lambda$ . This guarantees a success probability of at least  $\lambda / e$  if the predictions are incorrect. On the other hand, given that the oracle's predictions are binary, it is reasonable to assume that each prediction is correct with a probability  $p$  independent of all the observations, as explained in the introduction. Based on this assumption, Algorithm 3 can be modified to include the option of trusting or disregarding the oracle's prediction at each step. We show that it is advantageous to trust the oracle when  $p$  is above a certain threshold and run the  $1 / e$ -rule otherwise. This algorithm achieves a success probability of at least  $1 / e$ , with improving performance as  $p$  approaches 1. We show in the appendix how this can be generalized when the accuracy of the oracle is time-dependent.
Figure 3:  $(q_B(p))_{B,p}$  for  $p\in$  [0.5,1] and  $B\leq 20$
Theorem 3.2. Assume that each oracle's prediction is independently correct with probability  $p \geq (1 + (e - 1)\exp (-\frac{e}{e - 1}))^{-1} \approx 0.73$ , then there is an algorithm that achieves a success probability of at least  $q_0(p) = 1 / e$  for  $B = 0$ , and  $q_B(p)$  for  $B \geq 1$  defined as
$$
q _ {B} (p) = p q _ {B - 1} (p) + p \left(1 - q _ {B - 1} (p)\right) \exp \left(- \frac {1}{1 - q _ {B - 1} (p)}\right).
$$
If we denote  $W$  the Lambert function, i.e. the inverse of  $u \mapsto ue^{u}$  on  $(0,\infty)$ , then we have
$$
\lim  _ {B \to \infty} q _ {B} (p) = 1 - \frac {1}{1 + W \left(\frac {p}{e (1 - p)}\right)}.
$$
Moreover, the algorithm has a success probability of at least  $1 / \mathrm{e}$  for any value of  $p\in [1 / 2,1]$ .
Optimal algorithm Assuming that the predictions are error-free, the problem is equivalent to the multiple-choice secretary problem [26], where the algorithm is allowed to select  $k \geq 1$  applicants, and it is successful if the best overall candidate is among them. Indeed, the algorithm is given  $B + 1$  attempts to identify the best applicant, and it halts if it finds it. This is analogous to choosing  $k = B + 1$  applicants, where following the selection of each one, the algorithm employs a selection strategy as if the previous guesses were unsuccessful. The optimal algorithm for selecting  $k$  applicants is a  $(a_{k}, \ldots, a_{1})$ -rule [26, 43], where at any step  $t$ , if the number of applicants already selected is  $i \in \{0, \ldots, k\}$ , then reject everyone until step  $\min \{t, a_{k - i}\}$ , and accept the first applicant after that is the best observed so far. Although this family of algorithms has a simple structure, analyzing it is difficult and hides many technical challenges. The optimal thresholds and the asymptotic success probability are explicitly computed only up to  $k \leq 5$ , and a recursive formula is proven, via a dynamic programming approach, to compute the next thresholds. This formula is however difficult to exploit even numerically, while the optimal thresholds and the success probability of ADATHRESH can be computed very easily.
If the predictions are correct with a probability  $p$ , then the optimal algorithm must be a generalization of the  $(a_{k},\ldots ,a_{1})$ -rule, and thus it is even harder to analyze. The algorithm we proposed is naive in the sense that it does not take into account all the past information and only remembers the history since the last prediction was queried. However, it illustrates how the limited budget of predictions should be spent, and it presents good robustness and consistency guarantees with respect to  $p$  and  $B$ , in the sense that it always has a success probability of at least  $1 / \mathrm{e}$ , which is optimal without predictions, and it has a success probability that converges to 1 as  $B$  and  $p$  increase.
4 Preemptive  $B$ -clairvoyant job scheduling
We consider the problem of scheduling multiple jobs on a single machine, with the objective of minimizing the sum of their completion times. More particularly, we place ourselves in the preemptive setting, where the jobs can be temporarily halted and resumed later, or equivalently that they can be run in parallel with rates that sum at most to 1. Let  $N$  be the number of jobs and  $x_{1},\ldots x_{N}$  their sizes. If the algorithm knows beforehand the sizes of the jobs, it is called clairvoyant, and the optimal algorithm OPT is to run the shortest jobs first. An algorithm is non-clairvoyant if the size  $x_{j}$  of any job  $j$  is unknown until the job is completed. Motwani et al. [46] showed that no deterministic or randomized algorithm can have a better competitive ratio than 2, which is achieved by round-robin (RR), which is a deterministic algorithm. RR works as follows: at any time  $t$ , if  $n$  is the number of remaining jobs, then RR runs them all in parallel with rates  $1 / n$  each.
An in-between setting, surprisingly not explored yet, is when the algorithm has only access to the sizes of a limited number of jobs. We say that an algorithm is  $B$ -clairvoyant when it is allowed to access the sizes of  $B$  jobs. We assume that it can query their true sizes, and not just noisy predictions. We start with a negative result, stating that we need to have  $B = \Omega(N)$  to achieve a better competitive ratio than 2. Then, we give an algorithm with a competitive ratio of at most  $2 - (B / N)^2$ .
Let us first remind a few classic notations in the scheduling problem. For any algorithm ALG, and any instance  $\mathcal{J} = \{x_1,\dots ,x_N\}$ , the sum of the completion times obtained by ALG can be written as
$$
\mathsf {A L G} (\mathcal {J}) = \sum_ {i = 1} ^ {N} x _ {i} + \sum_ {i <   j} \left(D ^ {\mathsf {A L G}} (i, j) + D ^ {\mathsf {A L G}} (j, i)\right), \tag {1}
$$
where  $D^{\mathrm{ALG}}(i,j)$  is the delay caused by job  $i$  to job  $j$ , i.e. the amount of job  $i$  executed before the completion of job  $j$ . With this notation, we have for any  $i < j$  that  $D^{\mathrm{OPT}}(i,j) + D^{\mathrm{OPT}}(j,i) = \min\{x_i,x_j\}$  and  $D^{\mathrm{RR}}(i,j) = D^{\mathrm{RR}}(j,i) = \min\{x_i,x_j\}$ . Thus, if  $x_1 \leq \ldots \leq x_N$  we obtain
$$
\operatorname {O P T} (\mathcal {J}) = \sum_ {i = 1} ^ {N} x _ {i} + \sum_ {i = 1} ^ {N} (N - i) x _ {i}, \quad \operatorname {R R} (\mathcal {J}) = \sum_ {i = 1} ^ {N} x _ {i} + 2 \sum_ {i = 1} ^ {N} (N - i) x _ {i}. \tag {2}
$$
4.1 Few hints are not enough
In opposite to other problems where it has been proved that a sublinear number of hints is enough for improving the performance [13, 31], the following theorem demonstrates that, for the scheduling problem, no algorithm can achieve a competitive ratio better than 2 when  $B = o(N)$ .
Theorem 4.1. Any  $B$ -clairvoyant deterministic or random algorithm with  $B = o(N)$ , has a competitive ratio lower bounded by 2.
4.2 Parallel OPT-RR algorithm with adaptive processing rates
We assume in this section that the  $B = \Omega(N)$ . A first naive algorithm would run RR until there are  $B$  jobs left, then query their sizes, and use OPT to finish. However, when all the jobs have the same size, they terminate at the same time and no hint is queried. The output of the algorithm with this instance is exactly the same as RR, which is twice the output of OPT asymptotically in  $N$  [46], and therefore its competitive ratio is at least 2. More generally, any algorithm that runs RR waiting for a certain number of jobs to finish before querying the sizes of  $B$  unfinished ones is no better than RR for the same reasons. Alternatively, the algorithm can wait for a possibly random amount of time  $T > 0$ , independent of the observed completion times, before querying the first hint. However, by taking job sizes sampled from an exponential distribution with parameter  $\mu$  such that their sum is smaller than  $T$  with an arbitrarily high probability, the algorithm terminates with high probability before requesting any hint and is no better than a non-clairvoyant algorithm on such input instances, leading to a competitive ratio of at least 2. Therefore, the best moment to query the hints is at the very beginning of the execution, and since the algorithm cannot differentiate between the jobs, it can only query the sizes of  $B$  randomly chosen ones.
We propose a generic algorithm that queries the sizes of  $B$  randomly chosen jobs, then concurrently runs OPT on them and RR on the others with respective rates  $\alpha$  and  $1 - \alpha$ , where  $\alpha$  is a parameter that can be adjusted throughout the course of the algorithm, depending on the information available at each time, i.e the predicted job sizes, the number of the remaining jobs, and the sizes of finished jobs.
Algorithm 4: PAR Parallel algorithm with Adaptive processing Rate
Input: Budget  $B$ $N$  jobs with unknown sizes  $\{x_{1},\ldots ,x_{N}\}$    
1  $I\gets$  Sample  $B$  jobs uniformly at random without replacement;   
2  $J\gets \{1,\dots ,N\} \setminus I$  .   
3 while there are still unfinished jobs do.   
4 Adjust  $\alpha$  .   
run for a time unit   
6 with rate  $\alpha$  OPT on  $\{x_i\}_{i\in I}$  ..   
7 with rate  $1 - \alpha$  RR on  $\{x_j\}_{j\in J}$
In the following, for any algorithm  $\mathsf{ALG}$  and for any subsets  $H, K$  of  $\{1, \ldots, N\}$ , we denote  $D^{\mathsf{ALG}}(H, K) = \sum_{i \in H} \sum_{j \in K \setminus \{i\}} D^{\mathsf{ALG}}(i, j)$  the sum of all the delays caused by jobs in  $H$  to those in  $K$ . We demonstrate first a generic upper bound for the output of  $\mathsf{PAR}$ ,
Lemma 4.2. For any update rule of  $\alpha$  we have
$$
\mathbf {E} [ \mathcal {P A R} (\mathcal {J}) ] = \sum_ {i = 1} ^ {N} x _ {i} + \left(2 - \frac {B}{N} \left(4 - 3 \frac {B - 1}{N - 1}\right)\right) \sum_ {i = 1} ^ {N} (N - i) x _ {i} + \mathbf {E} [ D ^ {\mathcal {P A R}} (I, J) + D ^ {\mathcal {P A R}} (J, I) ].
$$
This Lemma shows that the output of PAR depends only on the delays generated by jobs in  $I$  on jobs in  $J$  and vice versa. The difficulty now is to choose an adequate update rule for the rate  $\alpha$ , with provable upper bounds on  $\mathbf{E}[D^{\mathrm{PAR}}(I,J) + D^{\mathrm{PAR}}(J,I)]$ .
Figure 4: In this example,  $N = 5$ , the job sizes are  $\{x_{1} = 1, x_{2} = 3, x_{3} = 4, x_{4} = 5, x_{5} = 6.3\}$  and  $I = \{1, 2, 3\}$ . On the left we visualize a run of RR on this instance, and on the right a run of PAR with the SRR update rule. The X-axis represents time and the Y-axis represents the processing power allocated to each job.
4.3 Simulated round-robin update rule
We consider the Simulated Round-Robin (SRR) update rule, which adjusts  $\alpha$  as follows. It simply puts a global processing rate on  $I_{t}$ , the set of unfinished jobs in  $I$ , proportional to the cardinal of  $I_{t}^{\mathsf{RR}}$ , the number of unfinished jobs in  $I$  had RR be run instead (this counterfactual quantity can be computed at any time step as predictions are correct, see proof of Theorem 4.3) and similarly for  $J$ . Formally,  $\alpha_{t}^{\mathsf{RR}} = |I_{t}^{\mathsf{RR}}| / (|I_{t}^{\mathsf{RR}}| + |J_{t}^{\mathsf{RR}}|)$ . Figure 4 gives an illustration of the SRR update rule: to the left, it shows a run of RR, where initially the 5 jobs run each with a processing rate  $1/5$  until job 1 terminates, then the remaining jobs run each with a processing rate of  $1/4$  until job 2 terminates, and so on. To the right, the figure shows a run of PAR with SRR update rule, where the algorithm knows the sizes of jobs 1, 2 and 3. The total processing rate of these jobs during the run of the algorithm is represented by the yellow area, and it is identical to their total processing rate during the run of RR.
Theorem 4.3. If  $\mathsf{PAR}$  uses a processing rate  $\alpha_{t}^{RR}$ , then it is at most  $\left(2 - \frac{B(B - 1)}{N(N - 1)}\right)$ -competitive.
The competitive ratio of PAR with processing rate  $(\alpha_{t}^{\mathsf{RR}})_{t\geq 0}$  decreases as  $B$  grows, going from 2 to 1, thus interpolating the non-clairvoyant and the clairvoyant settings.
In this section, we test the performance of the algorithms we presented for the ski- rental, secretary, and scheduling problems, supporting our theoretical results and giving further insight.
Figure 5: Competitive ratios of Algorithms 1 and 2, with an oracle  $\mathcal{Q}$  accurate with probability  $p\in [0.5,1]$  and  $b = 50$
Figure 6: Competitive ratio of querying the prediction at time  $t$ , then running Algorithm 1 or 2, with  $p_t = 0.95 - 0.4\exp (-t / 5)$  and  $b = 100$ .
For the ski-rental problem, we set a buying cost of  $b = 50$  for Figure 5 and  $b = 100$  for Figure 6, and the number of snow days is sampled randomly from a uniform distribution in  $[1,4b]$ . Each point in both figures is computed over  $10^{5}$  simulations. The value of  $\lambda$  is chosen optimally with respect to  $p$  as indicated in Lemmas 2.2 and 2.3.
The competitive ratios of both algorithms 1 and 2 when the prediction is given as input are shown in Figure 5, as well as their theoretical upper bounds. The experimental ratio of the deterministic
algorithm in this particular scenario is significantly better than the theoretical upper bound, while that of the randomized algorithm is close to the theoretical upper bound. In Figure 6, we consider that the oracle is correct with a time-dependent probability  $p_t = 0.95 - 0.4 \exp(-t / 5)$ . We show the competitive ratios obtained by renting until time  $t$  then querying a prediction and running the deterministic or the randomized algorithm. The theoretical upper bounds are represented in dotted lines. We observe that adequately choosing the time of querying the prediction can significantly improve the competitive ratio, which proves our claims. This time strongly depends on the cost  $b$  and on the evolution of the probability  $p_t$  with time.
Figure 7: Success probability of ADATHRESH compared to the lower bound  $q_{B}$ , and compared to the case with memory.
Figure 8: Competitive ratio of PAR with SRR update rule, tested with  $N = 50$  and different benchmark input instances.
In Figure 7, we test ADATHRESH with  $N = 1000$ , and we show how the success probability improves with  $B$ . We also test a variant of the algorithm memorizing the value of the best-observed applicant after restarting, which improves the success probability (See Appendix B.3 for a detailed description of the algorithm). The success probability of ADATHRESH matches  $q_{B}$ , therefore it is a tight lower bound. We also observe that the success probability increases rapidly for the first values of  $B$ , but then becomes slower. This is because whenever the algorithm is restarted, there is a new observation phase, with a risk of missing the best applicant.
Secondly, we test the algorithm PAR with the SRR update rule on various benchmark inputs. We test it with  $N = 50$  and jobs having (i) identical sizes, (ii) sizes sampled from the exponential distribution, (iii) uniform distribution, (iv) and Pareto distribution. (i) is a critical instance because it is the worst-case input for RR. (ii) is a classical benchmark used in many variants of the scheduling problem to prove lower bounds [46]. (iii) is a natural benchmark to test randomness. Finally, (iv) is well-suited in practice for modeling the job size distributions [47, 29], and also it shows how the algorithm behaves on instances with very high variance. Each point in the figure was obtained by averaging over 10000 runs. We see that the competitive ratio of PAR is at most  $2 - B / N$  for all these benchmarks, which is better than the upper bound  $2 - (B / N)^{2}$  proved in Theorem 4.3. Therefore, PAR can be highly efficient in many cases, since the gain obtained with  $B$  known job sizes is proportional to  $B$  as shown in the simulations.
We presented different settings where online algorithms operate under a restricted budget of predictions, that can be queried during their execution. We show that adequately using this budget significantly improves upon the worst-case performance. Our results pave the way for investigating more realistic and practical challenges within the learning-augmented paradigm, providing insights that can be extended to various other problems in competitive analysis.
[1] Sara Ahmadian, Hossein Esfandiari, Vahab S Mirrokni, and Binghui Peng. Robust load balancing with machine learned advice. In SODA, pages 20-34, 2022.
[2] Keerti Anand, Rong Ge, and Debmalya Panigrahi. Customizing ml predictions for online algorithms. In International Conference on Machine Learning, pages 303-313. PMLR, 2020.
[37] Silvio Lattanzi, Thomas Lavastida, Benjamin Moseley, and Sergei Vassilvitskii. Online scheduling via learned weights. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1859-1877. SIAM, 2020.
[38] Jan Karel Lenstra and AHG Rinnooy Kan. Complexity of scheduling under precedence constraints. Operations Research, 26(1):22-35, 1978.
[39] Honghao Lin, Tian Luo, and David Woodruff. Learning augmented binary search trees. In International Conference on Machine Learning, pages 13431-13440. PMLR, 2022.
[40] Pinyan Lu, Xuandi Ren, Enze Sun, and Yubo Zhang. Generalized sorting with predictions. In Symposium on Simplicity in Algorithms (SOSA), pages 111-117. SIAM, 2021.
[41] Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. Journal of the ACM (JACM), 68(4):1-25, 2021.
[42] Charles Martel. Preemptive scheduling with release times, deadlines, and due times. Journal of the ACM (JACM), 29(3):812-829, 1982.
[43] Tomomi Matsui and Katsunori Ano. Lower bounds for bruss' odds problem with multiple stopnings. Mathematics of Operations Research, 41(2):700-714, 2016.
[44] Adam Meyerson. The parking permit problem. In 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS'05), pages 274-282. IEEE, 2005.
[45] Michael Mitzenmacher. Queues with small advice. In SIAM Conference on Applied and Computational Discrete Algorithms (ACDA21), pages 1-12. SIAM, 2021.
[46] Rajeev Motwani, Steven Phillips, and Eric Torng. Nonclairvoyant scheduling. Theoretical computer science, 130(1):17-47, 1994.
[47] Manish Purohit, Zoya Svitkina, and Ravi Kumar. Improving online algorithms via ML predictions. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 9684-9693, 2018.
[48] Alexander Wei and Fred Zhang. Optimal robustness-consistency trade-offs for learning-augmented online algorithms. Advances in Neural Information Processing Systems, 33:8042-8053, 2020.
[49] Ali Zeynali, Bo Sun, Mohammad Hajiesmaili, and Adam Wierman. Data-driven competitive algorithms for online knapsack and set cover. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 10833-10841, 2021.
Omitted proofs
A Ski- rental with time-dependent guarantees on the prediction
A.1 Proof of Lemma 2.1
Proof. In all the following, We denote  $\mathrm{A}(I)$  the output of algorithm A when given an input instance  $I$ . We will prove the claim of the lemma by treating separately the cases where  $x \geq b$  and  $x < b$ . Let us first observe that, if  $x \geq t$ , then the cost of  $\mathsf{ALG}_t$  is  $t + \mathsf{ALG}(x - t, b, Q_t)$ , because a unit cost was paid during the first  $t$  days, and then  $\mathsf{ALG}$  is called provided with a prediction  $Q_t$ . The number of remaining snow days at that time is  $x - t$ . We remind that, since we are in a minimization problem,  $C(\mathsf{ALG}, p_t)$  is at least 1. Consider the case where  $x \leq b$ , thus  $\mathsf{OPT}(x, b) = x$ . If  $x \leq t$  then  $\mathsf{ALG}_t(x, b) = x = \mathsf{OPT}(x, b)$ , and if  $x > t$  then
$$
\begin{array}{l} \mathbf {E} [ \mathbf {A L G} _ {t} (x, b) ] = t + \mathbf {E} [ \mathbf {A L G} (x - t, b, Q _ {t}) ] \\ \leq t + C (\mathsf {A L G}, p _ {t}) \mathsf {O P T} (x - t, b) \\ = t + C (\mathsf {A L G}, p _ {t}) (x - t) \\ = C (\mathsf {A L G}, p _ {t}) x - (C (\mathsf {A L G}, p _ {t}) - 1) t \\ \leq C (\mathsf {A L G}, p _ {t}) x - \left(C (\mathsf {A L G}, p _ {t}) - 1\right) \frac {t}{b} x \\ = \left(\frac {t}{b} + \left(1 - \frac {t}{b}\right) C (\mathsf {A L G}, p _ {t})\right) \mathsf {O P T} (x, b) \\ \leq \left(\frac {t}{b} + C (\mathsf {A L G}, p _ {t})\right) \mathsf {O P T} (x, b). \\ \end{array}
$$
Consider now that  $x > b$ , thus  $\mathsf{OPT}(x,b) = b$ . If  $x \leq t$  then
$$
\mathsf {A L G} _ {t} (x, b) = x \leq t \leq \left(\frac {t}{b} + C (\mathsf {A L G}, p _ {t})\right) \mathsf {O P T} (x, b).
$$
On the other hand, if  $x > t$  then
$$
\begin{array}{l} \mathbf {E} [ \mathbf {A L G} _ {t} (x, b) ] \leq t + C (\mathbf {A L G}, p _ {t}) \mathbf {O P T} (x - t, b) \\ \leq t + C (\mathsf {A L G}, p _ {t}) b \\ = \left(\frac {t}{b} + C (\mathsf {A L G}, p _ {t})\right) \mathsf {O P T} (x, b). \\ \end{array}
$$
In all the cases we have  $\mathbf{E}[\mathsf{ALG}_t(x,b)]\leq (t / b + C(\mathsf{ALG},p_t))\mathsf{OPT}(x,b)$ , which gives the result.
A.2 Proof of Lemma 2.2
Proof. Let us denote  $\mathsf{ALG}(x,b,\mathcal{Q})$  the output of Algorithm 1 given an instance  $x,b$  and a prediction  $\mathcal{Q}$ , and  $\mathsf{OPT}(x,b) = \min\{x,b\}$  the cost of the optimal offline algorithm. Purohit et al. [47] prove that, if the algorithm is given instead a prediction  $y$  of  $x$ , then sets  $\mathcal{Q} = \mathbb{1}(y \geq b)$  and behaves as we described, then its competitive ratio is upper bounded by  $\min\left\{1 + \frac{1}{\lambda}, (1 + \lambda) + \frac{|x - y|}{(1 - \lambda)\mathsf{OPT}(x,b)}\right\}$ . But in fact, it suffices to have  $x$  and  $y$  both larger or both smaller than  $b$  for the algorithm to behave exactly as if  $x = y$ , therefore we retrieve the bound  $1 + \lambda$  if the prediction  $\mathcal{Q}$  is accurate. This happens with probability  $p$ . Otherwise, when the prediction is incorrect, we always have that
$\mathsf{ALG}(x,b,\mathcal{Q})\leq (1 + 1 / \lambda)\mathsf{OPT}$  . Therefore
$$
\begin{array}{l} \frac {\mathbf {E} [ \mathsf {A L G} (x , b , \mathcal {Q}) ]}{\mathsf {O P T} (x , b)} \leq p (1 + \lambda) + (1 - p) \left(1 + \frac {1}{\lambda}\right) \\ = 1 + p \lambda + \frac {1 - p}{\lambda}, \\ \end{array}
$$
the latter expression is minimized for  $\lambda = \sqrt{\frac{1 - p}{p}}$ , which gives
$$
\frac {\mathbf {E} [ \mathsf {A L G} (x , b , \mathcal {Q}) ]}{\mathsf {O P T} (x , b)} \leq 1 + 2 \sqrt {p (1 - p)}.
$$
A.3 Proof of Lemma 2.3