Consider the following "compression problem" for a pair $(C,D)$ of algorithms: $C$ receives a uniformly random $x \in \{0,1\}^n$ and outputs a smaller bit string $y \in \{0,1\}^s$. Algorithm $D$ receives $y$ as input and outputs an $n$-bit string $\hat x$ that is an attempt to approximate $x$. More precisely, the goal of this pair of algorithms is to maximise the expected number of coordinates of $\hat x$ that agree with $x$, that is, $$\mathbb E_{x \sim \{0,1\}^n} [\#\{i \in [n] : x_i = \hat x_i\}] = \sum_{i = 1}^n \mathbb P_{x \sim \{0,1\}^n}[x_i = \hat x_i].$$
I am trying to find an upper bound on this value, maximising over all $(C,D)$, in terms of $n$ and $s$; for concreteness, we can assume the algorithms are deterministic and computationally unbounded (or, equivalently, $y = f(x)$ and $\hat x = g(y)$ for arbitrary functions $f$ and $g$).
Intuitively, since the "compressed string" $y$ reveals $s$ bits of information about $x$, we should not be able to recover significantly more than $s$ bits of $x$ with certainty. Indeed, this suggests the strategy of setting $y = (x_1, \ldots, x_s)$, which leads to an expectation of $s + (n-s)/2 = (n+s)/2$ correct bits by guessing the remainder arbitrarily. Ideally, we would like to show an upper bound of $(s + n)/2 + O(1)$. (There is a nontrivial strategy that achieves more than saving the prefix, but the advantage is exponentially small. I suspect not much else could be done, but would be happy to see a solution in the form of a strategy achieving a superconstant difference.)
This seems like a natural problem for an information-theoretic or Kolmogorov complexity argument, but I have not been able to find any that apply; most of them deal with the problem of recovering $x$ exactly. Is the solution to this (or a similar) problem known?