A secret even permutation $P$ of the set of non-negative integers less than $n$ is chosen. That might be a Feisltel cipher with a random key.
We are given in sequence the $P(x)$ for $x$ from $0$ to $n-3$, and must output the ordered pair $(P(n-2),P(n-1))$.
What's an efficient online algorithm for that? What’s a practical minimum for the memory needed?
What if we are allowed $n-2$ queries giving $P(x_i)$ for any $x_i$ that we iteratively decide, and must output $(x_{n-2},P(x_{n-2}),x_{n-1},P(x_{n-1}))$ where $x_{n-2}$ and $x_{n-1}$ have not been queried?
What if we are allowed to repeat an earlier query for free?
a \over b
results in $a \over b$. You can get a binomial coefficient by\binom{a}{b}
= $\binom{a}{b}$. (I was so free to edit your comment.) $\endgroup$