# Group testing

In combinatorial mathematics, group testing refers to any procedure which breaks up the task of locating elements of a set which have certain properties into tests on subsets ("groups") rather than on individual elements. A familiar example of this type of technique is the false coin problem of recreational mathematics. In this problem there are n coins and one of them is false, weighing less than a real coin. The objective is to find the false coin, using a balance scale, in the fewest number of weighings. By repeatedly dividing the coins in half and comparing the two halves, the false coin can be found quickly as it is always in the lighter half.[1]

Schemes for carrying out such group testing can be simple or complex and the tests involved at each stage may be different. Schemes in which the tests for the next stage depend on the results of the previous stages are called adaptive procedures, while schemes designed so that all the tests are known beforehand are called non-adaptive procedures. The structure of the scheme of the tests involved in a non-adaptive procedure is known as a pooling design.

## Background

Robert Dorfman's paper in 1943 introduced the field of (Combinatorial) Group Testing. The motivation arose during the Second World War when the United States Public Health Service and the Selective service embarked upon a large scale project. The objective was to weed out all syphilitic men called up for induction. However, syphilis testing back then was expensive and testing every soldier individually would have been very cost heavy and inefficient. A basic breakdown of a test is:

• Draw sample from a given individual
• Perform required tests
• Determine presence or absence of syphilis

Say we have ${\displaystyle n}$ soldiers, then this method of testing leads to ${\displaystyle n}$ tests. If we have 70-75% of the people infected then the method of individual testing would be reasonable. Our goal however, is to achieve effective testing in the more likely scenario where it does not make sense to test 100,000 people to get (say) 10 positives.

The feasibility of a more effective testing scheme hinges on the following property. We can combine blood samples and test a combined sample together to check if at least one soldier has syphilis.

Modern interest in these testing schemes has been rekindled by the Human Genome Project.[2]

## Formalization of the problem

We now formalize the group testing problem abstractly.

${\displaystyle Input:}$ The total number of soldiers ${\displaystyle n}$, an upper bound on the number of infected soldiers ${\displaystyle d}$. The (unknown) information about which soldier is infected described as a vector ${\displaystyle \mathbf {x} =(x_{1},x_{2},...,x_{n})}$ where ${\displaystyle x_{i}=1}$ if the item ${\displaystyle i}$ is infected else ${\displaystyle x_{i}=0}$.

The Hamming Weight of ${\displaystyle \mathbf {x} }$ is defined as the number of ${\displaystyle 1's}$ in ${\displaystyle x}$. Hence, ${\displaystyle |x|\leq d}$ where ${\displaystyle |x|}$ is the Hamming weight. The vector ${\displaystyle \mathbf {x} }$ is an implicit input since we do not know the positions of ${\displaystyle 1's}$ in the input. The only way to find out is to run the tests.

### Formal notion of a test

A query/test ${\displaystyle S}$ is a subset of ${\displaystyle [n]}$. The answer to the query ${\displaystyle S\subseteq [n]}$ is defined as follows:

${\displaystyle A(S)={\begin{cases}1,{\mbox{ if }}\displaystyle \sum _{k\in S}x_{k}\geq 1\\0,{\mbox{ otherwise.}}\end{cases}}}$

Note that the addition operation used by the summation is the logical-${\displaystyle OR}$, i.e.

${\displaystyle A(S)=\displaystyle \bigvee _{i\in S}x_{i}}$.

### Goal

Compute ${\displaystyle \mathbf {x} }$ and minimize the number of tests required to determine ${\displaystyle \mathbf {x} }$.

The question boils down to one of Combinatorial Searching. Combinatorial searching in general can be explained as follows: Say you have a set of ${\displaystyle n}$ variables and each of these can take on ${\displaystyle m}$ possible values. So, finding possible solutions that match a certain constraint is a problem of combinatorial searching. The major problem with such questions is that the solution can grow exponentially in the size of the input. Here, we have no direct questions or answers. Any piece of information can only be obtained using an indirect query.

### Definition

${\displaystyle t(d,n):}$ Given a set of ${\displaystyle n}$ items with ${\displaystyle d}$ defects, the minimum number of tests that one would have to make to detect all the defective items is defined as ${\displaystyle t(d,n)}$.

Consider the case when only one person in the group will test positive. Then if we tested in the naive way, in the best case we would at least have to test the first person to find out if he/she is infected. However, in the worst case one might have to end up testing the entire group and only the last person we test will turn out to really be the one who was infected. Hence, ${\displaystyle 1\leq t(d,n)\leq n}$.

### Testing methods

There are two basic principles via which the testing may be carried out:

1. Adaptive Group Testing is where we test a given subset of items and, we get the answer from the test. We then base the next test on the outcome of the current test.
2. Non-adaptive Group Testing on the other hand is when all the tests to be performed are decided a priori.[3]

#### Definition

