2

This question comes from the 27th Brazilian Mathematical Olympiad (2005).

We have four charged batteries, four uncharged batteries, and a radio which needs two charged batteries to work. We do not know which batteries are charged and which ones are un harged. What is the least number of attempts that suffices to make sure the radio will work? (An attempt onsists of putting two batteries in the radio and cheking if the radio works or not).

Erdös
  • 59
  • 1
    Duplicate of https://math.stackexchange.com/questions/3189483/choose-2-good-batteries-out-of-8-4-bad-4-good which was closed as a duplicate of https://math.stackexchange.com/questions/3115018/we-have-n-charged-and-n-uncharged-batteries-and-a-radio-which-needs-two-char – Gerry Myerson Aug 15 '19 at 13:07

1 Answers1

7

Consider the graph whose vertices are batteries and whose edges correspond to pairs of charged batteries. The edges form a $K_4$ clique, so the question becomes

What is the smallest number of edges in an $8$-vertex graph whose complement contains no $K_4$ clique?

We answer this by considering its dual:

What is the largest number of edges in an $8$-vertex graph with no $K_4$ clique?

By Turán's theorem, the answer to this dual question is $K_{3,3,2}$, which has $21$ edges. Thus, the least number of trials we need is the number of edges in $K_8$ minus this, or $28-21=7$.

Parcly Taxel
  • 105,904
  • 2
    good answer to a crap question. I'm conflicted with my desire to not upvote answers on questions that should clearly be deleted, but also my desire to support quality solution methods – Brevan Ellefsen Aug 15 '19 at 05:33
  • 2
    @Brevan Ellefsen: Then the question (which I thought was an interesting one) added value to MSE by provoking a novel answer. – quasi Aug 15 '19 at 05:47
  • 4
    You might also try and translate the idea into high school math contest language. Split the collection of 8 batteries into three groups:3+3+2. One of those groups will have two charged batteries, so testing $\binom 32+\binom 32+\binom21=7$ pairs suffices. Of course, it does not follow that 7 is optimal. Leaving that as an exercise :-) – Jyrki Lahtonen Aug 15 '19 at 06:17
  • 1
    @JyrkiLahtonen Well, you just translated my answer into high-school language, except for the Turán part, I guess... – Parcly Taxel Aug 15 '19 at 06:23
  • An alternative way to do it in 7 trials (assuming worst luck): test 4 separate pairs. Each pair then comprises one dud and one goodie. Pick 2 of those pairs: say (A,B) and (C,D). Test A with C and with D. Then test B with C. After 7 failed tests, you know that (B,D) is a good pair. – John Bentin Aug 15 '19 at 06:39
  • 1
    @JohnBentin By the rules of this question, that would be $8$ trials. – Parcly Taxel Aug 15 '19 at 06:44
  • @ParclyTaxel: we can be sure that the radio works without actually putting in the batteries we know to be good. We don't need to put the good batteries in and check to know that they work. So it seems that it takes $7$ trials to know that the radio will work. – robjohn Aug 15 '19 at 15:29
  • I'm not following the answer given by the OP honestly. Why is that so? It needs more explanation before I would give credit to this. – Mike Aug 15 '19 at 18:30
  • 1
    I see it now. We are picking an edge and querying whether that edge is in n the $K_4$ specified which we will write as $H$. Let $m'$ be an integer and let $S$ be any set of $m \le m'$ edges that are each not in $H$. If, for any edge $e$ not in $S$, there is a $K_4$ in $K_8 - (S+{e})$, then we need to query at least $m+1$ edges to be able to guarantee that the next edge that we pick is in $H$. [As for all we know for any such $S$ and $e$ the clique could still be hidden in $K_8 -(S+{e})$ so we are not guaranteed to come up with an edge in $H$ after only $m'+1$ queries] – Mike Aug 15 '19 at 19:10
  • 1
    The above is of course logically equivalent to the following: given any set $S'$ of $m'+1$ edges there is a 4-clique that does not intersect $S'$. This is true up to $m'+1=7$. – Mike Aug 15 '19 at 19:21