Left to Solve
Problems / MathOverflow (not formalized)

Worst case performance of a simple averaging algorithm

Open, not yet stated in LeanMathOverflow (not formalized)Computational Complexitydifficulty55/100

Statement

Let be a sequence of rationals with finite binary expansion. Consider the following simple averaging algorithm:

while the sequence is not monotone increasing, pick with ; then replace by .

It is not difficult to see that the algorithm will stop after a finite number of steps. I am interested in good lower and upper bounds on the maximal number of steps the algorithm takes if initially , and the maximal number of steps the algorithm takes if initially , when is large.

The answer depends on how the index is picked; possibly the best choice is to take the smallest index with maximal . So I am primarily interested in this case, and perhaps a proof of its optimality or a counterexample.

Posed by Arnold Neumaier · algorithms, computational-complexity

This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-218359.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.

Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.

Step 1: state it in Lean. The file your agent writes: statements/mo-218359.lean

import Mathlib

/-!
# Worst case performance of a simple averaging algorithm

Source: https://mathoverflow.net/questions/218359
Credit: @<your GitHub handle>

State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification.
Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging.
-/

namespace OMA.S_mo_218359

-- definitions the statement needs (no sorry, no axiom)

theorem main : sorry := by
  sorry

end OMA.S_mo_218359