5

A pack of 8 batteries is given, with 4 good batteries and 4 bad batteries. We need to take 2 good batteries for our device to work properly. How to calculate what is the smallest number of steps in which we are sure, that we have 2 good batteries? What is the best approach to take I we want to be left with two good batteries in our hand? Only way we can check if a pair is good or bad is to put it in the device. It either works (2 good batteries) or doesn’t work (1 good 1 bad or 2 bad)

EDIT: I've managed so far to find a solution, that we can do this with only 7 checks (where a check is putting two batteries to the device).

  • Divide 8 batteries into 4 pairs
  • Check each pair (4 checks total)
  • If none worked, all pairs are of type (0,1) or (1,0)
  • Take any two pairs, cross-check them (we already know the result of one possibility, so we're left with 3 other possibilities to check, i.e. 3 checks, 7 checks total)

But I am still wondering, If this can be done with 6 checks only? Can we apply graph theory here somehow?

leller
  • 311
  • 1
    If you take 6 batteries, you must have 2 good ones – J. W. Tanner Apr 16 '19 at 05:56
  • But what next? What do we do to get these 2 good at the smallest number of steps? – leller Apr 16 '19 at 05:59
  • 3
    Taking six batteries is the smallest number of steps, because you said you wanted to be sure. This is not a probability question, so I don't understand what's the point of mentioning Poisson. Probability would be relevant only if you would be happy with, say, 90 per cent change of having at least two good batteries. There is nothing to optimize here. – Jyrki Lahtonen Apr 16 '19 at 06:07
  • Maybe i’ve described my problem poorly. My goal is to determine what is the best strategy, approach, to being left with 2 good batteries in my hand. – leller Apr 16 '19 at 06:09
  • 3
    So what means are available for telling good batteries from bad? That's the important bit that you have left out of the question. E.g., if you can tell them apart on sight, then all you have to do it put the batteries on a table and pick out two good ones. – Gerry Myerson Apr 16 '19 at 06:18
  • We can only check by putting them in the device. If it works, we have 2 good, if not, either 1 good 1 bad or two bad. – leller Apr 16 '19 at 06:20
  • If first is good then five more choices to go with it will ensure 2 good batteries. If first is bad you will need 5 more choices to know that. Now discard the first battery etc. – Paul Apr 16 '19 at 07:10
  • 1
    @paul that is very bad and not optimal approach, the closest I got to is 7 steps (7 checks): Divide 8 to 4 pairs, check pair 1, check pair 2, check pair 3, check pair 4. If none works, than all pairs are (0,1) or (1,0) pairs. Take any two pairs, cross check (3 checks, we know 1 of 4 possibilities already). 4+3=7 – leller Apr 16 '19 at 07:24
  • 1
    @leller could you please edit your question and add what you have done so far? – pH 74 Apr 16 '19 at 07:43
  • Your 7 strategy is impressive. You now need to attack the problem from the other direction and find minimum bounds. Arguments why a solution with fewer than $n$ steps is not possible. – badjohn Apr 16 '19 at 08:43

1 Answers1

1

A solution in six tests is given at quora: test pairs 1 & 2, 1 & 3, 2 & 3. If one of those works, you're done. If not, then at most one of those three batteries is good, which means three of the remaining batteries are good.

Test pairs 4 & 5, 4 & 6, 5 & 6. If one of those works, you're done. If not, then at most one of those three batteries is good, which means 7 & 8 are both good.

Gerry Myerson
  • 185,413
  • 1
    https://mikepawliuk.ca/2012/09/06/the-battery-problem-math-for-my-mom/ traces the problem back to the 2005 Brazilian Math Olympiad. Question 4 at https://imomath.com/othercomp/Bra/BraMO05.pdf but no answer supplied there. – Gerry Myerson Apr 16 '19 at 09:44
  • It's also up on YouTube, https://www.youtube.com/watch?v=wOosTU73OCg – Gerry Myerson Apr 16 '19 at 10:04