${\displaystyle t^{a}(d,n):}$ Given a set of ${\displaystyle n}$ items with ${\displaystyle d}$ defects, ${\displaystyle t^{a}(d,n):}$ is defined as the number of adaptive tests that one would have to make to detect all the defective items.

One should note that in the case of group testing for the Syphilis problem, non-adaptive group testing is crucial. This is because the soldiers might be spread out geographically and adaptive group testing will need a lot of co-ordination.

### Mathematical representation of the set of non-adaptive tests

For, ${\displaystyle S\subseteq [n]}$, define ${\displaystyle \chi _{i}\in \{0,1\}^{n}}$ such that ${\displaystyle i\in S\Leftrightarrow \chi _{s}(i)=1}$. ${\displaystyle M}$ is a ${\displaystyle t\times n}$ matrix of ${\displaystyle \chi _{i}}$. ${\displaystyle \mathbf {x} }$ is the input vector transposed and ${\displaystyle \mathbf {r} }$ is the resultant. The construction is based on the grounds that for non-adaptive testing with ${\displaystyle t}$ tests is represented by a ${\displaystyle t-}$subset ${\displaystyle S_{i}\subseteq [n](1\leq i\leq t)}$. ${\displaystyle \chi _{i}}$ for a given ${\displaystyle i}$ is the ${\displaystyle i^{th}}$ test. ${\displaystyle M}$ test matrix where ${\displaystyle m_{i,j}}$ is one if for the ${\displaystyle i^{th}}$ test, ${\displaystyle j\in S}$. Note that here multiplication is logical AND (${\displaystyle \bigwedge }$) and addition is logical OR (${\displaystyle \bigvee }$). Then, ${\displaystyle M\times \mathbf {x} =\mathbf {r} }$ where ${\displaystyle \mathbf {r} }$ is the resultant of the matrix multiplication. To think of this in terms of testing, it is helpful to visualize matrix multiplication. Here, ${\displaystyle \mathbf {r} }$ will have a 1 in position ${\displaystyle i}$ if and only if there was a ${\displaystyle 1}$ in that position in both ${\displaystyle M}$ and ${\displaystyle \mathbf {x} }$ i.e. if that person was tested with that particular group and if he tested out to be positive. ${\displaystyle M={\begin{pmatrix}m_{1,1}\cdots m_{1,n}\\\vdots \ddots \vdots \\m_{t,1}\cdots m_{t,n}\end{pmatrix}}}$

${\displaystyle \mathbf {x} ={\begin{pmatrix}x_{1}\\\vdots \\x_{n}\end{pmatrix}}\mathbf {r} ={\begin{pmatrix}r_{1}\\\vdots \\r_{t}\end{pmatrix}}}$

### Bounds for testing on ${\displaystyle t^{a}(d,n)}$ and ${\displaystyle t(d,n)}$

${\displaystyle 1\leq t^{a}(d,n)\leq t(d,n)\leq n}$

The reason for ${\displaystyle t^{a}(d,n)\leq t(d,n)}$ is due to the fact that any non-adaptive test can be performed by an adaptive test by running all of the tests in the first step of the adaptive test. Adaptive tests can be more efficient than non-adaptive tests since the test can be changed after certain things are discovered.

#### Lower bound on ${\displaystyle t^{a}(d,n)}$

Fix a valid group testing scheme with ${\displaystyle t}$ tests. Now, for two distinct vectors ${\displaystyle \mathbf {x} }$ and ${\displaystyle \mathbf {y} }$ where ${\displaystyle |\mathbf {x} |,|\mathbf {y} |\leq d}$, the resulting vectors will not be the same i.e. ${\displaystyle \mathbf {r(x)} \neq \mathbf {r(y)} }$. Here ${\displaystyle \mathbf {r(x)} }$ is the resultant vector when ${\displaystyle \mathbf {x} }$. This is because, two valid inputs will never give us the same result. If this ever happened, then we would always have an error in finding both ${\displaystyle \mathbf {x} }$ and ${\displaystyle \mathbf {y} }$. This gives us that the total number of distinct results is the volume of a Hamming Ball of radius ${\displaystyle d}$, centered about ${\displaystyle n}$ i.e. ${\displaystyle Vol_{2}(d,n)}$. However, for ${\displaystyle t}$ bits, the total number of possible distinct vectors is ${\displaystyle 2^{t}}$. Hence, ${\displaystyle 2^{t}\geq Vol_{2}(d,n)}$. Taking the ${\displaystyle \log }$ on both sides gives us ${\displaystyle t\geq \log\{Vol_{2}(d,n)\}}$.

Now, ${\displaystyle Vol_{2}(d,n)\geq {n \choose d}\geq ({\frac {n}{d}})^{d}}$. Therefore, we will end up having to perform a minimum of ${\displaystyle d\log {\frac {n}{d}}}$ tests.

