8

You have 1000 possible Covid vaccine candidates. You need to test them and find out if one works as quickly as possible. The test is to apply a small drop of a vaccine candidate to a sample, and wait to see if the Covid virus is compromised. The tests are very expensive and time-consuming, so you want to perform as few as possible. Since the tests are time-consuming, you only want to do one round of testing.

What is the fewest number of tests to confirm:

  1. If there is a single working vaccine, identify which one it is.

  2. If there is more than one working vaccine, then identify that situation as well. (Since that would be good news, it is OK if more testing is needed to root out the particulars of that).

HINT:

It is assumed one can provide multiple vaccine candidates to a single sample. For example, if you apply three different candidates to one sample, and the sample is not compromised, then you know none of those candidates work. On the other hand, if the sample is compromised, then you know that at least one of the three samples work, but not which one(s).

Hemant Agarwal
  • 2,912
  • 14
  • 31
Jiminion
  • 1,952
  • 14
  • 19
  • 2
    Does this answer your question? Twelve balls and a scale – Oray Jul 20 '20 at 16:04
  • https://math.stackexchange.com/questions/15423/optimal-algorithm-for-finding-the-odd-spheres/336224#336224 generalization – Oray Jul 20 '20 at 16:06
  • 2
    Those all involve multiple weighings. I don't think that would produce the optimal answer in this case. – Jiminion Jul 20 '20 at 16:07
  • and you ask multiple tests? – Oray Jul 20 '20 at 16:08
  • 2
    The question that most resembles this one is Wolves and Sheep, but that one asks us to identify 5 out of 100, whereas this one asks for 1 (or more) out of 1000. – Jaap Scherphuis Jul 20 '20 at 16:15
  • Yes, that is closer. I am not sure I agree with those answers! – Jiminion Jul 20 '20 at 17:22
  • 1
    @Oray, what I mean by that is the subsequent weighings are dependent on the results of previous weighing(s). – Jiminion Jul 20 '20 at 17:25
  • 2
    This reminds me of the 1000 bottles of wine problem, though I'm not sure it is a duplicate exactly. – Chipster Jul 20 '20 at 23:23
  • 1
    When you say it's okay to have more testing to root out the particulars of multiple viable vaccines, do you mean planning on it and having more tests in the first round, or moving forward with additional rounds of testing? – Rob Watts Jul 21 '20 at 19:43
  • 1
    Scientifically, you can't do this because combining multiple vaccine candidates on the same sample is effectively creating another candidate. If it works with say 2 together, it may not work with any single one of them individually. Similarly if it doesn't work with 2 together, it does not mean individually they would not work. I am displeased with the lack of medical and scientific accuracy here and am contacting Dr Fauci. Good day. – pkr Jul 22 '20 at 00:24
  • @RobWatts I am saying the first round testing should definitely reveal the single candidate if there is only one. If there are more than one working candidate, then it should reveal that as well, but it need not reveal exactly which 2 or 3 are the working vaccines. – Jiminion Jul 22 '20 at 01:15

2 Answers2

8

Here is one simple way to solve the problem in a single round of

30

tests. This is not optimal, but easy to explain. At the end I'll describe an improved version.

Label the $1000$ candidates from $000$ to $999$. Prepare $30$ tests, each testing the $100$ candidates that use a particular digit $0$-$9$ at a particular location in its label, for example one test contains all candidates that have a $7$ as their middle digit.

When the results come back, you can easily find which candidate is the successful one, because

if there are 3 successful tests, each gives you one digit of the successful candidate's number.

If there is more than one successful candidate,

you will get more than three successful test results. You will still know what the digits are on the labels of the successful candidates, but not which combination of them is correct.

The above method is not optimal, but can be improved by

numbering in a different number base. For example in base $3$, you can use seven digits to label up to $3^7=2187$ candidates, and then you need a single round of only $3\cdot7=21$ tests to distinguish them. With $1000$ candidates the first ternary digit is never a $2$, so actually only $20$ tests suffice.
In binary you need $10$ bits ($2^{10}=1024$), so again this leads to $20$ tests. Larger bases result in a larger number of tests, so with this method $20$ is optimal.

