TITLE: How much information can you transfer by choosing one number out of two?
QUESTION [10 upvotes]: Alice and Bob are playing a game. Alice (A) and Bob (B) agree on a protocol before the game starts.
Alice gets two uniformly random integers (without duplicates) from 1 through $n$, chooses one of the two numbers, and communicates it to Bob. Bob doesn't get to see anything other than the number that Alice chose (and he knows the maximum $n$, which is fixed for the game).
How many bits of information $b(n)$ can possibly be transmitted per number on average, if Alice and Bob play this game for a sufficiently long time?
$b(2) = 1$ is quite obvious, but even $b(3)$ is a difficult to reason about.
One protocol I came up with is that A always output $3$ for inputs $\{1, 3\}, \{2, 3\}$, and output $1$ or $2$ to transfer $1$ bit of information when the input is $\{1, 2\}$. This gets an average transmission rate of $\frac{1}{3}$ bits per number. But I have no idea how to generalize this to bigger $n$ or whether it's even optimal.

REPLY [2 votes]: Interesting problem. 
A quick  bound comes from considering, for $n$ even, that half of the values represent a binary $X=0$ input, the other half $X=1$.
This gives a BSC channel with crossover error probability given by the event that the two numbers I must choose from are on the "wrong" half
$$ p_e = \frac{\binom{n/2}{2}}{\binom{n}{2}}=\frac14 \frac{n-\frac12}{n-1}\approx \frac14$$
This gives a capacity of $C=1-h(p)=0.18872 \text{ bits}$, which agrees with Henning Makholm's answer. 
Some caveats

We are wasting bits (when both numbers are "good", the freedom of choosing one of the two is not used). Hence the capacity should be larger.
This result (and this encoding schema) is in the context of the classsic Shannon capacity, where information is sent with vanishingly small probability of error - but not necessarily with zero probability of error.


A better, probably optimal (and even simpler) schema:
Let our "channel" simply pick the maximum of the pair when $X_n=1$, the minimum otherwise. This is channel with two inputs and $n$ outputs. The transition matrix is given by the probability of the extrema:
$$P(Y = y \mid X = 1) = \frac{2 (y-1)}{n (n-1)} =g(y;n)$$
while for $P(Y = y \mid X = 0)$ we have the symmetric distribution.
Then the capacity of this (weakly symmetric) channel is
$$C=\log(n) - H(g(y;n))$$
where $H(g(y;n))=h_T(n-1)$ is the entropy of a triangular distribution with $n-1$ positive values. Calling $s=\frac{2}{n(n-1)}$
$$h_T(n-1)= -s \left( \log s \sum_{k=1}^{n-1} k +  \sum_{k=1}^{n-1} k \log k\right)\\
=- \log s +  s \log({\mathcal H}(n-1))$$
where ${\mathcal H}$ is the hyperfactorial.
The capacity decreases asymptotically (and very slowly) to $C_{\infty}=1-\frac{\log e}{2}\approx 0.2786$ bits (this agrees with enthdegree's value).

BTW: The $n=3$ case is, in this scheme, esentially a binary erasure channel, with $p_e=1/3$ and $C=2/3$ bits. A zero-error code with this rate (but unbounded length) can be built (rather trivially) if (and only if) we have feedback. But in this case the "feedback" is inside this virtual channel, so it would be feasible (as noted by Henning Makholm).