Thus we have proved, ${\displaystyle t^{a}(d,n)\geq d\log {\frac {n}{d}}}$

#### Upper bound on ${\displaystyle t^{a}(d,n)}$

${\displaystyle t^{a}(d,n)\leq O(d\log {n})}$.

Since we know that the upper bound on the number of positives is ${\displaystyle d}$, we run a binary search at most ${\displaystyle d}$ times or until there are no more values to be found. To simplify the problem we try to give a testing sccheme that uses ${\displaystyle O(\log {n})}$ adaptive tests to figure out a ${\displaystyle i}$ such that ${\displaystyle x_{i}=1}$. The related problem is solved by splitting ${\displaystyle [n]}$ in two halves and querying to find a ${\displaystyle 1}$ in one of those and then proceeding recursively to find the exact position in the half where the query returned a ${\displaystyle 1}$. This will take ${\displaystyle 2\lceil \log {n}\rceil }$ time or if the first query is performed on the whole set, it will take ${\displaystyle \lceil \log {n}\rceil +1}$. Once a ${\displaystyle 1}$ is found, the search is then repeated after removing the ${\displaystyle i^{th}}$ co-ordinate. This can be done at most ${\displaystyle d}$ times. This justifies the running time of ${\displaystyle O(d\log {n})}$. For a full proof and an algorithm for the problem refer to: CSE545 at the University at Buffalo

#### Upper bound on ${\displaystyle t(1,n)}$

${\displaystyle t(1,n)\leq \lceil \log {n}\rceil }$ This upper bound is for the special case where ${\displaystyle d=1}$ i.e. there is a maximum of 1 positive. In this case, the matrix multiplication gets simplified and the resultant ${\displaystyle \mathbf {r} }$ represents the binary representation of ${\displaystyle i}$ for test ${\displaystyle i}$. This gives a lower bound of ${\displaystyle \lceil \log {n}\rceil }$. Note that decoding becomes trivial because the binary representation of ${\displaystyle i}$ gives us the location directly. The group test matrix here is just the parity check matrix ${\displaystyle H_{m}}$ for the ${\displaystyle [2^{m}-1,2^{m}-m-1,3]}$ Hamming code.

Thus as the upper and lower bounds are the same, we have a tight bound for ${\displaystyle t(d,n)}$ when ${\displaystyle d=1}$. Such tight bounds are not known for general ${\displaystyle d}$.

#### Upper Bounds for Non-Adaptive Group Testing

For non-adaptive group testing upper bounds we shift focus toward disjunct matrices. Disjunct matrices have been used for many of the bounds because of their nice properties. It has been shown that ${\displaystyle \Omega ({\frac {d^{2}}{\log {d}}}\log {n})\leq t(d,n)}$. Also for upper bounds we currently have ${\displaystyle t(d,n)\leq {\mathcal {O}}(d^{2}\log {n})}$ with a strongly explicit construction. It is good to note that the current known lower bound for ${\displaystyle t(d,n)}$ is already a ${\displaystyle {\frac {d}{\log {d}}}}$ factor larger than the upper bound for ${\displaystyle t^{a}(d,n)}$. Another thing to note is that give the smallest upper bound and biggest lower bound they are only off by a factor of ${\displaystyle {\frac {1}{\log {d}}}}$ which is fairly small.

## Notes

1. ^ A bit more precisely – if there are an odd number of coins to be weighed, pick one to put aside and divide the rest into two equal piles. If the two piles have equal weight, the bad coin is the one put aside, otherwise the one put aside was good and no longer has to be tested.
2. ^ Colbourn & Dinitz 2007, pg. 574, Section 46: Pooling Designs
3. ^ Colbourn & Dinitz 2007, pg. 631, Section 56.4
4. ^ Kagan E. and Ben-Gal I. (2014). "A Group-Testing Algorithm with Online Informational Learning" (PDF). IIE Transactions, 46:2, 164-184,.

## References

• Atri Rudra's course on Error Correcting Codes: Combinatorics, Algorithms, and Applications (Spring 2007), Lectures 7.
• Atri Rudra's course on Error Correcting Codes: Combinatorics, Algorithms, and Applications (Spring 2010), Lectures 10, 11, 28, 29
• Colbourn, Charles J.; Dinitz, Jeffrey H. (2007), Handbook of Combinatorial Designs (2nd ed.), Boca Raton: Chapman & Hall/ CRC, ISBN 1-58488-506-8
• Dorfman, R. The Detection of Defective Members of Large Populations. The Annals of Mathematical Statistics, 14(4), 436-440. Retrieved from [1]
• Du, D., & Hwang, F. (2006). Pooling Designs and Nonadaptive Group Testing. Boston: Twayne Publishers.
• Ely Porat, Amir Rothschild: Explicit Non-adaptive Combinatorial Group Testing Schemes. ICALP (1) 2008: 748-759