TITLE: We have $n$ charged and $n$ uncharged batteries and a radio which needs two charged batteries to work.
QUESTION [15 upvotes]: We have $n$ charged and $n$ uncharged batteries and a radio which needs two charged batteries to work. Suppose we don't know which batteries are charged and which ones are uncharged. Find the least number of attempts sufficient to make sure the radio will work.
An attempt consists in putting two batteries in the radio and check if the radio works or not.


I can prove that it is $\leq n+3$ (or $\leq n+4$, look at the comment):
Say we have batteries $B_1,B_2,....B_{2n}$, $n$ of them charged and other not. If in one of $n$ attempts $$\{B_1,B_2\}, \{B_3,B_4\}, ...\{B_{2n-1},B_{2n}\}$$ radio work we are done. If non of them work, then in each pair we must have charged and uncharged batteries. Thus in one of next 4 pairs:
$$\{B_1,B_3\}, \{B_1,B_4\}, \{B_2,B_3\}, \{B_2,B_4\}$$
must be a pair of charged batteries and we are done (so if 3 times doesn't work we know the last pair is charged).
But, can we reduce the number of attempts?

REPLY [2 votes]: Here is an alternative, more succinct derivation of the best method adapted from my answer to a question on the $n=4$ case which was marked as a duplicate of this one.
As in Quantus's answer, we consider a graph with $2n$ vertices (the batteries) and an edge between two vertices corresponding to charged batteries. The edges form a $K_n$ clique, so the question is equivalent to

What is the least number of edges in a graph $G$ on $2n$ vertices such that its complement $\overline G$ contains no $K_n$ clique?

The edges of $G$ represent all pairs of batteries. If we can guarantee that a subgraph of $G$ (whose edges correspond to pairs of batteries we test) with $k$ edges has the stated property, then we can get the radio to work in at most $k$ attempts, or we can know a pair that will work in at most $k-1$.
We answer the above question by converting it to a dual form.

What is the most number of edges $\overline G$ can have such that it contains no $K_n$ clique?

By Turán's theorem, $\overline G$ attains its maximum number of edges when it is the Turán graph $T(2n,n-1)$, the complete $n-1$-partite graph where the $2n$ vertices are split as equally as possible. For $n\ge3$ this works out to $n-3$ partitions with $2$ vertices and $2$ partitions with $3$ vertices. Thus the number of edges in the optimal $G$ is the count of edges wholly within one partition of $\overline G$, or
$$(n-3)T_2+2T_3=n-3+2\cdot3=n+3$$
If $n=2$, there is only one working pair of batteries and we might need to try all $6$ pairs. If $n=1$ it is clear that no pair of batteries will make the radio work.