A well-known (non-)paradox in probability involves a two-envelope game played between two players, $A$ and $B$:

- $A$ selects two distinct (real) numbers, $x$ and $y$, writing each one down on a card and sealing each card in an envelope, then presenting the two envelopes to $B$.
- $B$ chooses one of the envelopes and looks at the card inside. They then guess whether the number on the card they've chosen is the larger or smaller of the two numbers.

The 'paradox' here is that regardless of $A$'s scheme for choosing numbers — and even if $A$ knows $B$'s strategy in advance — there's a strategy for $B$ that will achieve a better-than-even success rate in the long run: choose an envelope at random, then map the number in it onto the interval $(0,1)$ using some (arbitrary) monotonic function. Choose a random deviate $U\in(0,1)$, and then guess 'higher' or 'lower' according to whether (the mapping of) the number looked at is higher or lower than the generated random deviate.

I'll skip the analysis of this strategy here (see Do better than chance or Who discovered this number-guessing paradox? for more details), but note that it explicitly relies on having a source of random deviates. My question is whether this is necessary for $B$ to have the advantage. More specifically, consider the following variant of the game:

- B chooses computable functions $f():\mathbb{N}\mapsto\{0,1\}$ and $g():\mathbb{N}\mapsto\mathbb{Q}\cap(0,1)$. Note that $A$ knows nothing about these functions, other than that they
*are*computable. - For each integer $n$, in turn:
- $A$ selects two distinct real numbers $x,y\in(0,1)$, writing each down on a card and presenting them in sealed envelopes. (I'm restricting the numbers here to eliminate the mathematically-moot mapping step.)
- $B$ computes $f(n)$; if $f(n)=0$ then $B$ chooses $x$, and if $f(n)=1$ then $B$ chooses $y$. Call $B$'s chosen number $z$.
- $B$ computes $g(n)$; if $g(n)\leq z$ then $B$ guesses 'higher', otherwise $B$ guesses 'lower'.

Note that this is essentially $B$ following the strategy in the usual version of the game, except that $B$ is following a computable strategy rather than a purely randomized one.

Can $A$ win this game in the long run?

Since $A$ doesn't know *what* computable strategy $B$ is following, they'll clearly have to take some dovetailing approach; instinctively it *feels* like randomness is inherent in $B$'s ability to win with the usual strategy and that $A$, with the knowledge that $B$'s strategy is actually computable, should be able to 'game the system' and win. Unfortunately, I can't see a clear proof here (and I wouldn't be entirely shocked to learn that I'm wrong). Is anything known about this problem?

**EDIT:** to clarify, I should point out that unlike $B$, the strategy that $A$ follows does *not* have to be computable; $A$ can, for instance, take advantage of an oracle that enumerates the total computable functions. For example, this ensures that $A$ can guarantee they'll win at least once: enumerate all possible pairs $\langle f_n(), g_n()\rangle$ of recursive functions and in round $i$ behave as though $B$'s selections for the round will be $f_i(i)$ and $g_i(i)$ (by choosing values that will win given that these are $B$'s selections). Also, I suspect $f()$ is actually superfluous and that we can ask the analogous question for the strategy where $B$ always guesses $x$, but if the presence or absence of $f()$ does matter then it'd be interesting to know that too.