<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Antimail : Puzzles</title><link>http://blogs.msdn.com/adioltean/archive/category/8170.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Puzzle: create a Pentagon with rule and compass &lt;EOM&gt;</title><link>http://blogs.msdn.com/adioltean/archive/2007/12/26/puzzle-create-a-pentagon-with-rule-and-compass-eom.aspx</link><pubDate>Thu, 27 Dec 2007 10:37:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6875692</guid><dc:creator>AdiOltean</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/6875692.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=6875692</wfw:commentRss><description>&lt;p&gt;The title sums it all. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;P.S. And, as a Christmas bonus, here is a nice chess puzzle. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/adioltean/WindowsLiveWriter/PuzzlecreateaPentagonwithruleandcompassE_14C41/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://blogs.msdn.com/blogfiles/adioltean/WindowsLiveWriter/PuzzlecreateaPentagonwithruleandcompassE_14C41/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the above diagram you must add the two missing kings in such a way that White, who is on the move, can deliver immediate mate, i.e. mate in one move.&lt;/p&gt;  &lt;p&gt;[source: &lt;a href="http://www.chessbase.com/puzzle/christmas2007/chr07-1a.htm"&gt;ChessBase&lt;/a&gt;]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6875692" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle solution: Xen voting algorithm</title><link>http://blogs.msdn.com/adioltean/archive/2007/11/26/puzzle-solution-xen-voting-algorithm.aspx</link><pubDate>Tue, 27 Nov 2007 00:19:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6535081</guid><dc:creator>AdiOltean</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/6535081.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=6535081</wfw:commentRss><description>&lt;p&gt;I think that the problem stated in one of my &lt;a href="http://blogs.msdn.com/adioltean/archive/2007/10/29/xen-voting-algorithm.aspx"&gt;earlier&lt;/a&gt; posts is one of the most fascinating puzzles I came across recently. Many people that got confronted with it said bluntly that the problem simply has no solution, otherwise it would contradict common sense, information theory, etc. But surprisingly, it &lt;strong&gt;does &lt;/strong&gt;have a solution.&lt;/p&gt; &lt;p&gt;For X% strictly bigger than 50% the solution is known as the &lt;a href="http://citeseer.ist.psu.edu/cache/papers/cs/1068/http:zSzzSzwww.cs.utexas.eduzSzuserszSzboyerzSzmjrty.pdf/boyer82mjrty.pdf"&gt;MJRTY algorithm&lt;/a&gt;, discovered a while back by R.S. Boyer and J.S. Moore (also called the &lt;a href="http://www.cs.utexas.edu/users/moore/best-ideas/mjrty/index.html"&gt;Majority Vote algorithm&lt;/a&gt;). Although the algorithm is deceptively simple, its proof is not. the In the PDF cited above, the authors present a complete proof and also some interesting history around this non-trivial result. &lt;/p&gt; &lt;p&gt;The correct algorithm was also found by &lt;a href="http://blogs.msdn.com/adioltean/archive/2007/10/29/xen-voting-algorithm.aspx#6446494"&gt;Lailin Chen&lt;/a&gt; - also presented in the post comments, but without a proof:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;Well, Since we already knew there is one and only one who has more votes than any others, we can find him by letting the votes "fight" each other:&lt;/em&gt; &lt;p&gt;&lt;em&gt;Picked the first one, say X1, count 1 for X1, then move on,&amp;nbsp; if X1 repeats, add count to X1.&lt;/em&gt; &lt;p&gt;&lt;em&gt;When X1 doesn't repeat, reduce the count by one, if it reaches 0, picked up the current one (say X2), and do the some counting to X2.&amp;nbsp; &lt;/em&gt; &lt;p&gt;&lt;em&gt;Keep doing this until the end. The last one left with a counting bigger than 0 is the leader:&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3, 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X3, 0&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X1, 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X1, 0&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X1, 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X1, 0&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X3, 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X3, 2&lt;/em&gt; &lt;p&gt;&lt;em&gt;X3&amp;nbsp; X1&amp;nbsp; X1&amp;nbsp; X2&amp;nbsp; X1&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X3&amp;nbsp; X4&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X3, 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;So X3 is the winner. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Here is a more formal description of the algorithm: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;- You have with two registers: an “candidate register” containing the name of some candidate (candidate), and a counter (counter). &lt;/em&gt; &lt;p&gt;&lt;em&gt;- Candidate_register = NULL;&lt;/em&gt; &lt;p&gt;&lt;em&gt;- Counter = 0&lt;/em&gt; &lt;p&gt;&lt;em&gt;- For each new candidate:&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Candidate_register is NULL)&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Candidate_register = candidate&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Counter = 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else If (candidate == candidate_register)&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Counter++;&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else if (counter &amp;gt; 0)&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Counter --;&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (counter == 0)&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Candidate_register == NULL&lt;/em&gt; &lt;p&gt;&lt;em&gt;- At the end you have the correct candidate in the register. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;For X &amp;lt; 50% we can adapt a more complex variation of the same algorithm which requires two passes instead of a single one. Instead of keeping a single register (keeping the last candidate) and its associated counter, we keep a number of K registers (with their associated counters) and run the same algorithm. The integer K is chosen such that 100/(K+1) &amp;lt; X. After this pass, we discovered K candidates but of course the candidate with the biggest counter might &lt;strong&gt;not &lt;/strong&gt;be the real candidate. To find the top candidate we simply reset all counters to zero (but keep the candidates found) and re-run the same algorithm. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;- Instead of maintaining one “element” register and one counter as in the main algorithm, you need to use K registers, each with K counters. &lt;/em&gt; &lt;p&gt;&lt;em&gt;- First pass&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Initialize all candidate registers with NULL and counters with zero&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For each candidate in the log file&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the candidate is in one of the K registers, increase its counter&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else if there is one candidate register which is NULL, put it there and increase its counter with 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else, reduce all counters by 1&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If some counters become zero, set their corresponding candidate registers to NULL &lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; At the end, each of the candidate registers contains every element with frequency &amp;gt; 100/(K+1). One of them is the winner&lt;/em&gt; &lt;p&gt;&lt;em&gt;- Second pass&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Initialize all counters with zero, but keep the candidate registers filled with the values above. &lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For each candidate in the log file&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the candidate is in one of the K registers, increase its counter&lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; At the end, you have all the correct counters for all the candidate registers. &lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select the one that has the maximum count. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;A variation of this second algorithm is briefly mentioned in this &lt;a href="http://www.cs.rutgers.edu/~muthu/198-3.pdf"&gt;presentation&lt;/a&gt; although I could not find a formal article describing it. &lt;/p&gt; &lt;p&gt;What all these algorithms have in common? The fact that you know &lt;strong&gt;ahead of time &lt;/strong&gt;that there is a winner, but you don't know which one. While the algorithms are simple to implement, this is a pretty strong condition that is not likely to be encountered in our real world. Maybe on a planet called &lt;a href="http://en.wikipedia.org/wiki/Xen_%28Half-Life%29"&gt;Xen&lt;/a&gt; :-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6535081" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Click+or+miss/default.aspx">Click or miss</category></item><item><title>Puzzle: Xen voting algorithm</title><link>http://blogs.msdn.com/adioltean/archive/2007/10/29/xen-voting-algorithm.aspx</link><pubDate>Tue, 30 Oct 2007 07:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5776272</guid><dc:creator>AdiOltean</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/5776272.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=5776272</wfw:commentRss><description>&lt;P&gt;There is a huge amount of aliens living on the Xen planet who want to elect their new leader (since their previous leader died a while back). They want to switch to a very democratic voting process, through the help of a very special communication field called the “vortessence”. &lt;/P&gt;
&lt;P&gt;One interesting property of voting through vortessence is that it can tell them whether there &lt;STRONG&gt;is &lt;/STRONG&gt;a certain unique leader which is guaranteed to meet a certain percentage of votes X% (which is a number chosen ahead of time and can be considered constant in this discussion). But the vortessence cannot be used to tell who is actually the winning leader. &lt;/P&gt;
&lt;P&gt;So these aliens will also use the help of a computer to record the voting. The rules are simple: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The winner has to record at least X% votes (a unique leader is guaranteed to exist, as indicated by the vortessence)&lt;/LI&gt;
&lt;LI&gt;Each alien votes exactly once, by indicating the name of the proposed leader. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;After the voting season, the votes are recorded in a very large unsorted log file, containing the names of the voted aliens. Now, since there are a lot of aliens, they need to use an algorithm to figure out the leader, running in O(1) in space and O(N) in time (name comparisons can be considered constant). &lt;/P&gt;
&lt;P&gt;In what conditions is this problem solvable, and if yes, what is the minimal number of log passes? &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5776272" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Simple probability problem</title><link>http://blogs.msdn.com/adioltean/archive/2006/08/18/707199.aspx</link><pubDate>Sat, 19 Aug 2006 09:20:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:707199</guid><dc:creator>AdiOltean</dc:creator><slash:comments>32</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/707199.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=707199</wfw:commentRss><description>&lt;p&gt;&lt;span lang="EN-US" style="font-size: 10pt; font-family: arial"&gt;I love probability puzzles. Here is one I liked: &lt;/span&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;span lang="EN-US" style="font-size: 10pt; font-family: arial"&gt;&lt;em&gt;There are a 100 people trying to get onto the same flight you are. The airplane has a 100 seats. You are all ready to board. You are the last one in the line of passengers at the gate. The first guy walks in to the flight and promptly realizes that he does not have his boarding pass on him and does not remember his seat number. So he picks one at random, hoping his charm will take care of the after effects. Every one else takes their assigned seat if it is available. If someone is already sitting on it they quietly look for an empty one and sit there. By the time you get in there is only 1 seat left. What is the probability that the seat which remains is indeed the one originally assigned to you?&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=707199" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: prime numbers</title><link>http://blogs.msdn.com/adioltean/archive/2006/03/07/545890.aspx</link><pubDate>Wed, 08 Mar 2006 07:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:545890</guid><dc:creator>AdiOltean</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/545890.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=545890</wfw:commentRss><description>Show that (N^4 + 4^N) is a prime number if and only if N=1.&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=545890" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: another probability problem</title><link>http://blogs.msdn.com/adioltean/archive/2006/01/10/511448.aspx</link><pubDate>Wed, 11 Jan 2006 05:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:511448</guid><dc:creator>AdiOltean</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/511448.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=511448</wfw:commentRss><description>&lt;P&gt;If you have an urn who already contains either a black or white ball, and you add a white ball to it, and then you subtract a white ball from it, then what is the probability of having a white ball left? &lt;/P&gt;
&lt;P&gt;[update: adding the fact that the original ball is either black or white]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=511448" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: probability problem</title><link>http://blogs.msdn.com/adioltean/archive/2005/12/28/507850.aspx</link><pubDate>Thu, 29 Dec 2005 00:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:507850</guid><dc:creator>AdiOltean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/507850.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=507850</wfw:commentRss><description>&lt;P&gt;Here is an interesting probability problem who recently generated long discussions in our team: &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Say that you have an array of N boolean values, with all values initially set to FALSE. At each iteration step, you arbitrary pick an element in the array and set it to TRUE. What is the average number of elements set to TRUE after K iteration steps? &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;By the way, as an anecdotic fact, this problem came from analyzing paged pool memory consumption when you randomly access a large volume over time. I will not go in more details, but I just wanted to mention this problem as a particular application of theoretical statistics&amp;nbsp;in the design of operating system components...&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=507850" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Math puzzle: minimum number?</title><link>http://blogs.msdn.com/adioltean/archive/2005/11/29/498205.aspx</link><pubDate>Wed, 30 Nov 2005 08:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:498205</guid><dc:creator>AdiOltean</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/498205.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=498205</wfw:commentRss><description>&lt;P&gt;What is the minimum number that cannot be expressed with less than two english words?&amp;nbsp;Also, how about less than&amp;nbsp;thirteen english words?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=498205" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: all horses have the same color</title><link>http://blogs.msdn.com/adioltean/archive/2005/09/13/465254.aspx</link><pubDate>Wed, 14 Sep 2005 03:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:465254</guid><dc:creator>AdiOltean</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/465254.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=465254</wfw:commentRss><description>&lt;P&gt;Several answers to my previous &lt;a href="http://blogs.msdn.com/adioltean/archive/2005/09/12/464198.aspx"&gt;puzzle&lt;/A&gt;&amp;nbsp;reminded me about an old result:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Theorem: &lt;/STRONG&gt;All horses have the&amp;nbsp;same color.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Proof&lt;/STRONG&gt;: We&amp;nbsp;demonstrate this by induction over N for all the sets of horses size of size N:&lt;BR&gt;- N=1: The proof is true for N = 1 (any horse has the same color as itself, so the propery is valid for any set of size 1)&lt;BR&gt;- (N-1) -&amp;gt; N:&amp;nbsp;- Assuming that the&amp;nbsp;property is true for any set of (N-1) horses, we need to proof that the property holds for any set of size N. Let's pick a random set of N horses and let's do the following trick. First, we take one horse out. There are (N-1) horses left which obviously have the&amp;nbsp;same color, according to the induction.&amp;nbsp; Now we put back the original horse and take another one out. We get again (N-1) horses, so the initial horse that we just added back must have the same color as the rest. In conclusion all the N horses have the same color. QED. &lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now, why does this old puzzle come to my mind? Exercise left to the reader :-) &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=465254" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Two math puzzles</title><link>http://blogs.msdn.com/adioltean/archive/2005/09/12/464198.aspx</link><pubDate>Tue, 13 Sep 2005 01:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:464198</guid><dc:creator>AdiOltean</dc:creator><slash:comments>22</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/464198.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=464198</wfw:commentRss><description>&lt;P&gt;What is the value&amp;nbsp;of this expression? &lt;/P&gt;&lt;IMG src="http://static.flickr.com/31/42802826_d7071e520d_m.jpg"&gt; 
&lt;P&gt;If that was too easy, how about this one?&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://static.flickr.com/29/42802827_02583e4639_m.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=464198" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Click+or+miss/default.aspx">Click or miss</category></item><item><title>Puzzle Solution: a geometry problem</title><link>http://blogs.msdn.com/adioltean/archive/2005/08/18/453437.aspx</link><pubDate>Fri, 19 Aug 2005 06:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:453437</guid><dc:creator>AdiOltean</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/453437.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=453437</wfw:commentRss><description>&lt;P&gt;The geometry problem from my previous math &lt;a href="http://blogs.msdn.com/adioltean/archive/2005/08/06/448483.aspx"&gt;puzzle&lt;/A&gt; has a nice solution. I particularly like it because it is one of these problems that are pretty hard to solve traditionally - unless you perform the right geometric construction - and at that point, the solution becomes trivial. &lt;/P&gt;
&lt;P&gt;We will perform the following trick. From the point D we will draw a segment DE (with E on the longer side - AC in our case). E is chosen such that the angle(ABD) = angle(ADE).&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://adi_oltean.members.winisp.net/images/geometry/triangle2.png"&gt;&lt;/P&gt;
&lt;P&gt;At this point, our puzzle solving strategy is this:&lt;BR&gt;a) Derive as much equations as possible from our new construction, and&lt;BR&gt;b) Eliminate from these euqations any segments involving the point "E".&lt;/P&gt;
&lt;P&gt;First, we immediately observe that the triangle BAD is similar with the triangle DAE, therefore: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AD/AB = AE/AD = DE/BD (1) &lt;/P&gt;
&lt;P&gt;From here we can extract AE without involving any other segments containing the point "E": &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AE = AD^2 / BA (2)&lt;/P&gt;
&lt;P&gt;Second, because angle(ADE) + angle(EDC) = angle(ADC) = angle(ABD) + angle(BAD) we obtain: angle(BAD) = angle(EDC) = angle(DAE). In conclusion, the triangle ADC is similar with the triangle DEC, so: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DC/AC = EC/DC = DE/AD&amp;nbsp;(3)&lt;/P&gt;
&lt;P&gt;From here, we&amp;nbsp;extract EC, again&amp;nbsp;without involving any other segments containing the point "E": &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;EC = DC^2 / AC (4)&lt;/P&gt;
&lt;P&gt;Third, if we divide the other "unused" parts from equalities from (1) and (3) involving DE (but not involving any other segments containing "E") we obtain: (AD/AB) / (DC/AC) = (DE/BD) / (DE/AD). AD simplifies, and we obtain: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AB/AC = DB/DC (5) &lt;/P&gt;
&lt;P&gt;So, we have now three inequalities (2), (4) and (5), where the first two one involve the segments AE and EC. &lt;/P&gt;
&lt;P&gt;Now, how we can get rid of "E" in AE and EC? We observe that&amp;nbsp;AC&amp;nbsp;= AE + EC, and by substituting AE and EC from the equations (2) and (4) above, we finally obtain something that doesn't contain any "E"s anymore: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AC = AD^2 / AB + DC^2 / AC. (6)&lt;/P&gt;
&lt;P&gt;From here, we extract AD^2: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AD^2 = AC * AB - AB/AC&amp;nbsp;* DC^2 = AC * AB - DB/DC * DC^2 = AC * AB - DB/DC * DC^2. (7)&lt;/P&gt;
&lt;P&gt;In conclusion, after everyting simplifies nicely,&amp;nbsp;we obtain our initial equality: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AD^2 =&amp;nbsp; AC * AB - DB * DC&lt;/P&gt;
&lt;P&gt;P.S. Feeedback summary on the puzzles: &lt;BR&gt;1) &lt;A href="http://members.aon.at/custos/blog/blog.html"&gt;MovGP0&lt;/A&gt; posted another&amp;nbsp;possible solution to the geometry problem at &lt;A href="http://de.wikipedia.org/wiki/Benutzer:MovGP0/Dreieck"&gt;http://de.wikipedia.org/wiki/Benutzer:MovGP0/Dreieck&lt;/A&gt;&amp;nbsp;but it looks like the proof is apparently incomplete (although&amp;nbsp;I might be wrong).&lt;BR&gt;2) Many readers correctly pointed out that the other sequence puzzle is a classic one, called the Convay sequence (also named the "&lt;A href="http://mathworld.wolfram.com/LookandSaySequence.html"&gt;Look and Say&lt;/A&gt;" sequence). As an anecdotic fact, I&amp;nbsp;heard&amp;nbsp;that it was initially done as a scientific study where people with mathematic abilities were tested along with people with literary/linguistic abilities. Interestingly, the persons with linguistic abilities found the solution much quicker than the ones with math abilities.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=453437" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: a little geometry problem, and a sequence question</title><link>http://blogs.msdn.com/adioltean/archive/2005/08/06/448483.aspx</link><pubDate>Sat, 06 Aug 2005 10:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:448483</guid><dc:creator>AdiOltean</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/448483.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=448483</wfw:commentRss><description>&lt;P&gt;This is not really a puzzle, but a real geometry problem. Let's take a random triangle (ABC), and let's assume that the angle bisector from A intersects BC in the point D. Proof that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AD ^ 2 = AB * AC - BD * CD&lt;/P&gt;
&lt;P&gt;Here is the figure, drawn in MSPAINT.EXE as you can see :-)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://adi_oltean.members.winisp.net/images/geometry/triangle.png"&gt;&lt;/P&gt;
&lt;P&gt;And now, a real math puzzle. Here&amp;nbsp;is a sequence of&amp;nbsp;sequences of numbers. &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2,1&lt;BR&gt;&amp;nbsp;&amp;nbsp;1,2,1,1&lt;BR&gt;1,1,1,2,2,1&lt;BR&gt;3,1,2,2,1,1&lt;BR&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;What comes next?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=448483" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: When everything goes wrong</title><link>http://blogs.msdn.com/adioltean/archive/2005/07/01/434795.aspx</link><pubDate>Sat, 02 Jul 2005 01:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:434795</guid><dc:creator>AdiOltean</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/434795.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=434795</wfw:commentRss><description>&lt;P&gt;During war, two spies (Jack and Arnold) are being parachuted in a&amp;nbsp;hostile country.&amp;nbsp;But during their landing, their plane&amp;nbsp;gets intercepted by the special forces.&amp;nbsp;Things started to go out of control: they both lose all their equipment, and&amp;nbsp;Ann,&amp;nbsp;the person&amp;nbsp;that is waiting for them on the ground, is killed. They both land far from the original location (and far from each other) in a completely unknown area. Eventually, each of them&amp;nbsp;reaches a pay phone, but when they call Ann's phone number they obviously get no response.&lt;/P&gt;
&lt;P&gt;The first thing that they have to do is get in touch with each other. They obviously can't call 911 or any random number, or do anything that will draw attention (like putting announcements in a newspaper), because all special forces are looking for them. In fact there is no TV, radio&amp;nbsp;or newspapers in that area that would allow one of them to get information about another. Of course, they have no cell phones, walkie-talkies or anything that would allow them to communicate. &lt;/P&gt;
&lt;P&gt;What&amp;nbsp;would be&amp;nbsp;their strategy to get in touch?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=434795" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: two cubes</title><link>http://blogs.msdn.com/adioltean/archive/2005/06/27/433155.aspx</link><pubDate>Tue, 28 Jun 2005 03:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:433155</guid><dc:creator>AdiOltean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/433155.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=433155</wfw:commentRss><description>You are given two white cubes. You&amp;nbsp;are asked to&amp;nbsp;draw a digit (from 0..9) on every square of these cubes, such that you will be able to represent evert day in a month using these cubes in certain position. For example, "13" would require that a face on one cube will contain "1" and another face on the other cube will contain "3". &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=433155" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item><item><title>Puzzle: How do you get out of the prison (Part II)</title><link>http://blogs.msdn.com/adioltean/archive/2005/06/24/432530.aspx</link><pubDate>Sat, 25 Jun 2005 08:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:432530</guid><dc:creator>AdiOltean</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/432530.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=432530</wfw:commentRss><description>&lt;P&gt;The previous &lt;a href="http://blogs.msdn.com/adioltean/archive/2005/06/13/428710.aspx"&gt;puzzle&lt;/A&gt; was &lt;a href="http://blogs.msdn.com/adioltean/archive/2005/06/13/428710.aspx#428837"&gt;solved&lt;/A&gt; correctly in the comments. So I thought to present with another prison-style puzzle:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;A warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"In the prison is a switch room, which contains two light switches labeled A and B, each of which can be in either the 'On' or the 'Off' position. I am not telling you their present positions. The switches are not connected to anything. &lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;BR&gt;"After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none, either. Then he'll be led back to his cell. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time anyone of you may declare to me, 'We have all visited the switch room.' &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators." &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=432530" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Puzzles/default.aspx">Puzzles</category></item></channel></rss>