Jaap Scherphuis
  • 53,019
  • 7
  • 120
  • 208
  • This is a very good answer. I am not sure it is the optimal answer. – Jiminion Jul 20 '20 at 17:46
  • @Jiminion Me neither. There might be some other method of grouping them that works better. – Jaap Scherphuis Jul 20 '20 at 18:12
  • I am thinking a Hamming error code type of thing, that may be better, but I can't be sure of that. – Jiminion Jul 21 '20 at 18:36
  • I am now thinking your answer is probably optimal. – Jiminion Jul 22 '20 at 01:08
  • FYI, this answer doesn't work. What happens in the base-10 strategy if you run your 30 tests and all 30 come back successful, because the ten vaccines that work happen to be vaccines 123, 234, 345, 456, 567, 678, 781, 812, and 999? Then you have gained essentially no information from your 30 tests. Similar flaws exist in the base-3 and base-2 strategies. – Quuxplusone Aug 28 '20 at 19:11
  • 1
    @Quuxplusone It answers the question that was asked: If there is exactly one working vaccine, identify it. If there is more than one vaccine, detect that but without needing to identify a working one. – Jaap Scherphuis Aug 28 '20 at 19:14
  • Ah, I see. The current problem statement is a bit vague IMO. (It also starts by rejecting the possibility that zero of the vaccines being tested actually work, which I think is unrealistic... ;) ) – Quuxplusone Aug 28 '20 at 20:26
  • @Jaap , This is what you had said, "It answers the question that was asked: If there is exactly one working vaccine, identify it. If there is more than one vaccine, detect that but without needing to identify a working one." My question: So, if we not only want to know if there is more than one working vaccine but also identify each one of the vaccines that work, then we need 1000 tests, right ? – Hemant Agarwal Jul 22 '21 at 21:05
  • @HemantAgarwal: Yes, because the only way to prove that a vaccine does not work is to test it individually. Suppose you have 999 working vaccines and one vaccine of unknown status. If you combine it with any other vaccine the outcome of the test is successful due to that other working vaccine, so combined tests will not tell us anything about the unknown one. Only an individual test will do. – Jaap Scherphuis Jul 23 '21 at 06:17
6

I think I've heard this one before (at least, part 1). It was about one poisoned bottle of wine and prisoners on death row.

The solution to that problem was very similar to what @Jaap suggested:

10 tests. $2^{10}=1024$, as Jaap said, so you can number the vaccines $1$ to $1000$ and give $1$ to $500$ to test subject 1, $1$ to $250$ and $500$ to $750$ to subject 2, $1$ to $125$, $250$ to $375$, $500$ to $625$, and $750$ to $875$, and so on and so on.

That way, your results will be a binary output of your ten test subjects, whether they still have COVID or not. There are 1024 possible outputs for that binary sequence, and thus they will provide enough information to narrow down which one is the working vaccine. Each ordered 10-tuple will correspond to exactly one vaccine, apart from 24 10-tuples, which will be impossible to obtain.

As for part two, with multiple possible vaccines that work:

I can attack the problem from an information theory point of view. You're looking for 1000 bits of information - you don't just want to know how many work, you want to know whether every single vaccine works or doesn't work. Each test can only provide a positive or negative result, and thus no matter how many vaccines you inject someone with, they'll only give you one bit of information. Therefore, you need 1000 tests to determine exactly which vaccines work and which don't.

The most obvious way to do this is just to give one vaccine each to 1000 people.

Spandan
  • 546
  • 3
  • 13
  • I think the way to look at the second part is with your first test, you only indicate which numbers are 'on', but not necessarily if they are 'off'. If you added more tests to clarify the 'off's, then more information would be provided that would be useful. – Jiminion Jul 22 '20 at 01:12
  • Wait, is the answer not 10 tests? Did I misunderstand the question? – Spandan Jul 22 '20 at 06:22
  • You shouldn't have the answer in the comment. And no, that is not the answer because it does not distinguish if one and only one vaccine is working. – Jiminion Jul 22 '20 at 17:58
  • Oh, my mistake. I thought you were asking two separate questions, not one question with two conditions. – Spandan Jul 22 '20 at 18:02