A collection holds 1,000 samples, and exactly one of them is special. A test can be run on a pool made by mixing portions of many samples, and it answers yes when the special sample is in the pool and no when it is not. If the samples are tested one at a time, ten tests check only ten of them. This page shows how ten pooled tests, all planned in advance, always identify the special sample, why nine tests can never be enough, and which assumptions the method depends on.
Key terms
Group testing
Definition Group testing is the problem of finding the special items in a collection by testing pools, groups of items combined and tested together, instead of testing each item alone. Robert Dorfman proposed the idea in 1943 as a way to screen large numbers of blood samples with fewer tests. The puzzle on this page is an ideal case. There are samples, numbered to , and exactly one of them is special. A test applied to a pool says yes exactly when the pool contains a portion of the special sample. Tests never make mistakes, combining samples does not change what a test detects, and each sample can be divided into portions that go into several pools. Under these assumptions ten tests always suffice, and all ten pools can be chosen before any result is known. Write each sample’s number in binary with ten digits, and put a portion of the sample into test when its th digit from the left is . The ten answers, with yes read as and no as , spell the special sample’s number in binary. Nine tests are never enough, even if each test is chosen after seeing the earlier answers, because nine answers form at most different patterns, fewer than the samples. If two samples could be special, if a test could give a wrong answer, or if mixing could hide the special sample, this design can point to the wrong sample. The puzzle is a model of information, not a description of how real laboratory tests behave.
In plain words Each test asks one yes-or-no question about the special sample’s number, namely whether a particular binary digit of it is . Ten answers give all ten digits, and the digits give the number.
Example Take the small version with eight samples, numbered to , and three tests. The three-digit binary numbers to name the eight samples, and each test pools the samples that have a in one place.
| Test | Place value | Samples in the pool |
|---|---|---|
| first | 4 | 4, 5, 6, 7 |
| second | 2 | 2, 3, 6, 7 |
| third | 1 | 1, 3, 5, 7 |
If sample 5 is special, the answers are yes, no, yes, which read as , and names sample 5 even though it was never tested alone. Sample 0 is in no pool, so the answers no, no, no point to it. That works only because exactly one sample is special. If the collection might hold no special sample, the answers no, no, no would have two explanations. With 1,000 samples one fix is to number them to , so that every code contains a and the all-no pattern can only mean that none is special. Ten tests still suffice, since the cases fit into patterns.
Pooled samples
Definition A pooled sample, or pool, is a mixture of portions taken from several samples and tested as one. In the ideal model of this puzzle a pool tests positive exactly when at least one of its samples is special. A single test therefore answers a question about every sample in the pool at once, but a positive result does not say which sample in the pool is special, or how many are. Pools may overlap, because a sample divided into portions can contribute to several pools.
In plain words A negative pool clears every sample in it with one test. A positive pool only says that something special is somewhere inside, so the pools have to be designed so that their answers together single out one sample.
Example Tested one at a time, ten samples use up all ten tests, and if every answer is no, candidates remain. In the binary design the first test pools the samples numbered to , the ones whose first binary digit is , so a single answer settles whether the special sample is among those or among the other . Each sample goes into one pool for each in its binary number. Sample goes into no pool, and sample , written , is divided into eight portions. No sample from to needs more than nine.
Binary encoding
Definition Binary encoding writes each whole number in base , using only the digits and . Every whole number with can be written in exactly one way as
where each digit is or . The string is the -digit binary numeral of , with leading zeros when needed. Different numbers get different strings, so the digits work as an address. To decode a string, add the place values of the digits that are . In the puzzle every sample has a ten-digit code. Test 1 reads the digit with place value , test 2 the digit with place value , and so on down to test 10, which reads the digit with place value .
In plain words Binary writes a number as a sum of different powers of two, such as , and records with a or a whether each power is used. Reading the digits back and adding the powers marked recovers the number.
Example The number splits into powers of two as
so its ten-digit code is , with ones in the places worth , , , and . If sample is special, tests 1, 4, 5, 8 and 10 say yes and the other five say no. Adding the place values of the five yes answers gives back .
Bit
Definition A bit, short for binary digit, is a single symbol that is or , the natural record of one yes-or-no answer. A string of bits has possible values, since each added bit doubles the count. Hence yes-or-no answers can tell apart at most cases. This holds even when each question is chosen after seeing the earlier answers, because a tree of yes-or-no questions has at most leaves. In information theory the bit is also a unit of information, and singling out one of equally likely possibilities takes bits, where is the exponent with .
In plain words Every yes-or-no answer can at most double the number of cases you can tell apart. Ten answers allow patterns, enough for samples, while nine allow only .
Example The two powers of two around are
so ten tests are the fewest that can work, and the binary design reaches that limit. In bits, one of equally likely samples takes bits to single out, just under ten. The design leaves patterns unused, the codes of the numbers to . Under the assumptions none of them can occur, so seeing one shows that something went wrong. Such checks catch only some errors. If sample , with code , is special and test 6 wrongly says yes, the pattern is the code of , which is unused, so the error is noticed. If sample , with code , is special and test 9 wrongly says yes, the pattern is the code of sample , and the error goes unnoticed.
Check yourself
- Which tests say yes when sample 100 is special? If tests 2, 3, 7 and 10 say yes and the other six say no, which sample is special?
Show the answer
The number splits as , so its ten-digit code is . The places worth , and are read by tests 4, 5 and 8, so those three tests say yes and the other seven say no.
Tests 2, 3, 7 and 10 read the places worth , , and , so the pattern decodes to
and sample 393 is special.
- What is the fewest number of tests that always finds one special sample among 1,024 samples? Among 1,025 samples? How many patterns go unused in each case?
Show the answer
For 1,024 samples, numbered to , ten tests suffice, since gives exactly one ten-digit code per sample. Nine tests give only patterns, so ten is the fewest. All patterns are used, from ten answers of no for sample 0 to ten answers of yes for sample , so no impossible pattern is left over to signal that something went wrong.
For 1,025 samples ten tests are too few, because ten answers form only patterns and two samples would have to share one. Eleven tests give patterns, which is enough, and
of them go unused.
- Break the promise of exactly one special sample. In the eight-sample design, what do the three tests show if samples 3 and 5 are both special? Could any design with three tests handle every case of one or two special samples among eight?
Show the answer
Sample 3 has code and is in the second and third pools. Sample 5 has code and is in the first and third pools. A pool says yes when it contains at least one special sample, so all three tests say yes. The pattern is the code of sample 7, and the design would wrongly name sample 7, which is not special at all.
No three-test design can handle these cases, whether the tests are planned in advance or chosen one at a time. There are ways for one sample to be special and
ways for two to be special, cases in all, while three yes-or-no answers form only patterns. Some two cases would have to share a pattern.