Identifying poisoned wines - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-18T07:27:13Z http://mathoverflow.net/feeds/question/59939 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/59939/identifying-poisoned-wines Identifying poisoned wines Qiaochu Yuan 2011-03-29T04:18:43Z 2012-12-27T04:20:14Z <p>The standard version of this puzzle is as follows: you have $1000$ bottles of wine, one of which is poisoned. You also have a supply of rats (say). You want to determine which bottle is the poisoned one by feeding the wines to the rats. The poisoned wine takes exactly one hour to work and is undetectable before then. How many rats are necessary to find the poisoned bottle in one hour?</p> <p>It is not hard to see that the answer is $10$. Way back when math.SE first started, <a href="http://math.stackexchange.com/questions/639/logic-problem-identifying-poisoned-wines-out-of-a-sample-minimizing-test-subjec" rel="nofollow">a generalization</a> was considered where more than one bottle of wine is poisoned. The strategy that works for the standard version fails for this version, and I could only find a solution for the case of $2$ poisoned bottles that requires $65$ rats. Asymptotically my solution requires $O(\log^2 N)$ rats to detect $2$ poisoned bottles out of $N$ bottles.</p> <p>Can anyone do better asymptotically and/or prove that their answer is optimal and/or find a solution that works for more poisoned bottles? The number of poisoned bottles, I guess, should be kept constant while the total number of bottles is allowed to become large for asymptotic estimates. </p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/59948#59948 Answer by Alan Cooper for Identifying poisoned wines Alan Cooper 2011-03-29T06:11:58Z 2011-03-29T06:11:58Z <p>For the case of one poisoned bottle I would expect the answer to be logbase2(N) because we could then have each rat drink from the bottles whose positions' binary digits include the rat's position and the rats that die will be those whose positions give the binary representation of the bad bottle's position.</p> <p>If that is correct then for two bad bottles I would be inclined to think of doing the same thing with the list of all bottle pairs, but of course there is not just one poisonous pair. In order to identify the unique doubly poisonous pair we need to replace the rats by something that only dies if it gets a double dose. It seems that pairs of rats would suffice for this, but then the total number needed would be 2*logbase2(NC2) which gives only 38 for N=1000, so if your answer is optimal I must have missed something.</p> <p>Where did I go wrong?</p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/59953#59953 Answer by Ori Gurel-Gurevich for Identifying poisoned wines Ori Gurel-Gurevich 2011-03-29T06:55:20Z 2011-03-29T06:55:20Z <p>You yourself give the solution in the link: the probabilistic method. Without trying to optimize, take $r$ rats and for each one choose the subset of wines randomly, each wine with probability $1/2$ (say). Call these subsets $A_m$. Now let <code>$\{i,j\}$</code> and <code>$\{k,l\}$</code> be two possibilities for which bottles are poisoned. We want to know whether there's a rat separating these two possibilities, that is, that the outcome if the $i$-th and $j$-th bottles are the poisoned one will be different for that rat, then if the $k$-th and $l$-th bottles are poisoned. For any specific rat, this happens if $A_m$ intersects <code>$\{i,j\}$</code> but not <code>$\{k,l\}$</code> or vice verse. This happens with some fixed positive probability (again, not optimizing). Therefore, it fails with probability $q$ which is strictly less than 1. Hence, the probability for it to fail for all <code>$\{A_m\}_{m=1}^r$</code> is $q^r$. There are less than $n^4$ pairs of possibilities for poisoned wine bottles, hence the probability of having some pair for which this fails is at most $n^4 q^r$ and taking $r=C \log n$ suffices to make this negligible.</p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/60312#60312 Answer by Sergey Norin for Identifying poisoned wines Sergey Norin 2011-04-01T17:29:34Z 2011-04-01T21:23:38Z <p>Each bottle of wine corresponds to the set of rats who tasted it. Let $\mathcal{F}$ be the family of the resulting sets. If bottles corresponding to sets $A$ and $B$ are poisoned then $A \cup B$ is the set of dead rats. Therefore we can identify the poisoned bottles as long as for all $A,B,C,D \in \mathcal{F}$ such that $A \cup B = C \cup D$ we have $\{ A, B \} = \{ C, D \}$. Families with this property are called <em>(strongly) union-free</em> and the maximum possible size $f(n)$ of a union free family $\mathcal{F} \subset 2^{ [n] }$ has been studied in extremal combinatorics. In the question context, $f(n)$ is the maximum number of bottles of wine which can be tested by $n$ rats.</p> <p>In the paper <a href="http://www.math.uiuc.edu/~z-furedi/PUBS/furedi_frankl_union-free-and-entropy.pdf" rel="nofollow">"Union-free Hypergraphs and Probability Theory"</a> Frankl and Furedi show that $$2^{(n-3)/4} \leq f(n) \leq 2^{(n+1)/2}.$$ The proof of the lower bound is algebraic, constructive, and, I think, very elegant. In particular, one can find $2$ poisoned bottles out of $1000$ with $43$ rats. </p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/60340#60340 Answer by rcompton for Identifying poisoned wines rcompton 2011-04-02T02:49:24Z 2011-04-02T02:49:24Z <p>There's a very similar problem in compressed sensing genetic screening for rare alleles (cf <a href="http://nar.oxfordjournals.org/content/38/19/e179.full" rel="nofollow">http://nar.oxfordjournals.org/content/38/19/e179.full</a> ). The technique almost works here provided we can determine how much poison a rat gets. Seems reasonable, a rat that gets more poison dies faster.</p> <p>In our problem the idea would be to create a sample for each rat to drink by randomly pooling together wine from many bottles. Specifically, for rat $i$ we draw $A_{ij}$ liters of wine from each of the $j=1,...,N$ bottles where $A_{ij}$ is $\mathcal{N}(0,1)$ distributed. Let $b_i$ denote the amount of poison measured in rat $i$ and let $x_j$ denote the amount of poison in bottle $j$.</p> <p>This yields the highly underdetermined linear system $$A\vec{x} = \vec{b}$$ where we know a priori that $\vec{x}$ is sparse. The sparsest solution to this linear system may obtained in polynomial time by solving the convex optimization $$\min |\vec{x}|_1 \text{ s.t. } A\vec{x}=\vec{b}$$</p> <p>The number of rats required here is $\mathcal{O}(s \log(N))$ where $s$ is the number of poison bottles.</p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/67205#67205 Answer by Mike Spivey for Identifying poisoned wines Mike Spivey 2011-06-08T04:11:54Z 2011-06-10T03:28:29Z <p>This problem also goes by the name "<a href="http://en.wikipedia.org/wiki/Group_testing#Testing_Methods" rel="nofollow">nonadaptive</a> <a href="http://en.wikipedia.org/wiki/Group_testing" rel="nofollow">combinatorial group testing</a>" and has been around since at least World War II, when the U.S. government was trying to isolate syphilis cases in soldiers. ("Nonadaptive" means you have to specify all the tests in advance, whereas "adaptive" means you can use the results from previous tests before deciding which ones to do next.) </p> <p>The standard reference on group testing appears to be <em><a href="http://books.google.com/books?id=KW5-CyUUOggC&amp;printsec=frontcover&amp;dq=combinatorial+group+testing&amp;hl=en&amp;ei=DInxTYL5IomisAOFrPimDg&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=1&amp;ved=0CCoQ6AEwAA#v=onepage&amp;q&amp;f=false" rel="nofollow">Combinatorial Group Testing and Its Applications</a></em>, by Du and Hwang. Part II, which comprises Chapters 7-9, is on nonadaptive testing. In particular, finding optimal testing structures when there are two or more "defectives" is still an open problem. </p> <p>However, if $t(d,n)$ is the number of tests required to isolate $d$ defectives out of $n$ total subjects, the bounds $\Omega(\frac{d^2}{\log d} \log n) \leq t(d,n) \leq O(d^2 \log n)$ are known. The Wikipedia article on <a href="http://en.wikipedia.org/wiki/Disjunct_matrix#Upper_bounds_for_non-adaptive_group_testing" rel="nofollow">disjunct matrices</a> has a discussion and some proofs.</p> <p><HR></p> <p>It might be interesting to compare the solution for the adaptive version of this problem, as we can give a definite answer in this case.</p> <p>Let $n(t)$ denote the maximum number of bottles of wine for which 2 poisoned ones can be identified in $t$ adaptive tests. In "<a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1749-6632.1989.tb16386.x/abstract" rel="nofollow">Group testing with two and three defectives</a>" (<em>Annals of the New York Academy of Sciences</em> 576, pp. 86-96, 1989) Chang, Hwang, and Weng give explicit testing procedures that yield the lower bounds $$n(t) \geq 89 \cdot 2^{\frac{t}{2}-6}, t \text{ even, } t \geq 12;$$ $$n(t) \geq 63 \cdot 2^{\frac{t-1}{2}-5}, t \text{ odd, } t \geq 13.$$</p> <p>In the <a href="http://books.google.com/books?id=KW5-CyUUOggC&amp;pg=PA49&amp;dq=combinatorial+group+testing+2-defective+case&amp;hl=en&amp;ei=yIvxTe2zNY_QsAO05tW3Dg&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=1&amp;ved=0CCoQ6AEwAA#v=onepage&amp;q&amp;f=false" rel="nofollow">Du and Hwang text</a> it is shown that, for $t \geq 4$, we have the upper bound $$n(t) \leq 2^{\frac{t+1}{2}} - 1/2.$$<br> (Note that this is the upper bound on $f(n)$ given in Sergey Norin's answer.)</p> <p>These bounds tell us that $n(18) \leq 723$ but that $n(19) \geq 1008$. Thus 2 poisoned bottles can be identified out of 1000 in 19 adaptive tests but no fewer, using the testing procedure described in the Chang, Hwang, and Weng paper. </p> http://mathoverflow.net/questions/59939/identifying-poisoned-wines/117301#117301 Answer by TonyD for Identifying poisoned wines TonyD 2012-12-27T04:20:14Z 2012-12-27T04:20:14Z <p>I'm kinda confused on how this works. I get log(2) of 1000 ~ 10, but is that only for binary events? Could someone walk me through how out of 1000 bottles, the EXACT poisoned bottle (1/1000) can be found by drinking only 10? Are you breaking up the bottles into groups, and then pouring all of the wine together, effectively poisoning the group? You can only test 1 bottle at a time, so with 10 tests, you will only test 10 bottles right, .1% of the entire group?</p> <p>Thanks!</p>