My remote control needs two new batteries, but when I went to get replacements I found that the four good batteries got mixed in with four bad batteries. The only means of determining if the batteries are good is to put two into the remote and see if it works. The remote works with two good batteries and is unresponsive if I have at least one bad battery in it.
What is the minimum number of tries I need to guarantee that I get two good batteries?
Answer: 22 will guarantee it .
If you unlucky and try your batteries two by two then you may exhaust all the "bad choices" until you find a good pair.
There are 6 possibilities of getting 2 bad batteries , 4*3/2
and 16 (4*4), altogether 22 possibilities.
How to do it: Label your batteries 1,2, ..8 . Prepare a list of all
possible un-ordered pairings : 1&2 1&3 1&4 1&5 ...7&8, 28 at all.
Within your sequence of 22 tests, in any order, there either be "a good pair" or you have found all the bad ones, so any untested
pair (only six remaining) qualifies.
Another reasoning : there are only 6 good pairs if you select 2 items out of 4 (AB AC AD BC BD CD out of ABCD), so 22 tests are needed in the worst case.