Dear Claire, The idea of this little job is to capture the readers' names so I can acknowledge them in the book. Sometimes puzzle solutions have names too. I don't want those. So for example, in the first puzzle (beautiful liars), you should get: Cary Bakker, David Weiblen, Brian Hetrik, Karen Horn Wesley T. Perkins Michael Van Vertloo Kent Donaldson Warren Dougherty Ted Alper Michael G. McCullough Mathew Davies Chris Frey Christian Tanguy Charles Taylor Robert H. Morrison Thorston Koch Ryan Fischbach Lee Chee Meng Elijah Pau Michael Brackx Iulian Kakulidis Nicholas Sakurai One name per line with a comma at the end. Duplicates are fine and they don't need to be sorted (I can do that algorithmically). Please keep track of your time. If you find it annoying at any time, please just stop. Love, Dennis ======================== Reader solutions to Beautiful Liars: As of this writing, many readers were able to prove two facts about the Beautiful Liars problem: 1. there have to be at least 8 liars This follows because there are the following non-overlapping pairs: gwenyth, alan dave, mike sam, jack ulm, larry olivia, kris tom, hillary emily, isaac petra, rivera Since either the accuser or accused must be lying in a pair, this shows that there must be at least 8. 2. If there are 8 liars, they can be only: Dave Gwenyth Hillary Isaac Jack Larry Olivia Rivera, or Dave Gwenyth Hillary Isaac Larry Olivia Petra Sam, or Dave Gwenyth Hillary Isaac Larry Olivia Rivera Sam. Approaches for this ranged from hand-checking to genetic algorithms to exhaustive search on colored graphs. Here are the solving readers' names in the order that I received the solutions (I hope I left nobody out): Cary Bakker, David Weiblen, Brian Hetrik, Karen Horn Wesley T. Perkins Michael Van Vertloo Kent Donaldson Warren Dougherty Ted Alper Michael G. McCullough Mathew Davies Chris Frey Christian Tanguy Charles Taylor Robert H. Morrison Thorston Koch Ryan Fischbach Lee Chee Meng Elijah Pau Michael Brackx Iulian Kakulidis Nicholas Sakurai Reader Solutions to the Ambulance Puzzle Several readers came up with better solutions than Liane for the Ambulance Puzzle. The best came from Onno Waalewijn, Steve Kietzman, Jimmy Hu, Pearl Pauling, Rodney Meyer, and Michael Elkins With the initial configuration of ambulances and the requirement that every ambulance had to return to its home site, Dennis Yelle and Andrew Palfreyman were the first to be able to save 18 victims using the following allocation of ambulances (the line De Gaulle 1: 16 10, 13 12 means that the first ambulance from De Gaulle first picks up victims 16 and 10, returns to De Gaulle, then goes out and rescues 13 and 12): [DDJ: please keep formatting] Austerlitz 1: 0 (34 of 35) Austerlitz 2: 2 (28 of 32) Austerlitz 3: 4 (26 of 31) Austerlitz 4: 5 (20 of 28) Pasteur 1: 8 6 (31,32 of 42,33) Pasteur 2: 18 7 (29,30 of 31,32) Pasteur 3: 1 (36 of 42) De Gaulle 1: 16 10, 13 12 (15,16 of 32,31: 32,33 of 34,34) finish 16, 10 by time 16. Then take 18 to get the others. De Gaulle 2: 26 19, 3 (25,26 of 27,31: 35 of 39) De Gaulle 3: 29 27 (31,32 of 31,32) Andrew and Onno came up with the best solution so far for the second case in which ambulances can be based wherever they are most useful (saving 22): [DDJ: please keep formatting] Pasteur 1: 2 0, 6 (19,20 of 32,35: 29 of 33) Pasteur 2: 5 4, 7 (19,20 of 28,31: 27 of 32) De Gaulle 1: 16 3, 13 12 (15,16 of 32,39: 32 of 34,34) De Gaulle 2: 8 1 (39,40 of 42,42) De Gaulle 3: 18 15 (29,30 of 31,33) De Gaulle 4: 23 10 (27,28 of 29,31) De Gaulle 5: 26 19 (25,26 of 27,31) De Gaulle 6: 29 27 (31,32 of 31,32) De Gaulle 7: 9 (40 of 42) De Gaulle 8: 14 (32 of 34) Jimmy Hu was the first to notice that 6 out of the 30 were out of range for any hospital, so it is hard to improve much on this 22 rescue solution. Dennis Yelle came up with the best solution when each ambulance had to start at its home site but could drop off victims at any hospital provided it could find available bays (saving 21). Here I'm using his notation in which 1 is Austerlitz, 2 is Pasteur, and 3 is De Gaulle. So, the second line means the ambulance starts at Austerlitz, rescues victims 2 and 0 and ends at De Gaulle and then rescues victim 3. [DDJ: please keep formatting] h1 1 h2 h1 2 0 h3 3 h3 h1 5 4 h2 7 h2 h1 6 10 h3 h2 9 h2 h2 17 h3 h2 18 15 h3 h3 19 12 h3 13 h3 h3 26 16 h3 8 h3 h3 29 27 h3 Rodney Meyer suggested a way to add two ambulances and base 6 at Pasteur and 7 at De Gaulle to lead to the rescue of 23 victims. Reader Solutions to the Beam Problem Readers showed that Natasha gave way too few constraints. James Walby for example found over 85,000 solutions in 10 hours of computing time. I would like to salute those who gave me the best answers: Dennis Yelle, Rodney Meyer, Carl Smotricz, Steve Kietzman, Jerry Olsen, John A. Trono, Jean-François Halleux, Frank Radencich, Andrew Palfreyman, Michael Birken, Steve Altus, Tomas G. Rokicki, Alexander Fedorov, and Adekunle Bello. In fact, some readers sent me files with thousands of solutions. Several readers took the further initiative of finding the minimum and maximum variance. The minimum variance is probably the most interesting since the Greeks loved symetry. Thomas Rockicki showed that under the original guidelines, where each beam is at least 4 units long and there is at least one beam over 11 units, the variance can be as low as 1.9447 for the arrangement where there are two beams of length 7.3, three of length 7.4 and one of length 11.1. I challenged some readers to ignore the guidelines and to go for the minimum variance solution. Of those, Michael Birken produced the best analysis: In fact, he proved that the minimum variance is 51/10800 = 0.004722222222222... I quote his proof: "The length of the assembled temple is 47.9 cubits (i.e. the sum of lengths of the fragments exclusively from the front or from the back). Since there are 6 beams in the assembled temple, the mean length of any beam is 47.9/6 = 7.9833333333333... Since the fragment lengths are all rounded to the nearest tenth of a cubit, the minimum beam length that does not exceed this mean is 7.9 cubits. By the same token, the maximum beam length that does not exceed this mean is 8.0 cubits. Ideally, we would like a solution containing lengths of [7.9, 8.0, 8.0, 8.0, 8.0, 8.0] since 7.9 + 8.0 + 8.0 + 8.0 + 8.0 + 8.0 = 47.9. Such a solution, if it existed, would have the minimum variance possible because any shuffling of a tenth of cubit would either result in a solution with the same variance or a solution that had beam lengths that deviated even more from the mean of 47.9/6. Unfortunately, such a solution does not exist. One of the fragments from the back of the assembled temple is 6.8 cubits long. If it originated from a beam of length 8.0, then we must be able to assemble some of the remaining back fragments into a length of 8.0 – 6.8 = 1.2 cubits. Since the two shortest fragments from the back are 1.0 and 1.3 cubits, there is no way to assemble a beam of length 8.0 using the 6.8 cubit fragment. Similarly, there is no way to assemble a beam of length 7.9 using the 6.8 cubit fragment since 7.9 - 6.8 = 1.1 cubits. Since the minimum length we can shuffle is a tenth of a cubit and the borrowed tenth of a fragment cannot be donated to the 7.9 cubit beam because that would result in a solution of the same form, the next possible solution with minimum variance is either of the form [7.8, 8.0, 8.0, 8.0, 8.0, 8.1] or of the form [7.9, 7.9, 8.0, 8.0, 8.0, 8.1]. The former has a variance of approximately 0.008056 and the latter has a variance of approximately 0.004722. So, if the latter solution exists, then it must have the minimum variance possible. And, we know that a plethora of such solutions exists (I have attached 100 solutions of this form). Here is one example: [8:1.2, 3:2.5, 9:4.2], [12:1.4, 15:2.2, 11:4.3] length = 7.9 [19:3.3, 13:4.6], [13:3.3, 2:4.6] length = 7.9 [14:1.2, 1:2.4, 11:4.4], [9:1.0, 16:2.0, 4:2.4, 14:2.6] length = 8.0 [2:1.0, 5:3.0, 16:4.0], [6:2.1, 3:2.8, 5:3.1] length = 8.0 [18:0.7, 12:3.6, 15:3.7], [1:1.4, 17:2.7, 7:3.9] length = 8.0 [20:0.1, 4:0.4, 7:0.4, 17:1.1, 10:2.4, 6:3.7], [10:1.3, 8:6.8] length = 8.1" ==== Rockicki for solution using original guidelines. | 7.3| 7.3| 7.4| 7.4| 7.4| 11.1| |24 37 12|10 44 11 7 1| 25 12 37| 4 30 40| 4 24 46|42 36 33| |14 28 31| 46 27|24 10 14 26|39 13 22|21 33 20| 68 43| The top row holds the lengths of the beams, the next row is the lengths of the components from the front, and the bottom row is the lengths of the components from the bottom. to a high of 76.1847. | 4.2| 41| 41| 40| 40| 275| | 42|7 33 1|30 11| 40| 4 36|24 10 25 37 4 12 24 44 46 12 37| |14 28| 21 20|31 10|14 26|13 27| 46 24 39 68 43 33 22| From j-waldby@pat7.com Mon Jul 9 14:17 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA00495 for ; Mon, 9 Jul 2001 14:17:18 -0400 (EDT) Received: from femail1.sdc1.sfba.home.com (femail1.sdc1.sfba.home.com [24.0.95.81]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id OAA22098 for ; Mon, 9 Jul 2001 14:17:19 -0400 (EDT) Received: from pat7.com ([24.7.41.239]) by femail1.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010709181718.LHKV26599.femail1.sdc1.sfba.home.com@pat7.com> for ; Mon, 9 Jul 2001 11:17:18 -0700 Sender: j-waldby@cs.nyu.edu Message-ID: <3B49F50A.369B1B72@pat7.com> Date: Mon, 09 Jul 2001 13:16:42 -0500 From: James Waldby Reply-To: j-waldby@pat7.com Organization: su X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.16-22 i586) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Re: "Dr. Ecco" July 2001 DDJ - some solutions References: <200107091521.LAA16252@shasha.cs.nyu.edu> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 1927 Status: R Dennis Shasha wrote: > > Thanks. > Could you tell me again how many solutions you found and > how you found them? > Dennis Sure (although this isn't "again", since I didn't email about it before) - 1. Number of solutions -- Depends on how long the program runs, and whether we count variations. For example, about 30000 distinct-set-of-lengths* solutions arose when program ran 2 hours (on 450MHz Linux system) and about 85000 after 10 hours. I imagine this is a tiny fraction of the solutions possible. *A given set of lengths possibly may be formed in multiple ways with different pieces of stone. For example, the program found 69240 different ways to make the lengths-combination set of (4.0, 4.0, 4.2, 11.8, 11.8, 12.1). The program reported 1330440470 variants of the first 25000 distinct-lengths sets. 2. How the program works -- Briefly, exhaustive search via for loops nested 12 deep. The even-layer loops select a next-larger length for a back piece; odd-layer loops select (via direct index) an exact-match length for a front piece, if any is available, else break. Available lengths are maintained in ascending order [1] in lists. The back list starts out with 131072 (2^17) entries and the front list starts with 1048576 (2^20), since there are 17 and 20 back and front pieces. Each list entry contains a length and a bit mask. The length is the sum of the piece lengths corresponding to the bits in the mask. Before each for-loop step, the program makes a new copy of the list to strip out pieces that conflict with the cumulative mask of used pieces. [2] [1] Generating pieces in increasing order provides an upper bound on length of (47.9 - 11 - current total)/m for current beam, when m+1 beams are left to find, and also lessens how much of the lists need to be copied. [2] List-trimming is expensive at outer levels, but gets progressively faster at inner levels of fors. From j-waldby@pat7.com Sun Jul 8 19:41 EDT 2001 Five weeks ago I wrote a program that produced millions of solutions for the beams problem, but then I got busy on other things and didn't send them all in. Anyhow, here are a few unusual solutions. If I remember correctly, column 3 = lengths of back parts, and column 4 = lengths of front parts. The line before each solution gives a solution serial number, the number n of different solutions found using those same lengths, a storage error count m, and two hash numbers h. - James Waldby (Two sets of nearly-equal-length-beams) 8193. n 69240 m0 h 127232 138401 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.2 1.4+2.8 4.2 Beam 4. Length 11.8 3.3+3.9+4.6 0.4+2.4+4.4+4.6 Beam 5. Length 11.8 2.0+2.4+3.1+4.3 1.1+3.3+3.7+3.7 Beam 6. Length 12.1 1.0+2.1+2.2+6.8 0.1+0.7+1.0+1.2+1.2+2.4+2.5+3.0 (Two short, two medium, two long lengths) 24993. n 2128 m0 h 84524 199686 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.7 1.4+3.3 0.1+4.6 Beam 4. Length 5.6 1.0+4.6 1.2+4.4 Beam 5. Length 14.5 2.2+2.4+3.1+6.8 0.4+2.5+3.7+3.7+4.2 Beam 6. Length 15.1 2.0+2.1+2.8+3.9+4.3 0.7+1.0+1.1+1.2+2.4+2.4+3.0+3.3 (A pair and a triple of equal lengths - one of four found) 8522. n 396 m0 h 39019 181322 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.3 4.3 0.1+4.2 Beam 4. Length 4.3 1.0+3.3 1.0+3.3 Beam 5. Length 4.3 2.1+2.2 0.7+1.1+2.5 Beam 6. Length 27.0 1.4+2.0+2.4+2.8+3.1+3.9+4.6+6.8 0.4+1.2+1.2+2.4+2.4+3.0+3.7+3.7+4.4+4.6 (Another pair and triple) 48838. n 92 m0 h 66491 438123 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 5.5 2.2+3.3 1.1+4.4 Beam 4. Length 5.5 2.4+3.1 0.1+1.2+4.2 Beam 5. Length 5.5 1.4+2.0+2.1 1.0+1.2+3.3 Beam 6. Length 23.4 1.0+2.8+3.9+4.3+4.6+6.8 0.4+0.7+2.4+2.4+2.5+3.0+3.7+3.7+4.6 (With 5 beams being unbroken pieces - one of 6 such solutions) 4589. n 422 m0 h 69035 247663 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.2 1.4+2.8 4.2 Beam 4. Length 4.4 2.0+2.4 4.4 Beam 5. Length 4.6 4.6 4.6 Beam 6. Length 26.7 1.0+2.1+2.2+3.1+3.3+3.9+4.3+6.8 0.1+0.4+0.7+1.0+1.1+1.2+1.2+2.4+ 2.4+2.5+3.0+3.3+3.7+3.7 From j-waldby@pat7.com Mon Jul 9 14:17 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA00495 for ; Mon, 9 Jul 2001 14:17:18 -0400 (EDT) Received: from femail1.sdc1.sfba.home.com (femail1.sdc1.sfba.home.com [24.0.95.81]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id OAA22098 for ; Mon, 9 Jul 2001 14:17:19 -0400 (EDT) Received: from pat7.com ([24.7.41.239]) by femail1.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010709181718.LHKV26599.femail1.sdc1.sfba.home.com@pat7.com> for ; Mon, 9 Jul 2001 11:17:18 -0700 Sender: j-waldby@cs.nyu.edu Message-ID: <3B49F50A.369B1B72@pat7.com> Date: Mon, 09 Jul 2001 13:16:42 -0500 From: James Waldby Reply-To: j-waldby@pat7.com Organization: su X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.16-22 i586) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Re: "Dr. Ecco" July 2001 DDJ - some solutions References: <200107091521.LAA16252@shasha.cs.nyu.edu> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 1927 Status: R Dennis Shasha wrote: > > Thanks. > Could you tell me again how many solutions you found and > how you found them? > Dennis Sure (although this isn't "again", since I didn't email about it before) - 1. Number of solutions -- Depends on how long the program runs, and whether we count variations. For example, about 30000 distinct-set-of-lengths* solutions arose when program ran 2 hours (on 450MHz Linux system) and about 85000 after 10 hours. I imagine this is a tiny fraction of the solutions possible. *A given set of lengths possibly may be formed in multiple ways with different pieces of stone. For example, the program found 69240 different ways to make the lengths-combination set of (4.0, 4.0, 4.2, 11.8, 11.8, 12.1). The program reported 1330440470 variants of the first 25000 distinct-lengths sets. 2. How the program works -- Briefly, exhaustive search via for loops nested 12 deep. The even-layer loops select a next-larger length for a back piece; odd-layer loops select (via direct index) an exact-match length for a front piece, if any is available, else break. Available lengths are maintained in ascending order [1] in lists. The back list starts out with 131072 (2^17) entries and the front list starts with 1048576 (2^20), since there are 17 and 20 back and front pieces. Each list entry contains a length and a bit mask. The length is the sum of the piece lengths corresponding to the bits in the mask. Before each for-loop step, the program makes a new copy of the list to strip out pieces that conflict with the cumulative mask of used pieces. [2] [1] Generating pieces in increasing order provides an upper bound on length of (47.9 - 11 - current total)/m for current beam, when m+1 beams are left to find, and also lessens how much of the lists need to be copied. [2] List-trimming is expensive at outer levels, but gets progressively faster at inner levels of fors. Reader Solutions to the Police Beats Problem Several clever readers matched Liane's solution when there were three police cars. Most of these went on to show that all 5 cars could follow one another in a circuit over all of the roads so some car would pass each block every 10 minutes. Richard W. Lipp, Tim Chase, Dennis Yelle, Pike Enz, Andrew D. Todd, John A. Trono, Rodney Meyer, Mike Bandy, James H. Puttick, Steve Kempf, Charles Doumar, Tyler Folsom, Craig Ewert, Paul Valckenaers, Matt Cuba, Geoffrey Probert, Jimmy Hu, Mike Ball, Steven M. Gollmer, Robert Murr, Patrick Gaffney, Robert Murr, Mike Wilson, M. Alan Meghrigian, Dennis L. Cumro, Magne Ostlyngen, Robert Huff, Robert H. Morrison, Girts Folkmanis, Robert Bigec, and Rob Holstein. At that point, I challenged many of these readers with the following problem: "Liane," Ecco said, after giving her a few moments to stare at the door, "suppose the mayor had five police cars. Can you arrange it so that the same police car drives down any given street at least once every 10 minutes. So different cars may drive on the same street, but we want each street to have its favorite car and that one drives down the street every 10 minutes. If not, what frequency can you guarantee?" Pike Enz was the first to show that every street could be hit every 13 minutes or less by the same car. Here was his solution: "Identifying vertices by x-y coordinates with the origin in the lower left corner, "1) an 8-minute circuit: (1,4) (0,4) (0,3) (0,2) (1,2) (2,2) (2,3) (2,4) and back to (1,4) "2) an 8-minute circuit: (2,2) (2,1) (1,1) (1,0) (2,0) (2,1) (3,1) (3,2) and back to (2,2) "3) a 9-minute circuit: (3,1) (3,0) (4,0) (4,1) (4,2) (4,3) (3,3) (3,2) (4,2) and back to (3,1) "4) a 12-minute circuit: (1,3) (2,3) (3,3) (3,4) (3,5) (3,6) (3,7) (2,7) (2,6) (1,6) (1,5) (1,4) and back to (1,3) "5) a 13-minute circuit: (2,4) (3,4) (4,4) (4,5) (4,6) (3,6) (2,6) (1,7) (1,6) (0,6) (0,5) (1,5) (2,5) and back to (2,4)." To: jondobbs Subject: i forgot to send you this Notes on the Biodiversity Problem The question was to see which topology of connections among habitats led to the most rapid decrease in biodiversity. The most interesting response came from Mark Murphy who correctly noted the advantage of chains over other connections and who posed the further question of what happens when the ten pairs are divided into two connected components of five. The result was the loss of biodiversity within each group in about 1/3 the time as for all 10. As Murphy points out: "It appears that splitting a population has a dramatic effect on biodiversity." Dramatic and pernicious. The Blood puzzle distracted several intrepid readers from their university research projects. Approaches from statistics, algorithmics, and combinatorial design have been brought to bear on ensuring the purity of the blood supply by Eric Wiseblatt, Michael Goodrich, Andrew D. Todd, Jimmy Hu, Bruce Oddson, Suzanne M. Lea, Magne Ostlyngen, Bruce Oddson, Paul Stockmeyer, Tomas Rokicki, Robert Morrison, Ng Weng Leong, Chris Alonzo, and Greg Smith. The basic setting of the puzzle was that there were 100,000 pints of blood, some of which might have hepatitis. A PCR test that takes a day is available and it can detect even tiny amounts of hepatitis, so drops from many pints may be combined and the hepatitis may still be detected. For the first part of the puzzle in which 1,000 pints are bad, 2,000 good pints may be thrown away, and two days are available. Magne Ostlyngen suggested the best strategy when there are exactly 1,000 bad pints: partition the 100,000 into 5882 groups of 17 and 1 of 6 Do 5883 tests. The worst case is that 999 tests are bad. (1000 bad batches are good, since that means there is exactly one bad in each group, meaning only 15 out of each 17 need be tested on the second day, requiring just 5,000 tests on the second day.) In the case that there are 999 bad batches, the set of potentially bad pints is 999*17=16983 pints. We then partition these into 5661 groups of three and test each group. We throw away all the pints in each bad group. The total number of tests is 5883+5661 = 11,544. Several readers found solutions for two tainted pints that require 34 tests including Patrick R. Schonfeld, Suzanne M. Lea, Magne Ostlyngen, Paul Stockmeyer, and Michael Goodrich. Most of the suggested solutions involved a binary decomposition in which the pints were partitioned into nearly equal groups and tested. Either both groups test positive in which case simple binary search finds each bad pint or the search space is reduced by half. Paul Stockmeyer however suggested a 4-way decomposition for the first test, leading to a 9 day solution. Tomas Rokicki improved this independently to an 8 day solution and further proposed a 41 test solution for two days using a matrix approach. Now consider the puzzle: how can one identify 10 bad pints out of 100,000 in two days? Dennis Yelle suggested the following: ``Arrange the 100,000 samples in a large, nearly square rectangle matrix containing 316 rows by 317 columns. (The 172 extra spaces can be filled with empty containers). On the first day do 633 tests as follows: Do 316 tests where each test uses every sample in one of the 316 rows. Do 317 tests where each test uses every sample in one of the 317 columns. (note that 316*317 > 100,000) The worst case is that 10 of the row tests are positive, and 10 of the column tests are positive. On the second day, do individual tests on any sample that was in a positive row and a positive column. There will be no more than 100 of these tests, for a total of 733 tests. (732 if there are 10 bad pints exactly).'' Surprisingly, combining a binary search and matrix approach yields an even better solution as Ng Weng Leong and Tomas Rokicki showed. Rokicki has the current record at 608 tests. If any number of days are allowed and there are 10 bad pints, then the first optimal solution was suggested by Mike Goodrich: ``The idea is actually quite simple. We form a complete binary tree on top of the id numbers of the pints. Starting at the root, we proceed round-by-round down the tree in a level-by-level fashion to find all the bad pints at the leaves of this tree. At the beginning of each round i we inductively know all the nodes of the tree at level i that have bad descendents; call these nodes `bad'. We then perform a test for the two children of each such bad node, which gives us the induction hypothesis for the next level. We can then continue down the tree until we have found all the bad pints. There is also a slight optimization we can apply in some cases: namely, if at any point during this traversal we have b bad nodes on the current level, then we need only to test left children from then on. The reason for this optimization is that once we have b bad nodes, each one has exactly one bad leaf descendent, so if a left-child badness test is negative, we know that the right child must be bad (without actually testing it). In the worst case, the binary tree method (together with this optimization) will use no more than 264 tests for the 10 bad node case and works in 17 days.'' That would be (by day) (2, 4, 8, 16, 18*13) or 264 tests. Rokicki suggested an improvement: ``This can be improved, though, by simply starting with a larger number of groups at the very top, say, 25, which would give us (25, 18*12) for a max of 241 tests in 13 days max, and this can probably be yet further improved . . . '' Suzanne M. Lea suggested a generalization: ``Assume we have b bad pints in N samples. We test by dividing the pints into k groups during each iteration and testing all the pints belonging to each group. If on any iteration we have b groups bad, then each group can have at most 1 bad pint (which can then be found using binary search). The worst case is when b-1 groups are bad each time. She analyzes this solution." Michael Goodrich combined the binary tree and matrix approach to solve the problem of 10 bad pints in three days using only 400 tests. For example, partition the pints into sets of 1,000 in the first day. At most ten of these sets will be bad, leaving 10,000 pints to be tested. A square matrix of 100 by 100 can then be used to analyze these as in Dennis Yelle's approach. From jimmy@ghs.com Thu Jun 22 20:36 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id UAA12520 for ; Thu, 22 Jun 2000 20:36:17 -0400 (EDT) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id UAA29039 for ; Thu, 22 Jun 2000 20:36:18 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id UAA20131 for ; Thu, 22 Jun 2000 20:36:16 -0400 (EDT) Received: from eta.ghs.com (root@eta.ghs.com [208.8.104.2]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id UAA20240 for ; Thu, 22 Jun 2000 20:36:13 -0400 (EDT) Received: [from blaze.ghs.com (blaze.ghs.com [192.67.158.233]) by eta.ghs.com (eta-antispam 0.2) with ESMTP id RAA16639 for ; Thu, 22 Jun 2000 17:35:38 -0700 (PDT)] Received: from ORCA (orca.ghs.com [192.168.101.197]) by blaze.ghs.com (8.9.3/8.9.3) with SMTP id RAA21577 for ; Thu, 22 Jun 2000 17:35:36 -0700 (PDT) Message-ID: <06dc01bfdcaa$9a2e4d60$c565a8c0@ORCA> From: "Jimmy Hu" To: Subject: Blood Date: Thu, 22 Jun 2000 17:33:07 -0700 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Content-Type: text/plain; charset="iso-8859-1" Content-Length: 2232 Status: R I just read the solutions to the Blood puzzle in the July issue. For the case where you are trying to find 10 (or fewer) bad pints out of 100000 in any number of days, you listed several reader's suggestions that took: 264, 241, and 400 tests. Some of these solutions were quite complex. But I'm not sure I understand why you listed these more complicated solutions when a simple repeated binary search can do it in 170 tests? So, the simple solution that beat all of the listed solutions is this: 1) Search for a single bad pint of blood using a binary search. It doesn't matter if a positive test could mean many bad pints mixed together. The object is to isolate out 1 bad pint. You always only test one child (the left child for instance). If the parent has bad blood, and the left child tests out to have good blood, that implies that the right child has bad blood. This should take 17 tests. 2) Once you've found a bad pint, remove it from consideration. 3) Start again at step #1, using 99999 pints (all but the ones you removed from consideration). This takes 170 tests in 170 days. I listed several optimizations to this in my original email, and basically I think I got it down to 157 tests, using 27 days. So I was surprised to see solutions listed for 264 and 241 tests, when I thought it was quite apparent that 170 was easy to achieve! I was expecting to see many clever solutions which were in the 145-170 range. Is there a flaw in my reasoning? The other readers made the incorrect assumption that "the worst case is when b-1 groups are bad each time". Taking Mike Goodrich's binary tree example, for instance, it stated that the worst case would take 2+4+8+16+18*13 tests. He had to test both children of the 9 bad batches for 13 rounds. But suppose once he narrowed it down to 9 bad batches, he simply tested the left child of each (as if there were only 9 total bad pints). In the end, he would find 9 bad pints, and use only 2+4+8+16+9*13 = 147 tests. To find the tenth bad pint (if it exists), he could simply start a new binary search, with the bad pints removed from consideration, and find the last pint in 17 more tests, for a total of 164 tests (in this case). Jimmy Hu jimmy@ghs.com From e.pau@tct.com.hk Sat Jun 24 02:47 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id CAA23309 for ; Sat, 24 Jun 2000 02:47:58 -0400 (EDT) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id CAA25125 for ; Sat, 24 Jun 2000 02:47:56 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id CAA13457 for ; Sat, 24 Jun 2000 02:47:50 -0400 (EDT) Received: from ibridge.iohk.com (root@ibridge.iohk.com [202.21.128.82]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id CAA24110 for ; Sat, 24 Jun 2000 02:47:46 -0400 (EDT) Received: from igate.iohk.com (IDENT:root@igate.iohk.com [202.21.128.81]) by ibridge.iohk.com (8.9.3/8.9.3) with ESMTP id OAA15974 for ; Sat, 24 Jun 2000 14:47:41 +0800 (HKT) Received: from sales (pm3p212.iohk.com [202.21.128.212]) by igate.iohk.com (8.9.3/8.9.3) with SMTP id OAA01541 for ; Sat, 24 Jun 2000 14:47:35 +0800 (HKT) Reply-To: From: "Elijah Pau" To: Subject: More Blood, less tests.... Date: Sat, 24 Jun 2000 14:50:31 +0800 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Content-Type: text/plain; charset="Windows-1252" Content-Length: 4494 Status: R Dear Dr. Ecco I have read your Reader Notes in the July issue and find the puzzle very interesting. After some hard but work, I have come up with the following results: 1. For the two bad pints problem, I discovered that at most 170 tests (and possibly less than 70 tests) are sufficient to identify the bad pints in ONE day. 2. For the 10 bad pints problem, a. If 3 days are allowed, or if only 2 days are allowed, but 3 pints of good blood are also allowed to be thrown away, then at most 302 tests are sufficient. b. If only 2 days are allowed and no good blood should be thrown away, then less than 383 tests (definitely can be improved) are needed. 1. To find the two bad pints in ONE day, we shall do two sets of tests. First we nubmer the pints in binary system, starting from (0 0000 0000 0000 0000). The first set consists of 34 tests, where each test uses samples where the n-th bit are equal. The second set consists of (17 X 16 / 2) tests (i.e. 17C2 tests) where each test uses samples where the i-th and j-th bits both equal to 0, where 1 >= i > j >= 17. The first set of tests is to determine which bits of the two bad sample differs. If it is found that both the i-th bit and the j-th bit differ, then the corresponding test in the second set will decide if how the values in the i-th bit and the j-th bit match. There is probably a way to idntify the two bad pints in less tests: Instead of doing the second set of tests as described above, do a set of test similar to the first set, using base 3 instead of base 2 (binary) system. The tests needed will be 34 + 33 = 67. However, I haven't thoroughly check this out, (seems very tideous...) so I may be wrong. I'm also toying with an approach that uses systems that use different bases on different digits, which I have found while trying to beat the current record (41). Using a modified base 4 system, where the last two digits are extended to allow for 5 values instead of 4, I am able to device a scheme that required 4+4+4+4+4+4+5+5 = 34 tests on the first day and at most 7 tests on the second day. Probably an equivalent scheme... 2. For the 10 bad pints case, we shall label the pints by a triplet (d1, d2, d3) where 0 <= d1 < 40, 0 <= d2, d3, < 50. On the first day, do 3 sets of tests (40 + 50 + 50) for each digit, each test uses samples where the n-th digit are equal. Call these sets set 1, 2, and 3. If there is a set(digit) in which 10 tests are positive, then we have 10 batches of at most 2500 pints, each, containing exacttly one bad pint. Hence we only need 10 * 12 tests to identify the bad pints on the second day. Tests needed: 140 + 120 = 260. Days required: 2 Suppose none of the set gives 10 positive tests, and the three sets on the first day returns P(set 1), Q(set 2), and R(set 3) positive results respectively. Set 4 consists of tests that correspond to the pairing (P*Q) of the postive digits from set 1 and set 2. The test corresponds to the pairing (A, B) uses samples where first digit equal to A and second digit equal to B, where A, B are positive results in set 1 and set 2 respectively. Set 5 is similar to set 4, using set 1 and set 3. Set 6 ditto, using set 2 and set 3. Suppose A is a positive result of set 1. If there is only one bad pint with A as first digit, then there can only be 1 positive result in set 4 and set 5 with A as the first digit. Hence that particular bad pint can be identified. If more than one pints has A as first digit, these can be identified using results from set 6. Hence every bad pint can now be identified. The worst case seems to be P=Q=R=9, which would need 140 + 81 + 81 + 81 = 383 tests and 2 days. (However, there is obvious room for improvement: not all the tests in set 6 are needed.) Furthermore, when P, Q, R <= 7, we would need no more than 140 + 49 + 49 + 49 = 287 test in two days. For the remaining cases, we can do set 4 and set 5 only on the second day. If max(P,Q,R) = 9, then we need at most 81 + 81 on the second day, and on final test on the third day to find one bad pint form a lot of 2 pints, giving a result of 303 test for 3 days. (If max(P,Q,R) = 8, we need 64 + 64 tests on the second day and 2 or 4(3!) test on the third day, finding either 3 bad pints from one lot 6, or 1 bad pint each from two lots of 2 pint each.) :-) Best regards, Elijah Pau === Elijah Pau === Total Control Technology Limited === === e.pau@tct.com.hk === Tel: (+852) 2857 1311 === Fax: (+852) 2540 6197 The extremely clever reader solutions to the Calabaza problems that I discuss below contrasted brilliantly with the bug in my solutions last month. First, my bug: the third question asked about the situation in which one hole drained in n minutes and two holes in m minutes where m is the integer below half of n. The question asked whether any n would be troublesome in that situation where troublesome means that there would be no way to mark minutes. As pointed out first by Pearl Pauling and then later by the other readers mentioned below having correct solutions, no solution is possible if n and m are both even. That is not the case for n = 20, for example, but it is true for n = 22 and n = 18. Please don't tell Dr. Ecco. Otherwise, several readers found solutions that were similar to Dr. Ecco's: Greg Smith, Pearl Pauling, Robert H. Morrison, Yves Piguet, Steve Kietzman, Jonathan Parker, Richard W. Lipp, Rodney Meyer, Patrick R. Schonfeld, Rollin Crittendon, Chad Harrington, Alan E. Dragoo, David Stevenson, and Marty Pinaud. And then there were the unconventional solutions that involved changing the number of open holes in mid-stream, if you'll excuse the pun. Philip Staite proposed the first one (imagining that the holes are filled with corks): ``Consider 5 Calabazas, A through E. Here is the basis for generating a Calabaza emptying event every minute between 15 and 19 minutes inclusive. Once you have these, it is a simple matter to refill and pull both corks from the Calabazas and repeat each on a 5 minute interval. ``Calabaza A. T0 pull both corks (i.e., pull both corks at time 0). T5 empties (i.e., calabaza A empties at time 5). T5 refill and pull both corks, repeat every 5 min. ``Calabaza B. T0 pull one cork. T11 empties. T11 refill and pull both corks, repeat every 5 min. ``Calabaza C. T0 pull one cork. T5 replace cork. T11 pull one cork. T17 empties. T17 refill and pull both corks, repeat every 5 min. ``Calabaza D. T11 pull both corks. T15 replace both corks. T17 pull both corks. T18 empties. T18 refill and pull both corks, repeat every 5 min. ``Calabaza E. T10 pull both corks. T11 replace both corks. T15 pull both corks. T19 empties. T19 refill and pull both corks, repeat every 5 min.'' Jimmy Hu and later Scott J. Taylor proposed the following even quicker and more economical solution (I'm quoting here from Jimmy): ``Fill 2 gourds. Open one hole in gourd A and two holes in gourd B. At 5 minutes, gourd B will drain, so refill it. At 10 minutes, gourd B will drain again so quickly plug the holes and put it under gourd A so that gourd A (which has 1 minute left of water) will be draining INTO gourd B. So now you can time every minute by letting the gourds drain into each other and switching them every minute. That is to say, at 11 minutes, when gourd A drains, plug its holes and put it under gourd B and then open 1 hole in gourd B.'' As Alan Dragoo points out, this solution requires that the two gourds have the same water flow per second with one hole open and the same water flow per second with two holes open. (That is stronger than saying that they will drain at the same rate, do you see why?) Ralph Fellows showed how to match the time of this solution but without this stronger assumption. His solution required five calabazas however. Reader Solutions to the Causality Problem The clever readers of DDJ have shown their ability to figuring out biological circuits. The following readers solved the puzzle (or major parts of it): Warren Dougherty, Paolo Friedli, Bob Morrison, David E. Siegel, Dennis Yelle, Jesper Lauridsen, Andrew Palfreyman, Manor Askenazi, Jimmy Hu, Matt Lasley, Robert Jamison, and Rodney P. Meyer. Some used Prolog (a good choice for this problem). Others used a brute force. And some used paper and pencil. Rodney Meyer was the first to show the 18 solutions to the first puzzle and the 140 solutions to the cyclic second puzzle. Protein Permutation 1 ab gb bc ad hd ae be hf ag bh Protein Permutation 2 ab gb bc ad bd hd ae be hf ag bh Protein Permutation 3 ab gb bc gd hd ae be hf ag bh Protein Permutation 4 ab gb bc ad gd hd ae be hf ag bh Protein Permutation 5 ab gb bc bd gd hd ae be hf ag bh Protein Permutation 6 ab gb bc ad bd gd hd ae be hf ag bh Protein Permutation 7 ab gb bc ad hd be ge hf ag bh Protein Permutation 8 ab gb bc ad hd ae be ge hf ag bh Protein Permutation 9 ab gb bc ad bd hd be ge hf ag bh Protein Permutation 10 ab gb bc ad bd hd ae be ge hf ag bh Protein Permutation 11 ab gb bc gd hd be ge hf ag bh Protein Permutation 12 ab gb bc ad gd hd be ge hf ag bh Protein Permutation 13 ab gb bc gd hd ae be ge hf ag bh Protein Permutation 14 ab gb bc ad gd hd ae be ge hf ag bh Protein Permutation 15 ab gb bc bd gd hd be ge hf ag bh Protein Permutation 16 ab gb bc ad bd gd hd be ge hf ag bh Protein Permutation 17 ab gb bc bd gd hd ae be ge hf ag bh Protein Permutation 18 ab gb bc ad bd gd hd ae be ge hf ag bh ------_=_NextPart_000_01C05BAC.73C3E276 Content-Type: text/plain; name="cancer.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cancer.txt" Cancer Permutation 1=20 la lb ec ic hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 2=20 la lb ec ic hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 3=20 la lb hc ic hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 4=20 la lb ec hc ic hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 5=20 la lb hc ic hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 6=20 la lb ec hc ic hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 7=20 la lb ec ic jc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 8=20 la lb ec ic jc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 9=20 la lb hc ic jc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 10=20 la lb ec hc ic jc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 11=20 la lb hc ic jc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 12=20 la lb ec hc ic jc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 13=20 la lb ic kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 14=20 la lb ec ic kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 15=20 la lb ic kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 16=20 la lb ec ic kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 17=20 la lb hc ic kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 18=20 la lb ec hc ic kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 19=20 la lb hc ic kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 20=20 la lb ec hc ic kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 21=20 la lb ic jc kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 22=20 la lb ec ic jc kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 23=20 la lb ic jc kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 24=20 la lb ec ic jc kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 25=20 la lb hc ic jc kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 26=20 la lb ec hc ic jc kc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 27=20 la lb hc ic jc kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 28=20 la lb ec hc ic jc kc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 29=20 la lb ec ic hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 30=20 la lb ec ic hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 31=20 la lb ec ic hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 32=20 la lb hc ic hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 33=20 la lb ec hc ic hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 34=20 la lb hc ic hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 35=20 la lb ec hc ic hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 36=20 la lb hc ic hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 37=20 la lb ec hc ic hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 38=20 la lb ec ic jc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 39=20 la lb ec ic jc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 40=20 la lb ec ic jc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 41=20 la lb hc ic jc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 42=20 la lb ec hc ic jc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 43=20 la lb hc ic jc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 44=20 la lb ec hc ic jc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 45=20 la lb hc ic jc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 46=20 la lb ec hc ic jc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 47=20 la lb ic kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 48=20 la lb ec ic kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 49=20 la lb ic kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 50=20 la lb ec ic kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 51=20 la lb ic kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 52=20 la lb ec ic kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 53=20 la lb hc ic kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 54=20 la lb ec hc ic kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 55=20 la lb hc ic kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 56=20 la lb ec hc ic kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 57=20 la lb hc ic kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 58=20 la lb ec hc ic kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 59=20 la lb ic jc kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 60=20 la lb ec ic jc kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 61=20 la lb ic jc kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 62=20 la lb ec ic jc kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 63=20 la lb ic jc kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 64=20 la lb ec ic jc kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 65=20 la lb hc ic jc kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 66=20 la lb ec hc ic jc kc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 67=20 la lb hc ic jc kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 68=20 la lb ec hc ic jc kc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 69=20 la lb hc ic jc kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 70=20 la lb ec hc ic jc kc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 71=20 la lb ec ic lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 72=20 la lb ec ic lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 73=20 la lb hc ic lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 74=20 la lb ec hc ic lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 75=20 la lb hc ic lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 76=20 la lb ec hc ic lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 77=20 la lb ec ic jc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 78=20 la lb ec ic jc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 79=20 la lb hc ic jc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 80=20 la lb ec hc ic jc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 81=20 la lb hc ic jc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 82=20 la lb ec hc ic jc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 83=20 la lb ic kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 84=20 la lb ec ic kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 85=20 la lb ic kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 86=20 la lb ec ic kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 87=20 la lb hc ic kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 88=20 la lb ec hc ic kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 89=20 la lb hc ic kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 90=20 la lb ec hc ic kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 91=20 la lb ic jc kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 92=20 la lb ec ic jc kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 93=20 la lb ic jc kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 94=20 la lb ec ic jc kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 95=20 la lb hc ic jc kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 96=20 la lb ec hc ic jc kc lc hd ke gf lg eh jh li hk jk jl=20 Cancer Permutation 97=20 la lb hc ic jc kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 98=20 la lb ec hc ic jc kc lc hd ke gf lg eh jh li ek hk jk jl=20 Cancer Permutation 99=20 la lb ec ic lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 100=20 la lb ec ic lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 101=20 la lb ec ic lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 102=20 la lb hc ic lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 103=20 la lb ec hc ic lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 104=20 la lb hc ic lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 105=20 la lb ec hc ic lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 106=20 la lb hc ic lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 107=20 la lb ec hc ic lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 108=20 la lb ec ic jc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 109=20 la lb ec ic jc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 110=20 la lb ec ic jc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 111=20 la lb hc ic jc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 112=20 la lb ec hc ic jc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 113=20 la lb hc ic jc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 114=20 la lb ec hc ic jc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 115=20 la lb hc ic jc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 116=20 la lb ec hc ic jc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 117=20 la lb ic kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 118=20 la lb ec ic kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 119=20 la lb ic kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 120=20 la lb ec ic kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 121=20 la lb ic kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 122=20 la lb ec ic kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 123=20 la lb hc ic kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 124=20 la lb ec hc ic kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 125=20 la lb hc ic kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 126=20 la lb ec hc ic kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 127=20 la lb hc ic kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 128=20 la lb ec hc ic kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 129=20 la lb ic jc kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 130=20 la lb ec ic jc kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 131=20 la lb ic jc kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 132=20 la lb ec ic jc kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 133=20 la lb ic jc kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 134=20 la lb ec ic jc kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 135=20 la lb hc ic jc kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 136=20 la lb ec hc ic jc kc lc hd ke gf lg eh jh kh li hk jk jl=20 Cancer Permutation 137=20 la lb hc ic jc kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 138=20 la lb ec hc ic jc kc lc hd ke gf lg jh kh li ek hk jk jl=20 Cancer Permutation 139=20 la lb hc ic jc kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 Cancer Permutation 140=20 la lb ec hc ic jc kc lc hd ke gf lg eh jh kh li ek hk jk jl=20 From rwh999@hotmail.com Fri Feb 9 18:48 EST 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id SAA25169 for ; Fri, 9 Feb 2001 18:48:38 -0500 (EST) Received: from hotmail.com (f117.law10.hotmail.com [64.4.15.117]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id SAA18994 for ; Fri, 9 Feb 2001 18:48:37 -0500 (EST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 9 Feb 2001 15:48:07 -0800 Received: from 164.67.44.50 by lw10fd.law10.hotmail.msn.com with HTTP; Fri, 09 Feb 2001 23:48:06 GMT X-Originating-IP: [164.67.44.50] From: "Robert Huff" To: shasha@cs.nyu.edu Subject: Solutions for Protein-Circuit problem in December 2000 DDJ column Date: Fri, 09 Feb 2001 15:48:06 -0800 Mime-Version: 1.0 Message-ID: X-OriginalArrivalTime: 09 Feb 2001 23:48:07.0017 (UTC) FILETIME=[C02B2D90:01C092F2] Content-Type: multipart/mixed; boundary="----=_NextPart_000_56aa_82f_57c4" Content-Length: 2189 Status: R This is a multi-part message in MIME format. ------=_NextPart_000_56aa_82f_57c4 Content-Type: text/plain; format=flowed Dennis, Found 18 solutions to 8-protein circuit, with 10 to 13 causality links, plus 294 solutions to 10(sic)-protein circuit, with 13 to 19 links, with all 294 being cyclic. Solutions given in attached half-page text file. Robert W. Huff _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ------=_NextPart_000_56aa_82f_57c4 Content-Type: text/plain; name="sha0dec0.elt"; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="sha0dec0.elt" DATE: Thu 08 Feb 2001, Third Millennium, First Year FROM: Robert W.Huff via rwh999@hotmail.com TO: shasha@cs.nyu.edu SUBJECT: Solutions for Protein-Circuit problem in Dec 2000 DDJ column Dear Dennis: Finally got to the December issue of DDJ this evening, and spent a few hours solving the Protein-Circuit problem, before looking at the January 2001 column. I found 18 solutions for the 8-protein case, and 294 for the 10(sic)-protein case. These include both of your text solutions, as well as your Figure-6 solution (which differs from your text solution by lacking edge HC, & one could also drop JH or JK to obtain a solution with a minimum of 13 edges). Re Figure 5: no comment. My solutions for the 8-protein case all require the 8 directed edges: AG, AB, GB, BC, BE, BH, HD, HF. Plus (AG or DG or both) [ 3 options ]; plus (AE or GE or both) [ 3 options ]; plus (BD or not) [ 2 options ]; for a total of 3x3x2=18 solutions, for 10 to 13 directed edges. My solutions for the 12-protein case all require the 9 directed edges: JL, LA, LB, LG, GF, LI, IC, HD, KE. Plus (JC or not) [ 2 options ]; plus (JH or JK or both) [ 3 options ]; plus (one or more of EC, EH, EK) [ 7 options ]; plus { (EH, HK, w or w/o KH) or (EK, KH, w or w/o HK) or (EH, EK, and (HK or KH or both) ) } [ 7 options ]; for a total of 2x3x7x7=294 solutions, for 13 to 19 directed edges. All are cyclic! Again, your column has been a pleasure, Sincerely, Robert W. Huff ------=_NextPart_000_56aa_82f_57c4-- Reader Solutions to the Centimillionaires Problem Several readers objected to my use of the prefix "centi" to mean hundreds as opposed to hundredths. The correct prefix is "hecto". Readers who discovered this bug include: Rich Mickelsen, Michael McCormick, Jan Vanderbrugge,n Lloyd Rice, Chad Harrington, Peter Hornby, and Dale R. Sinclair. I appreciate the correction and note its consistency with words like hectare and centimeter, though I wonder what they think of words like centipede, century, or centennial? As for alternatives to Liane's solution, Oleg Kiselyov suggests a "weird cross-over between RSA and Diffie-Hellman key exchange" that requires only 58 messages and can be done over a broadcast medium without loss of security." It works by having C1 send information to C2, C2 to C3 up to C20, then C20 sends information to C1 and C1 starts anew. At the end, C20 broadcasts the answer. For details, look at http://pobox.com/~oleg/ftp/secure-count.html. Jason Strickland suggested a cryptography-free protocol: "In the annual meeting letter that goes out to the Centimillionaires direct them to disable caller ID and call a certain phone # and say how many centimillions they have. The phone could be a 3rd party (to alleviate voice recognition concerns). Or, they could simply enter their wealth by pressing the value in centimillions on the Telephone pad (1-100) (followed by # or whatever). Which could be decoded by modem, etc." My worry was the disabling assumption, but this too was very clever and required just 20 phone calls. From jimmy@ghs.com Wed May 24 21:11 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id VAA11049 for ; Wed, 24 May 2000 21:11:37 -0400 (EDT) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id VAA05518 for ; Wed, 24 May 2000 21:11:35 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id VAA18148 for ; Wed, 24 May 2000 21:11:33 -0400 (EDT) Received: from eta.ghs.com (root@eta.ghs.com [208.8.104.2]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id VAA22142 for ; Wed, 24 May 2000 21:11:23 -0400 (EDT) Received: [from blaze.ghs.com (blaze.ghs.com [192.67.158.233]) by eta.ghs.com (eta-antispam 0.2) with ESMTP id SAA10165 for ; Wed, 24 May 2000 18:10:46 -0700 (PDT)] Received: from orca (orca.ghs.com [192.67.158.38]) by blaze.ghs.com (8.9.3/8.9.3) with SMTP id SAA12910 for ; Wed, 24 May 2000 18:10:40 -0700 (PDT) Message-ID: <002a01bfc5e6$53eaa5e0$269e43c0@orca.ghs.com> From: "Jimmy Hu" To: Subject: Centimillionaire Date: Wed, 24 May 2000 18:12:38 -0700 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Content-Type: text/plain; charset="iso-8859-1" Content-Length: 3197 Status: R I realize that next month's column is already out, but I just got around to reading the May issue, and I wanted to give you my solution! I have an idea for Centimillionaire which requires only 19 phone calls, but only works under the premise that there is no Caller ID feature on the phones. Here is the plan: One person is appointed as the person in charge of gathering information. Let's just say the person who name is first alphabetically (person "A"). Everyone calls person "A", and when they do, person "A" picks up the phone and listens. Each caller will press "1" on their phone once for each centimillion they own. So they may press the "1" button from 1-100 times (OK to be more efficient we could use morse code or something, but this is simpler to understand). Note that person "A" does not know who is calling since there is no Caller ID (or another way is for each person to call from the same payphone) and since no voices are used. At the end, person "A" will have the list of all the net worths of each centimillionaire (and person "A" will add their own value to the list, of course). --------- Here is a variant on this idea which even protects some of the values from being discovered, while still using 19 phone calls. It is basically the same thing as before, except when each person calls "A", "A" will ask: "Do you have more than or equal to X (where X is the maximum amount discovered so far)? If so press 1 otherwise press 2." "Do you have less than or equal to Y (where Y is the minimum amount discovered so far)? If so press 1 otherwise press 2." If the answer is yes to either question, proceed as before to discover the amount. If the answer is no to both of the questions, the exact amount for that centimillionaire is never revealed. --------- There is a way to find out exactly the largest and smallest values without knowing any exact intermediate values. It involves more than 19 calls, though. Basically, person "A" makes several rounds of calls asking questions like "Do you make more than 50, press 1 or 2. (Hears person press 1). OK you are in the max category. Call me back tomorrow for the next round." Next day: "Are you in the max category? (yes) Do you make more than 75, press 1 or 2. OK you are still in the max category, call back tomorrow." Through a series of rounds and binary searching, person "A" can figure out the largest and smallest amounts without exactly knowing any other amounts (although knowing the approximate range of some of them). People will be asked to stop calling once they are known to not be the min or max. I think that this will take around 19 * 7 calls in the worst case (you can save a call here and there by keeping the last person in a round on the line and starting the next round with them). These solutions work because of the anonymity of the phone calls. If you always know exactly who is calling, I don't think you can get a better solution than the one you gave, because if a person talks to less than all 19 other people, then it only takes all the people they talk to (less than 19) in order to collude and figure out all the information provided by that person. Jimmy Hu jimmy@ghs.com From jimmy@ghs.com Wed May 24 21:57 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id VAA11181 for ; Wed, 24 May 2000 21:57:18 -0400 (EDT) Received: from eta.ghs.com (root@eta.ghs.com [208.8.104.2]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id VAA06224 for ; Wed, 24 May 2000 21:57:15 -0400 (EDT) Received: [from blaze.ghs.com (blaze.ghs.com [192.67.158.233]) by eta.ghs.com (eta-antispam 0.2) with ESMTP id SAA10462 for ; Wed, 24 May 2000 18:57:08 -0700 (PDT)] Received: from orca (orca.ghs.com [192.67.158.38]) by blaze.ghs.com (8.9.3/8.9.3) with SMTP id SAA05781 for ; Wed, 24 May 2000 18:57:06 -0700 (PDT) Message-ID: <002f01bfc5ec$cdbf8e20$269e43c0@orca.ghs.com> From: "Jimmy Hu" To: "Dennis Shasha" Subject: Re: Centimillionaire Date: Wed, 24 May 2000 18:59:04 -0700 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Content-Type: text/plain; charset="iso-8859-1" Content-Length: 610 Status: R >My worry was the disabling assumption, but this too was very clever >and required just 20 phone calls. Since these guys are so rich, they can fly to a random foreign country on their private jet and make the phone call from a payphone there. I'm now working on the Microvirus problem. I think the first solution is: T TCCATC TC TA GA GTCCGTC TC TCACACGGC TCGCACACGGA GATA GC TC I'm a little confused by the harder problem though. One of the pieces listed is "TT". But shouldn't r3 cut at TT? So, should that TT piece be broken up into two T pieces? If so, how does that affect the numberings? Jimmy From chris.hunter_new.uk@excite.co.uk Tue Jul 18 08:23 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id IAA05617 for ; Tue, 18 Jul 2000 08:23:15 -0400 (EDT) From: chris.hunter_new.uk@excite.co.uk Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id IAA00710 for ; Tue, 18 Jul 2000 08:23:13 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id IAA06263 for ; Tue, 18 Jul 2000 08:23:12 -0400 (EDT) Received: from kuku.excite.com (kuku-rwcmta.excite.com [198.3.99.63]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id IAA09202 for ; Tue, 18 Jul 2000 08:23:10 -0400 (EDT) Received: from spike.excite.com ([199.172.152.97]) by kuku.excite.com (InterMail vM.4.01.02.39 201-229-119-122) with ESMTP id <20000718122239.DXNN17120.kuku.excite.com@spike.excite.com> for ; Tue, 18 Jul 2000 05:22:39 -0700 Message-ID: <7579054.963922959810.JavaMail.imail@spike.excite.com> Date: Tue, 18 Jul 2000 05:22:39 -0700 (PDT) To: drEcco@ddj.com Subject: Cent and Hect Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Excite UK Inbox X-Sender-Ip: 212.2.12.97 Content-Type: text/plain; charset=us-ascii Content-Length: 693 Status: R Dear Dennis, I think the difference between the use of centi and hecto is that centi implies "made up from a hundered things" where as hecto means "one hundred". Therefore a century is a unit made up of hundred years, a centipede is made up of a hundred legs and (less directly) a centimetre is a unit of which one hundred make a metre. Therefore a centi-million would be a fractional million, 100 of which would make up a million, but a hecto-million would would be 100 million. Thanks for a most enjoyable column Ragards Chris Hunter _______________________________________________________ Get 100% private, FREE email for life from Excite UK Visit http://inbox.excite.co.uk/ Reader Solutions to the Chimps Problem Shipping animals can inspire a career change into publishing, it seems. This magazine's editor-in-chief Jon Erickson once had to ship 100 deer from Canada to Korea, "At the time, I worked at various zoos and game farms both in the U.S. and Canada. Once I had to send about 100 Japanese Sika Deer from Canada to Korea. I had individual crates built for each of them, then (and this was the hard part) put a deer in each crate." No small feat, I'm sure. The following readers solved the first two parts of the Chimps problem (i.e. in which each chimp will share a wall with all the chimps it loves but will share neither wall nor corner nor column with a chimp it hates): Steve Kietzman, Larry Lewis, Mark Taylor, Dennis Cumro, Patrick Schonfeld, Rodney Meyer, and James Heginbottom Larry Lewis found 16 different (but more or less symmetrical) solutions to the problem after making his Pentium work for 12 hours. Mark Taylor agreed with this and showed that they are symmetric variations of one another based on reflections and rotations. He also showed that the third problem: "chimps who hate each other shouldn't be on the same level" cannot be solved. Patrick Schonfeld showed that the minimum number of conflicting pairs in such a situation is 24, while still solving the first two problems. From RMorrison@hitex.de Tue Sep 12 03:27 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id DAA03668 for ; Tue, 12 Sep 2000 03:27:27 -0400 (EDT) From: RMorrison@hitex.de Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id DAA08923 for ; Tue, 12 Sep 2000 03:27:27 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id DAA17895 for ; Tue, 12 Sep 2000 03:27:25 -0400 (EDT) Received: from mail.hitex.de (router.hitex.de [195.63.144.250] (may be forged)) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id DAA22299 for ; Tue, 12 Sep 2000 03:27:23 -0400 (EDT) Received: from exchka02.hitex.de (exchka02.hitex.de [62.144.223.7]) by mail.hitex.de (8.8.8/8.8.8) with ESMTP id JAA07103; Tue, 12 Sep 2000 09:19:48 +0200 Received: by exchka02.hitex.de with Internet Mail Service (5.0.1460.8) id ; Tue, 12 Sep 2000 09:34:41 +0200 Message-ID: <8424687A56C8D3118D0B0090273A82AA444ABD@exchka02.hitex.de> To: DrEcco@ddj.com Cc: rhmorrison@bigfoot.com Subject: Solution to your September DDJ Dr. Ecco column - CHIMPS Date: Tue, 12 Sep 2000 09:34:41 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain; charset="iso-8859-1" Content-Length: 31264 Status: R Dear Dennis, Just got back from vacation in Orlando and Ft. Lauderdale and finally got around to solving the problem. You in fact have posted the ONLY solution if you eliminate symetrical solutions. Here is my solution: If we take the data provided and do some analysis and proper grouping we come up with the following information: #===============================================================# Chimpanzee Loves # Hates # ---------- ------- ------- Annie 1 10 Aristotle 1 4 Augustine 2 8 Caesar 2 7 Carlie 1 9 Cecily 1 4 Chimpie 2 5 Coco 1 9 Cordelia 1 9 Darwin 2 6 Didi 1 11 Emily 1 12 Goodall 1 5 Humboldt 1 6 Jonathan 2 0 Julia 1 9 Katie 1 12 Lea 1 9 Marie 1 9 Miles 0 6 Millie 1 7 Napoleon 1 9 Natasha 0 8 Sarah 0 8 Theo 2 6 Victoria 0 8 Zoe 2 6 #===============================================================# Annie LOVES: Darwin Annie HATES: Aristotle Cecily Coco Emily Humboldt Julia Katie Marie Miles Victoria Aristotle LOVES: Lea Aristotle HATES: Annie Augustine Chimpie Marie Augustine LOVES: Didi Katie Augustine HATES: Aristotle Coco Cordelia Emily Napoleon Sarah Theo Zoe Caesar LOVES: Cordelia Julia Caesar HATES: Chimpie Emily Lea Marie Napoleon Natasha Sarah Carlie LOVES: Jonathan Carlie HATES: Chimpie Coco Emily Goodall Julia Katie Marie Millie Victoria Cecily LOVES: Chimpie Cecily HATES: Annie Emily Katie Theo Chimpie LOVES: Cecily Marie Chimpie HATES: Aristotle Caesar Carlie Cordelia Katie Coco LOVES: Theo Coco HATES: Annie Augustine Carlie Cordelia Didi Katie Lea Natasha Sarah Cordelia LOVES: Caesar Cordelia HATES: Augustine Chimpie Coco Julia Katie Lea Miles Millie Natasha Darwin LOVES: Annie Millie Darwin HATES: Emily Humboldt Miles Napoleon Sarah Victoria Didi LOVES: Augustine Didi HATES: Coco Emily Goodall Humboldt Katie Millie Napoleon Sarah Theo Victoria Zoe Emily LOVES: Napoleon Emily HATES: Annie Augustine Caesar Carlie Cecily Darwin Didi Julia Katie Lea Marie Natasha Goodall LOVES: Jonathan Goodall HATES: Carlie Didi Lea Sarah Zoe Humboldt LOVES: Zoe Humboldt HATES: Annie Darwin Didi Katie Marie Natasha Jonathan LOVES: Carlie Goodall Julia LOVES: Caesar Julia HATES: Annie Carlie Cordelia Emily Miles Napoleon Natasha Sarah Victoria Katie LOVES: Augustine Katie HATES: Annie Carlie Cecily Chimpie Coco Cordelia Didi Emily Humboldt Miles Theo Victoria Lea LOVES: Aristotle Lea HATES: Caesar Coco Cordelia Emily Goodall Marie Millie Napoleon Theo Marie LOVES: Chimpie Marie HATES: Annie Aristotle Caesar Carlie Emily Humboldt Lea Napoleon Theo Miles HATES: Annie Cordelia Darwin Julia Katie Millie Millie LOVES: Darwin Millie HATES: Carlie Cordelia Didi Lea Miles Napoleon Zoe Napoleon LOVES: Emily Napoleon HATES: Augustine Caesar Darwin Didi Julia Lea Marie Millie Natasha Natasha HATES: Caesar Coco Cordelia Emily Humboldt Julia Napoleon Zoe Sarah HATES: Augustine Caesar Coco Darwin Didi Goodall Julia Victoria Theo LOVES: Coco Zoe Theo HATES: Augustine Cecily Didi Katie Lea Marie Victoria HATES: Annie Carlie Darwin Didi Julia Katie Sarah Zoe Zoe LOVES: Humboldt Theo Zoe HATES: Augustine Didi Goodall Millie Natasha Victoria #===============================================================# Now based on what was in the problem statement we KNOW that the chimpanzee that is in the cage on Floor 2, Row 2, Column 2 MAY NOT HAVE ANY ENEMIES at ALL. Since ONLY Jonathan qualifies for this location we KNOW that Jonathan MUST BE IN THE MIDDLE CAGE! AS ALWAYS IN ORDER TO FIND THE SOLUTIONS ANY PROBLEM WITH MANY POSSIBLE SOLUTIONS THE FIRST STEP IS ALWAYS TO ELIMINATE AS MANY OF THE SOLUTIONS AS POSSIBLE AS SOON AS POSSIBLE... Since we MUST have the LOVERS of a chimpanzee on a WALL (not a floor or ceiling) then it is advantages to proceed as follows: Step 1: First we place the chimpanzee with the MOST ENEMIES (or on the very first placement the one with NO ENEMIES) in the first cage that is available. Then since his/her LOVERS only have a VERY FEW POSSIBLE LOCATIONS we place them next. Step 2: If any of those LOVERS just placed also have other lovers we place them next. Step 3: If we have placed all chimps we have found a solution, otherwise goto Step 1. We would also like to ELIMINATE some MIRROR SOLUTIONS so we know that there are ONLY four available cages for Carlie and Goodall once we have decided that Jonathan MUST go in the MIDDLE CAGE (i.e. cage # 222). Since no matter which of the four cages we place Carlie in we can rotate the picture to look the same we ONLY need to consider one of the four locations, so Carlie goes in the cage that is located on Floor 2, Row 1, Column 2 (i.e. in cage # 212). This leaves only three possible locations for Goodall (two of which are again MIRROR images) so we must only consider Goodall for cages 221 and 232! This leaves us with figures 1 and 2 below. #===============================================================# 1 2 3 +------------+------------+------------+ **** Row 1 / / / / ** ** F +------------+------------+------------+ ** L 2 / / / / *** O +------------+------------+------------+ ** O 3 / / / / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / / Carlie / / ** ** F +------------+------------+------------+ ** L 2 / Goodall / Jonathan / / *** O +------------+------------+------------+ ** O 3 / / / / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / / / / *** F +------------+------------+------------+ ** L 2 / / / / ** O +------------+------------+------------+ ** O 3 / / / / ** R +------------+------------+------------+ ****** Figure 1 #===============================================================# 1 2 3 +------------+------------+------------+ **** Row 1 / / / / ** ** F +------------+------------+------------+ ** L 2 / / / / *** O +------------+------------+------------+ ** O 3 / / / / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / / Carlie / / ** ** F +------------+------------+------------+ ** L 2 / / Jonathan / / *** O +------------+------------+------------+ ** O 3 / / Goodall / / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / / / / *** F +------------+------------+------------+ ** L 2 / / / / ** O +------------+------------+------------+ ** O 3 / / / / ** R +------------+------------+------------+ ****** Figure 2 #===============================================================# We can now PROCEED WITH OUR ALGORITHM by placing the next chimp based on our selection criterion. This means that all of the CHIMPANZEES WILL BE PLACED IN THE FOLLOWING ORDER: O# Chimpanzee Description of why selected at this time -- ---------- ------------------------------------------- 1. Jonathan CHIMP with NO ENEMIES (MUST BE in cage 222) 2. Carlie ..LOVER of Jonathan (MUST BE in cage 212) 3. Goodall ..LOVER of Jonathan (MUST BE in 221, 232) 4. Emily UNPLACED CHIMP with the MOST ENEMIES 5. Napoleon ..LOVER of Emily 6. Katie UNPLACED CHIMP with the MOST ENEMIES 7. Augustine ..LOVER of Katie 8. Didi ....LOVER of Augustine 9. Annie UNPLACED CHIMP with the MOST ENEMIES 10. Darwin ..LOVER of Annie 11. Millie ....LOVER of Darwin 12. Coco UNPLACED CHIMP with the MOST ENEMIES 13. Theo ..LOVER of Coco 14. Zoe ....LOVER of Theo 15. Humboldt ......LOVER of Zoe 16. Cordelia UNPLACED CHIMP with the MOST ENEMIES 17. Caesar ..LOVER of Cordelia 18. Julia ....LOVER of Ceasar 19. Lea UNPLACED CHIMP with the MOST ENEMIES 20. Aristotle ..LOVER of Lea 21. Marie UNPLACED CHIMP with the MOST ENEMIES 22. Chimpie ..LOVER of Marie 23. Cecily ....LOVER of Chimpie 24. Natasha UNPLACED CHIMP with the MOST ENEMIES 25. Sarah UNPLACED CHIMP with the MOST ENEMIES 26. Victoria UNPLACED CHIMP with the MOST ENEMIES 27. Miles LAST UNPLACED CHIMP Once we are able to place Miles we have found a solution! We then go back up and try all the possible positions to generate all of our solutions (if any). The BIG ADVANTAGE in placing the chimpanzees in this particular order is that we can VERY QUICKLY ELIMINATE A LOT OF POSSIBLE POSITIONS and as soon as we are unable to place a chimpanzee we go back up our search tree and try the next possible position. #===============================================================# Using the method specified I have come up with FOUR SOLUTIONS (only ONE of which is UNIQUE since solutions 1 and 3 are mirror images of each other as are solutions 1 and 2 and solutions 3 and 4, so in FACT solution 1 is the ONLY UNIQUE SOLUTION) to the FINAL PROBLEM given by Dr. Ban. There are NO SOLUTIONS to the last constraint posed by Dr. Ecco that no more than two monkeys that hate each other may be on the same floor. The solutions to Dr. Bans' FINAL PROBLEM are: --------------------------------------------- 1 2 3 +------------+------------+------------+ **** Row 1 / Aristotle / Lea / Didi / ** ** F +------------+------------+------------+ ** L 2 / Cecily / Natasha / Augustine / *** O (8) +------------+------------+------------+ ** O 3 / Chimpie / Marie / Katie / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / Sarah / Carlie / Annie / ** ** F +------------+------------+------------+ ** L 2 / Miles / Jonathan / Darwin / *** O (8) +------------+------------+------------+ ** O 3 / Victoria / Goodall / Millie / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / Humboldt / Zoe / Cordelia / *** F +------------+------------+------------+ ** L 2 / Napoleon / Theo / Caesar / ** O (6) +------------+------------+------------+ ** O 3 / Emily / Coco / Julia / ** R +------------+------------+------------+ ****** Solution 1 1 2 3 +------------+------------+------------+ **** Row 1 / Didi / Lea / Aristotle / ** ** F +------------+------------+------------+ ** L 2 / Augustine / Natasha / Cecily / *** O (8) +------------+------------+------------+ ** O 3 / Katie / Marie / Chimpie / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / Annie / Carlie / Sarah / ** ** F +------------+------------+------------+ ** L 2 / Darwin / Jonathan / Miles / *** O (8) +------------+------------+------------+ ** O 3 / Millie / Goodall / Victoria / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / Cordelia / Zoe / Humboldt / *** F +------------+------------+------------+ ** L 2 / Caesar / Theo / Napoleon / ** O (6) +------------+------------+------------+ ** O 3 / Julia / Coco / Emily / ** R +------------+------------+------------+ ****** Solution 2 1 2 3 +------------+------------+------------+ **** Row 1 / Humboldt / Zoe / Cordelia / ** ** F +------------+------------+------------+ ** L 2 / Napoleon / Theo / Caesar / *** O (6) +------------+------------+------------+ ** O 3 / Emily / Coco / Julia / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / Sarah / Carlie / Annie / ** ** F +------------+------------+------------+ ** L 2 / Miles / Jonathan / Darwin / *** O (8) +------------+------------+------------+ ** O 3 / Victoria / Goodall / Millie / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / Aristotle / Lea / Didi / *** F +------------+------------+------------+ ** L 2 / Cecily / Natasha / Augustine / ** O (8) +------------+------------+------------+ ** O 3 / Chimpie / Marie / Katie / ** R +------------+------------+------------+ ****** Solution 3 1 2 3 +------------+------------+------------+ **** Row 1 / Cordelia / Zoe / Humboldt / ** ** F +------------+------------+------------+ ** L 2 / Caesar / Theo / Napoleon / *** O (6) +------------+------------+------------+ ** O 3 / Julia / Coco / Emily / ** ** R +------------+------------+------------+ **** 1 2 3 +------------+------------+------------+ **** Row 1 / Annie / Carlie / Sarah / ** ** F +------------+------------+------------+ ** L 2 / Darwin / Jonathan / Miles / *** O (8) +------------+------------+------------+ ** O 3 / Millie / Goodall / Victoria / ** ** R +------------+------------+------------+ ****** 1 2 3 +------------+------------+------------+ ** Row 1 / Didi / Lea / Aristotle / *** F +------------+------------+------------+ ** L 2 / Augustine / Natasha / Cecily / ** O (8) +------------+------------+------------+ ** O 3 / Katie / Marie / Chimpie / ** R +------------+------------+------------+ ****** Solution 4 #===============================================================# To generate these solutions I wrote the following C program: /*-------------------------------------------------------------------------- --- Filename: C H I M P S . C Author: Robert H. Morrison Address: Brucknerstraße 12 76744 Wörth GERMANY Description: Program to find the possible solutions to the CHIMPS problem in the September 2000 issue of DDJ. ---------------------------------------------------------------------------- -*/ #include #include #include /*-------------------------------------------------------------------------- --- M A C R O S ---------------------------------------------------------------------------- -*/ #define NUM_CAGES 27 #define FIRST_CHIMP 1 #define LAST_CHIMP NUM_CAGES #define CAGE_FREE(d,c) ((d>>(4+c))&1) #define CAGE_USED(c) (~(1<<(4+c))) /*-------------------------------------------------------------------------- --- D A T A ---------------------------------------------------------------------------- -*/ typedef enum { None, Annie, Aristotle, Augustine, Caesar, Carlie, Cecily, Chimpie, Coco, Cordelia, Darwin, Didi, Emily, Goodall, Humboldt, Jonathan, Julia, Katie, Lea, Marie, Miles, Millie, Napoleon, Natasha, Sarah, Theo, Victoria, Zoe } Chimps; Chimps chimp_Hate[ NUM_CAGES + 1 ][ NUM_CAGES + 1 ] = { { None}, { Aristotle, Cecily, Coco, Emily, Humboldt, Julia, Katie, Marie, Miles, Victoria }, { Annie, Augustine, Chimpie, Marie }, { Aristotle, Coco, Cordelia, Emily, Napoleon, Sarah, Theo, Zoe }, { Chimpie, Emily, Lea, Marie, Napoleon, Natasha, Sarah }, { Chimpie, Coco, Emily, Goodall, Julia, Katie, Marie, Millie, Victoria }, { Annie, Emily, Katie, Theo }, { Aristotle, Caesar, Carlie, Cordelia, Katie }, { Annie, Augustine, Carlie, Cordelia, Didi, Katie, Lea, Natasha, Sarah }, { Augustine, Chimpie, Coco, Julia, Katie, Lea, Miles, Millie, Natasha }, { Emily, Humboldt, Miles, Napoleon, Sarah, Victoria }, { Coco, Emily, Goodall, Humboldt, Katie, Millie, Napoleon, Sarah, Theo, Victoria, Zoe }, { Annie, Augustine, Caesar, Carlie, Cecily, Darwin, Didi, Julia, Katie, Lea, Marie, Natasha }, { Carlie, Didi, Lea, Sarah, Zoe }, { Annie, Darwin, Didi, Katie, Marie, Natasha }, { None }, { Annie, Carlie, Cordelia, Emily, Miles, Napoleon, Natasha, Sarah, Victoria }, { Annie, Carlie, Cecily, Chimpie, Coco, Cordelia, Didi, Emily, Humboldt, Miles, Theo, Victoria }, { Caesar, Coco, Cordelia, Emily, Goodall, Marie, Millie, Napoleon, Theo }, { Annie, Aristotle, Caesar, Carlie, Emily, Humboldt, Lea, Napoleon, Theo }, { Annie, Cordelia, Darwin, Julia, Katie, Millie }, { Carlie, Cordelia, Didi, Lea, Miles, Napoleon, Zoe }, { Augustine, Caesar, Darwin, Didi, Julia, Lea, Marie, Millie, Natasha }, { Caesar, Coco, Cordelia, Emily, Humboldt, Julia, Napoleon, Zoe }, { Augustine, Caesar, Coco, Darwin, Didi, Goodall, Julia, Victoria }, { Augustine, Cecily, Didi, Katie, Lea, Marie }, { Annie, Carlie, Darwin, Didi, Julia, Katie, Sarah, Zoe }, { Augustine, Didi, Goodall, Millie, Natasha, Victoria } }; Chimps chimp_Love[ NUM_CAGES + 1 ][ NUM_CAGES + 1 ] = { { None }, { Darwin }, { Lea }, { Didi, Katie }, { Cordelia, Julia }, { Jonathan }, { Chimpie }, { Cecily, Marie }, { Theo }, { Caesar }, { Annie, Millie }, { Augustine }, { Napoleon }, { Jonathan }, { Zoe }, { Carlie, Goodall }, { Caesar }, { Augustine }, { Aristotle }, { Chimpie }, { None }, { Darwin }, { Emily }, { None }, { None }, { Coco, Zoe }, { None }, { Humboldt, Theo } }; char * chimp_Name[ NUM_CAGES + 1 ] = { "None", "Annie", "Aristotle", "Augustine", "Caesar", "Carlie", "Cecily", "Chimpie", "Coco", "Cordelia", "Darwin", "Didi", "Emily", "Goodall", "Humboldt", "Jonathan", "Julia", "Katie", "Lea", "Marie", "Miles", "Millie", "Napoleon", "Natasha", "Sarah", "Theo", "Victoria", "Zoe" }; Chimps chimp_Order[ NUM_CAGES + 1 ] = { None, Jonathan, Carlie, Goodall, Emily, Napoleon, Katie, Augustine, Didi, Annie, Darwin, Millie, Coco, Theo, Zoe, Humboldt, Cordelia, Caesar, Julia, Lea, Aristotle, Marie, Chimpie, Cecily, Natasha, Sarah, Victoria, Miles }; typedef unsigned long DWORD; DWORD cage_Data [ NUM_CAGES + 1 ] = { 0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0x000080e0, // Carlie 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0x002200e0, // Goodall 0xffffffe0, 0x000400e0, // Jonathan 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0, 0xffffffe0 }; DWORD cage_Hate [ NUM_CAGES + 1 ] = { 0, 0xff793c9f, // Cage # 1 0xfef0381f, // Cage # 2 0xfdf2793f, // Cage # 3 0xfbc9249f, // Cage # 4 0xf780001f, // Cage # 5 0xef92493f, // Cage # 6 0xdfc9e4ff, // Cage # 7 0xbf81c0ff, // Cage # 8 0x7f93c9ff, // Cage # 9 0xf2793c9f, // Cage # 10 0xe070381f, // Cage # 11 0xe4f2793f, // Cage # 12 0x9249249f, // Cage # 13 0x0000001f, // Cage # 14 0x2492493f, // Cage # 15 0x93c9e4ff, // Cage # 16 0x0381c0ff, // Cage # 17 0x2793c9ff, // Cage # 18 0xf2793fdf, // Cage # 19 0xe0703fbf, // Cage # 20 0xe4f27f7f, // Cage # 21 0x92493eff, // Cage # 22 0x00003dff, // Cage # 23 0x24927bff, // Cage # 24 0x93c9f7ff, // Cage # 25 0x0381efff, // Cage # 26 0x2793dfff // Cage # 27 }; DWORD cage_Love [ NUM_CAGES + 1 ] = { 0, 0x0000015f, // Cage # 1 0x000002bf, // Cage # 2 0x0000045f, // Cage # 3 0x00000a3f, // Cage # 4 0x0000155f, // Cage # 5 0x0000229f, // Cage # 6 0x0000111f, // Cage # 7 0x00002a1f, // Cage # 8 0x0000141f, // Cage # 9 0x0002801f, // Cage # 10 0x0005401f, // Cage # 11 0x0008801f, // Cage # 12 0x0014401f, // Cage # 13 0x002a801f, // Cage # 14 0x0045001f, // Cage # 15 0x0022001f, // Cage # 16 0x0054001f, // Cage # 17 0x0028001f, // Cage # 18 0x0500001f, // Cage # 19 0x0a80001f, // Cage # 20 0x1100001f, // Cage # 21 0x2880001f, // Cage # 22 0x5500001f, // Cage # 23 0x8a00001f, // Cage # 24 0x4400001f, // Cage # 25 0xa800001f, // Cage # 26 0x5000001f // Cage # 27 }; char * pre_str[8] = { " ", " ", "Row 1 /", " ", " 2 /", " ", "3 /", " " }; char * floor_str[3][8] = { { "", " **", " *** F", " ** L", " ** O", " ** O", " ** R", "******" }, { "", " ****", "** ** F", " ** L", " *** O", " ** O", "** ** R", "******" }, { "", " ****", "** ** F", " ** L", " *** O", " ** O", "** ** R", " ****" } }; /*-------------------------------------------------------------------------- --- G L O B A L V A R I A B L E S ---------------------------------------------------------------------------- -*/ int solution; /*-------------------------------------------------------------------------- --- F U N C T I O N P R O T O T Y P E S ---------------------------------------------------------------------------- -*/ void chimp_place( short num, DWORD * cage_data ); int count_enemies( int cage_num, int * cages ); void print_floor( int floor, int * cages ); void print_solution( DWORD * data ); /*-------------------------------------------------------------------------- --- F U N C T I O N S ---------------------------------------------------------------------------- -*/ void chimp_place( short num, DWORD * cage_data ) { Chimps chimp = chimp_Order[ num ]; DWORD new_data = 1; DWORD * data; int cage; int data_size = sizeof( DWORD ) * ( NUM_CAGES + 1 ); data = malloc( data_size ); for ( cage = 1; cage <= NUM_CAGES; cage++ ) { if ( CAGE_FREE( cage_data[ chimp ], cage )) { Chimps * enemy; Chimps * lover; Chimps monkey; memcpy( data, cage_data, data_size ); data[ chimp ] |= cage; if ( num == NUM_CAGES ) { print_solution( data ); goto Cleanup_Chimp; } for ( lover = chimp_Love[ chimp ]; *lover; lover++ ) { new_data = data[ *lover ] & cage_Love[ cage ]; if ( ! new_data ) break; data[ *lover ] = new_data; } if ( ! new_data ) continue; for ( enemy = chimp_Hate[ chimp ]; *enemy; enemy++ ) { new_data = data[ *enemy ] & cage_Hate[ cage ]; if ( ! new_data ) break; data[ *enemy ] = new_data; } if ( ! new_data ) continue; for ( monkey = FIRST_CHIMP; monkey <= LAST_CHIMP; monkey++ ) { new_data = data[ monkey ] & CAGE_USED( cage ); if ( ! new_data ) break; data[ monkey ] = new_data; } if ( ! new_data ) continue; chimp_place( num + 1, data ); } } /*------------------*/ Cleanup_Chimp: /*------------------*/ free ( data ); } int count_enemies( int cage_num, int * cages ) { Chimps * enemy; int i, j, hate_num = 0; /*------------------------------------------------------------- Calculate HOW MANY CHIMPS HATE EACH OTHER on this FLOOR -------------------------------------------------------------*/ for ( i = cage_num; i < cage_num + 9; i++ ) { for ( j = cage_num; j < cage_num + 9; j++ ) { if ( i == j ) continue; for ( enemy = chimp_Hate[ cages[i]]; *enemy; enemy++ ) { if ( *enemy == cages[j] ) { hate_num++; j = cage_num + 9; break; } } } } return ( hate_num ); } void print_floor( int floor, int * cages ) { int i, line, cage_num, hate_num; cage_num = floor * 9 - 8; hate_num = count_enemies( cage_num, cages ); for ( line = 0; line < 8; line++ ) { printf( pre_str[ line ] ); switch ( line ) { case 0: for ( i = 1; i <= 3; i++ ) printf( "%13d", i ); break; case 1: case 3: case 5: case 7: printf( "%s", "+------------+------------+------------+" ); break; case 2: case 4: case 6: for ( i = 0; i < 3; i++ ) printf( " %-10s /", chimp_Name[cages[cage_num++]] ); break; default: break; } for ( i = line; i > 0; i-- ) putchar( ' ' ); printf( "%s", floor_str[floor-1][line] ); if ( line == 4 ) printf( " (%d)", hate_num ); putchar( '\n' ); } } void print_solution( DWORD * data ) { Chimps chimp; int cages[ NUM_CAGES + 1 ]; int floor; memset( cages, 0, sizeof( cages )); for ( chimp = FIRST_CHIMP; chimp <= LAST_CHIMP; chimp++ ) cages[ data[ chimp ] & 0x1f ] = chimp; for ( floor = 3; floor > 0; floor-- ) print_floor( floor, cages ); printf ( "\nSolution %3d\n\n", ++solution ); } int main ( void ) { chimp_place( 1, cage_Data ); if ( ! solution ) printf( "No solution found.\n" ); return EXIT_SUCCESS; } #===============================================================# ------------------------------------------------------- Robert Morrison Hitex GmbH Greschbachstr. 12 E-mail: mailto:RMorrison@hitex.de 76229 Karlsruhe Phone: +49 721 9628-167 GERMANY Fax: +49 721 9628-149 http://www.hitex.de ------------------------------------------------------- Please do not use my E-mail address for advertising. ------------------------------------------------------- From jpa@contraste.pt Fri Sep 15 13:11 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id NAA16424 for ; Fri, 15 Sep 2000 13:11:31 -0400 (EDT) Received: from mail.EUnet.pt (individual.EUnet.pt [193.126.4.67]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id NAA19954 for ; Fri, 15 Sep 2000 13:11:26 -0400 (EDT) Received: from contraste.europa (d012119.lsb.PT.EU.net [193.126.12.119]) by mail.EUnet.pt (8.9.3/8.9.3) with SMTP id SAA03173 for ; Fri, 15 Sep 2000 18:11:15 +0100 (WET DST) Received: from contraste.pt ([contraste.europa]) by 192.168.100.23 ( IA Mail Server Version: 2.2. Build: 2036 ) ) ; 15 Sep 00 16:22:53 UT Message-ID: <39C24EAF.7FA0B2E9@contraste.pt> Date: Fri, 15 Sep 2000 17:30:39 +0100 From: Joao Pedro Afonso Reply-To: jpa@contraste.pt X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Chimps References: <200008031740.NAA04543@griffin.cs.nyu.edu> Content-Type: multipart/mixed; boundary="------------665651EA26F1274EFF786611" Content-Length: 41303 Status: R This is a multi-part message in MIME format. --------------665651EA26F1274EFF786611 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Dennis Shasha wrote: > > Joao, > Yes, you are right. > I neglected to include a little information. > The following will appear in a future issue. > > Nice work, > Dennis > > Reader Solutions to the Microvirus problem > Dear Sir, Hello! It´s me again. First thing, I want to thank your personnel (long) reply and comment to my message. Actually, in that message, I was more interested in why the additional rules had to be explain later... to be more precise, that rules existed since the beginning and you forgot to tell us, or was it an accident (the inhibitions about the fact that the R3 couldn´t cut certain TT's conections)? Which is one way to probe you, how do you do to create so many wonderfull puzzles, month after month? Are they born rightly from the beginning or they perfect themselves with time? Now, about your September puzzle. after some time trying to discover by deductive methods an answer, I tryed instead to find all the solutions automatically (At the time, I found more apealling - more fun actually - to do the algorithm to do that... particulary because I want to know all the possible answers to atack the last proposal of Ecco). Unfortunally for me, I found only one solution to the two cases (permiting and no permiting enemy chimps in one column), the same one: first floor: Julia Caesar Cordelia Coco Theo Zoe Emily Napoleon Humboldt Seconf Floor: Millie Darwin Annie Goodall Jonathan Carlie Victoria Miles Sarah Third Floor: Katie Augustine Didi Marie Natasha Lea Chimpie Cecily Aristotle Can that be? Of course, this is not the only one, but the seed to several: through it, I can generate all the other answers, either by interchanging the first floor with the third, either by a 90º rotation around the Theo-Cecily axe, or by mirroring using the vertical planes Coco-Zoe-Natasha, or Napoleon-Caesar-Natasha (I don't remember the name of this transformations group but I imagine the problem to have about 16 different solutions). My problem is, this seed is the only one I found for all the problems, which means the rule of the column doesn't restrict the number of the solutions, and there are no way of optimising the solution to avoid enemy chimps in the same level (about 21 pairs/relations in that situation in the solution found, not counting the ones we are oblidged to have in the same level because they have a common lover/loved one... this group transformation preserves, if I'm not wrong, the column relationship, and the composition of each floor). But the problem's formulation (proposed to Dr Ecco) appear's to hint of several solutions progressivly restricted by later rules... I'm affraid I'm wasting your time presenting a wrong solution (I didn't througly tested it, I tested successfully a small sample of the solution and trust the programm to be right after that). How do I did? Jonathan must be the central one since he is the only one not hated by anyone. Goodall and Carlie are enemies but they love Jonathan, so they must be opposites in the same level around jonathan. They form a polymino (is the name rigth?) with 4 possible positions in the cages. The same love-Hate-relationships gives us a partition of the other chimps, and also the possible shapes for these new polyminos (each class partition, being the material for a polymino). A good thing was, Carlie is enemy of nine Chimps, which must occupy the opposite wall to him. This also block or restricts many of the possible positions for the other polyminos, as to lock the position of some of them. Particulary interesting is the polymino (Coco,Theo,Zoe,Humbolt) which with (Coco hates Carlie) and (Zoe hates Goodall), must have a L form, aligned with first polymino. The position of this "L" destroys the symmetries (origin to the transformation group I refer before), and so, I only have to try to position the L polymino in some of his possible positions, not all of them, to find the possible solutions and generate all the others... which I did. Fortunally, I can codify bitmaps of 27 positions in 32-bit integers, which means I could use extensively bit-comparations to see if there was overlaps of polyminos, or contacts between enemies. I enjoyed to discover that I could easely change the occupation of a polymino in a bit-map by shifting their bits-sequence. The algorithm was recursive, the stack didn't crash, and I become a little disapointed when after thinking several nights to optimize the code to maximum, the program did find the solution in less than 2 seconds (I was thinking, with all the tryings it has to do, it had to be much more slower... and so, the optimization effort... now, I think, maybe it wasn't necessary to do that). And I reach only one solution. In attachment, there are an excell file with a colored map of the solution whith all polyminos (used in the solution) referenced, and also a list of enemies for each chimp (I hope you can open the format). Each polymino represents a group of chimps which must be connected by love relations between them (and must be in the same level each). I presented them here because maybe you can see if there are any error. Sorry for the message extension: I enjoyed to try to solve the puzzle and I wanted to tell you that (even if I probably didn't solve it). Thanks. Joao Pedro Afonso PS.: In the tower of lego, one of your first puzzles in the book, "The Puzzling adventures of Dr. Ecco", the given solution to the 10.000 stories tower is 21 weeks. Is that a typographic error of my book edition? I think there is a easy solution with 20 weeks. --------------665651EA26F1274EFF786611 Content-Type: application/x-msexcel; name="ChimpPuzzle.xls" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ChimpPuzzle.xls" 0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAMQAAAAAA AAAAEAAA/v///wAAAAD+////AAAAADAAAAD///////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////8JCBAAAAYFANMQzAdBAAAABgAAAOEAAgCwBMEA AgAAAOIAAABcAHAACgAASnVnb3NsYXZpYSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEIAAgCwBGEBAgAAAD0BBgABAAIAAwCcAAIADgAZAAIAAAASAAIA AAATAAIAAACvAQIAAAC8AQIAAAA9ABIAeACHAExKdDE4AAAAAAABAFgCQAACAAAAjQACAAAA IgACAAAADgACAAEAtwECAAAA2gACAAAAMQAaAMgAAAD/f5ABAAAAAAAABQFBAHIAaQBhAGwA MQAaAMgAAAD/f5ABAAAAAAAABQFBAHIAaQBhAGwAMQAaAMgAAAD/f5ABAAAAAAAABQFBAHIA aQBhAGwAMQAaAMgAAAD/f5ABAAAAAAAABQFBAHIAaQBhAGwAHgQiAAUAHQAAIywjIzBcICJF c2MuIjtcLSMsIyMwXCAiRXNjLiIeBCcABgAiAAAjLCMjMFwgIkVzYy4iO1tSZWRdXC0jLCMj MFwgIkVzYy4iHgQoAAcAIwAAIywjIzAuMDBcICJFc2MuIjtcLSMsIyMwLjAwXCAiRXNjLiIe BC0ACAAoAAAjLCMjMC4wMFwgIkVzYy4iO1tSZWRdXC0jLCMjMC4wMFwgIkVzYy4iHgREACoA PwAAXy0qICMsIyMwXCAiRXNjLiJfLTtcLSogIywjIzBcICJFc2MuIl8tO18tKiAiLSJcICJF c2MuIl8tO18tQF8tHgRKACkARQAAXy0qICMsIyMwXCBfRV9zX2NfLl8tO1wtKiAjLCMjMFwg X0Vfc19jXy5fLTtfLSogIi0iXCBfRV9zX2NfLl8tO18tQF8tHgRMACwARwAAXy0qICMsIyMw LjAwXCAiRXNjLiJfLTtcLSogIywjIz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MAAMAHgAaAAAA/QAKAA8AAAAPAB4AAAD9AAoAEQABAB8AHwAAAP0ACgARAAIAHwAsAAAA /QAKABEAAwAfACAAAAD9AAoAEQAEAB8AIQAAAP0ACgARAAUAHwAiAAAA/QAKABEABgAfACMA AAD9AAoAEQAHAB8AJAAAAP0ACgARAAgAHwAlAAAA/QAKABEACQAfACYAAAD9AAoAEQAKAB8A JwAAAP0ACgARAAsAHwAoAAAA/QAKABEADAAfACkAAAD9AAoAEQANAB8AKgAAAP0ACgARAA4A HwArAAAA/QAKABIAAQAgAAsAAAB+AgoAEgACACAAAAAkQP0ACgASAAMAIAAaAAAA/QAKABIA BAAgABkAAAD9AAoAEgAFACAAAwAAAP0ACgASAAYAIAAGAAAA/QAKABIABwAgAAgAAAD9AAoA EgAIACAAAAAAAP0ACgASAAkAIAASAAAA/QAKABIACgAgABUAAAD9AAoAEgALACAAEAAAAP0A CgASAAwAIAAPAAAAvgAKABIADQAgACAADgD9AAoAEwABACAAGgAAAH4CCgATAAIAIAAAABBA /QAKABMAAwAgAAsAAAD9AAoAEwAEACAAEwAAAP0ACgATAAUAIAAYAAAA/QAKABMABgAgABUA AAC+ABYAEwAHACAAIAAgACAAIAAgACAAIAAOAP0ACgAUAAEAIAATAAAAfgIKABQAAgAgAAAA IED9AAoAFAADACAAGgAAAP0ACgAUAAQAIAADAAAA/QAKABQABQAgAAIAAAD9AAoAFAAGACAA BgAAAP0ACgAUAAcAIAAHAAAA/QAKABQACAAgABEAAAD9AAoAFAAJACAABAAAAP0ACgAUAAoA IAAFAAAAvgAOABQACwAgACAAIAAgAA4A/QAKABUAAQAgAAEAAAB+AgoAFQACACAAAAAcQP0A CgAVAAMAIAAYAAAA/QAKABUABAAgAAYAAAD9AAoAFQAFACAAFwAAAP0ACgAVAAYAIAAVAAAA /QAKABUABwAgAAcAAAD9AAoAFQAIACAAFgAAAP0ACgAVAAkAIAARAAAAvgAQABUACgAgACAA IAAgACAADgD9AAoAFgABACAADgAAAH4CCgAWA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AAAAP0ACgAnAAcAIAAAAAAA/QAKACcA CAAgABcAAAD9AAoAJwAJACAAFQAAAP0ACgAnAAoAIAAJAAAA/QAKACcACwAgABYAAAC+AAwA JwAMACAAIAAgAA4A/QAKACgAAQAgABYAAAB+AgoAKAACACAAAAAgQP0ACgAoAAMAIAABAAAA /QAKACgABAAgAAMAAAD9AAoAKAAFACAAAgAAAP0ACgAoAAYAIAAGAAAA/QAKACgABwAgAAgA AAD9AAoAKAAIACAAAAAAAP0ACgAoAAkAIAAHAAAA/QAKACgACgAgAAUAAAC+AA4AKAALACAA IAAgACAADgD9AAoAKQABACAAEQAAAH4CCgApAAIAIAAAACBA/QAKACkAAwAgABMAAAD9AAoA KQAEACAAAQAAAP0ACgApAAUAIAADAAAA/QAKACkABgAgAAoAAAD9AAoAKQAHACAAFAAAAP0A CgApAAgAIAAMAAAA/QAKACkACQAgAAAAAAD9AAoAKQAKACAADwAAAL4ADgApAAsAIAAgACAA IAAOAP0ACgAqAAEAIAAEAAAAfgIKACoAAgAgAAAAGED9AAoAKgADACAAEwAAAP0ACgAqAAQA IAAZAAAA/QAKACoABQAgABQAAAD9AAoAKgAGACAAEgAAAP0ACgAqAAcAIAAXAAAA/QAKACoA CAAgABUAAAC+ABIAKgAJACAAIAAgACAAIAAgAA4A/QAKACsAAQAgAA8AAAB+AgoAKwACACAA AAAgQP0ACgArAAMAIAALAAAA/QAKACsABAAgAA4AAAD9AAoAKwAFACAACgAAAP0ACgArAAYA IAAUAAAA/QAKACsABwAgAAAAAAD9AAoAKwAIACAAEgAAAP0ACgArAAkAIAARAAAA/QAKACsA CgAgAAUAAAC+AA4AKwALACAAIAAgACAADgD9AAoALAABACAABQAAAH4CCgAsAAIAIAAAABhA /QAKACwAAwAgABMAAAD9AAoALAAEACAAFAAAAP0ACgAsAAUAIAAMAAAA/QAKACwABgAgAAkA AAD9AAoALAAHACAAFgAAAP0ACgAsAAgAIAAPAAAAvgASACwACQAgACAAIAAgACAAIAAOAP0A CgAvAA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// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /////1IAbwBvAHQAIABFAG4AdAByAHkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAWAAUB//////////8CAAAAIAgCAAAAAADAAAAAAAAARgAAAAAAAAAA AAAAAAAAAAAAAAAA/v///wAAAAAAAAAAVwBvAHIAawBiAG8AbwBrAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAgH///////////////8AAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJT8AAAAAAAAFAFMAdQBtAG0A YQByAHkASQBuAGYAbwByAG0AYQB0AGkAbwBuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA KAACAQEAAAADAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAA AAAAEAAAAAAAAAUARABvAGMAdQBtAGUAbgB0AFMAdQBtAG0AYQByAHkASQBuAGYAbwByAG0A YQB0AGkAbwBuAAAAAAAAAAAAAAA4AAIB////////////////AAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAQAAAAAAAA --------------665651EA26F1274EFF786611-- Reader Solutions to Natasha's Dig Problem The dig problem engendered many clever responses. For this problem, however, machine triumphed over (wo)man in the sense that the best solutions I received were all programmed by some kind of search procedure. The following all suggested an improved approach over Dr. Ecco's: Jon Beal, Jimmy Hu, Ted Alper, Richard W. Lipp, Michael Williams, Dave Weiblen, Pearl Pauling, Jim Greer, Dan Hirschberg, Paul DeMarco, Bob Harris, Jean-Francois Halleux, Christian Tanguy, Sam A. Virgillo, Dr.Burghart Hoffrichter, Christopher Oliver, Allan Vasenius, Charles Taylor, Koos du Toit, Martin Brown Kent Donaldson, Onno Waalewijn, Yves Piguet, Michael S. VanVertloo, Rodney P. Meyer, Benjamin C. Chaffin, Serguie Patchkovskii, Bharat Chandramouli, Hans Knorr, and Christopher Mills. The first best answers in the case in which all items must have a positive integer label came from Yves Piguet, Serguie Patchkovskii, and Ted Alper. Yves's labeling when at most three objects can be taken was: 1, 2, 4, 8, 15, 29, 90, 136, 202, 258, 314, and 492. This yields a trim maximum sum of 1,064. But a later answer from Ben Chaffin did even better with: 2 4 8 16 32 60 73 116 207 230 341 and 452, yielding a maximum sum of 1023 (Ecco's solution was quite a bit worse at 1,401.) Ted's positive integer labeling for up to four objects yielded a maximum sum of 2,737: 9, 16, 18, 20, 24, 32, 64, 119, 220, 404, 744, and 1369. Again, Ben Chaffin did even better: 16 18 19 20 24 32 64 128 237 420 712 1187, with a maximum sum of 2556. Many readers thought negative numbers wouldn't help yield a smaller maximum, but a few intrepid readers showed this to be wrong. The basic algorithm is to use negative numbers and then take the absolute value of any resulting sum. This guarantees a non-negative answer of course. The real cleverness is to ensure unique decodability. Dan Hirschberg showed that when at most three choices can be made, then negative numbers can reduce the maximum sum to 734: 2, 3, 4, 8, 16, 30, 56, 110, 173, 244, 317, -626. In the best solution, Ted Alper then showed that negative numbers can reduce the maximum sum of 1,527 for up to four choices: Alper: 2, 3, 4, 8, 16, 32, 61, 116, 224, 416, 771, -1468. Since I know of no proof of minimality for any of these sequences, a clever reader may find a better solution than the ones above. For that reason, I've written a checking program in K that I will send to anyone who wants it. The program takes a sequence and the number of choices that can be made and sees whether the sequence results in the unique decodability of subset sums. Reader Solutions to My Enemy's Enemy For the first time in my writing this column, nearly all readers who submitted a solution submitted the best possible solution. (Dr. Ecco's published solution was worse, partly because the initial conditions stated numerically were wrong. Group 9 was initially red, but was miscounted as blue.) First, readers recognized that good solutions required having some groups change alliances twice. (Is there a mathematical model of history there?) Next, they saw that nine alliance changes was a minimum. As Alan Dragoo put it: ``The five original reds must change once each and two other groups must change twice each, creating and destroying links connecting the reds to each other and/or to the sea in order to avoid having a group surrounded by its enemies.'' Finally, they found the following ordering which should present the minimum difficulty of 309,803.55 for conversion: 10 to red, 6 to red, 20 to blue, 2 to blue, 8 to blue, 9 to blue, 15 to blue, 10 to blue, and 6 to blue. The readers who achieved this were, in order of submission: Jon Beal, Richard Roy, Greg Smith, Eric W. Biederman, Kevin Ruland, Jason Strickland, James H. Puttick, Rodney & Jialin Meyer, Magne Oestlyngen, Patrick R. Schonfeld, Steve Tether, Pearl Pauling, Larry Holding, Philip Mayfield, Jimmy Hu, Tomas G. Rokicki, Alan Dragoo, and Mark Yendt. Reader Solutions to the Escape Puzzle Several readers found even faster escape routes than the prisoner: Jason Murray, Dennis L. Cumro, Steve Kietzman, Patrick R. Schonfeld, Robert Morrison, and Jimmy Hu. Patrick R. Schonfeld (with Jimmy Hu close behind) described the fastest scheme at 3 minutes and 16 seconds. The method would go faster if the prisoner could safely reach a cell at the instant a robot is leaving the cell. Here's how Schonfeld describes it: "Robot 1 at ( 4, 4) is passed by the prisoner at t=31. Robot 2 at (26, 8) is passed by the prisoner at t=99. Robot 3 at (15,12) is passed by the prisoner at t=145. Robot 4 at (18,16) is passed by the prisoner at t=175. Robot 5 at (20,20) is passed by the prisoner at t=195." Schonfeld also described a 24 minute cycle that eliminates the chance of escape for all prisoners below the 20th row. Here was his basic suggestion: ``The 4-part cycle consists of: 1) 3 robots patrolling rows 1-18 in the standard way (but faster), while robots 4 and 5 are stationary at opposite ends of rows 19 and 20 respectively, then 2) robot 4 does two passes of row 19, then 3) robot 5 does two passes of row 20. Note that with this cycle, the cells in rows 19 and 20 are checked twice per cycle. The 4th part of the cycle consists of the robots being stationary for 10 seconds to complete 24 minutes.'' Reader Solutions to Getting Even Some smart DDJ readers did quite a bit better than Ecco and Liane for the options problem. The basic framework these readers used was the same as Ecco's: if Fred's initial position is p, have Fred flip until he reaches p + $115,000; p - $115,000; p + $125,000; p - $125,000; and so on up to p + $395,000 and p - $395,000 or until he gets in bounds. There are 60 positions to search for. On the average, he will have to explore 30 of them before getting within bounds. By aiming for each target individually, that would require (on the average) 60 flips. Ecco took advantage of the fact that even when Fred misses a target, he may hit another. The problem was that Ecco's solution failed to take advantage of the fact that one should choose target points carefully so that they have this property. Using Wesley Perkin's terminology (he was the first to find this), given a target position p that one has reached, see whether p has live neighbors. Two neighbors n1 and n2 of p are live if they are both targets, have not yet been tested, and n1 - p = p - n2. In that case, if one then bets p - n2, the result of that bet will lead to a target no matter what. If p has no live neighbors, then choose as the next target some position that does. The algorithm can be further improved if one goes for targets whose live neighbors have live neighbors and so on. The net effect is that one can solve the $5,000 spread problem in under 37 flips on the average. Using Ecco's original method required over 55 flips and led to big losses more often. (When inbounds meant within $1,000, the number of flips declined from 260 to just over 150. The probability of going under 10 million dollars declined from 70% to about 30% and the probability of going under $1 billion declined from 4% to about 1%.) I post Ecco's original solution (even.k) and the solution of these smart readers (evenbetter.k) on the Kx system web site www.kx.com. Other readers who found similar solutions include Charles Taylor and Onno Waalewijn. Steve Worley volunteered a related problem: You owe $X. You want to get back to owing $0. You flip a fair coin with any positive integer sized bet. You lose if you exceed a debt of $M... the other guys get fed up and break your legs or something. The question is, with a current debt $X and maximum debt $M, what is the probability you'll be able to get back to $0 with a fair coin? The surprise is that P(X) is the simple linear function 0.5*(1+(M-X)/M). Your strategy is simply to bet $M if you're at a debt of $M, or bet the smaller of $X and ($M-$X). Reader Solutions to the Directed Evolution Problems Many readers found clever solutions to these problems. Here I cite those who found the best solutions to the two problems. Some people used computers and some used pencil and paper. The best algorithms using reversals are polynomial, but are quite tricky. The first problem demanded a solution using reversals only. The best answers I received required nine steps. The first such solution came from Eric Haines who proposed the following: start: mhtvkllcvvfsclcavawasshrqpchsp 1: (12,19) mhtvkllcvvfsawavaclcsshrqpchsp 2: (9,14) mhtvkllcvawasfvvaclcsshrqpchsp 3: (7,14) mhtvkllvfsawavcvaclcsshrqpchsp 4: (3,8) mhtfvllkvsawavcvaclcsshrqpchsp 5: (4,23) mhtfrhssclcavcvawasvkllvqpchsp 6: (1,12) mvaclcsshrfthcvawasvkllvqpchsp 7: (5,24) mvaclqvllkvsawavchtfrhsscpchsp 8: (2,27) mvhcpcsshrfthcvawasvkllvqlcasp 9: (0,17) awavchtfrhsscpchvmsvkllvqlcasp Eric also pointed out that this puzzle is similar to those in the games section of {\em What To Do After You Hit Return} published in 1975 by the People's Computer Company. The pages he sent me talked about reversals that started from the beginning of the string, so were a little easier than these general reversals. Eric's Perl code for solving the problem is available at http://www.lightlink.com/erich/nov98_pl.txt. Other readers who matched Eric's feat were: Steve Myers, Creig Smith, Ted Alper, Charles Taylor, and Dean Clamons. Tom Dinger Oscar Schoof Geldenhuys Jaco Serguei Patchkovskii Onno Waalewijn Dr. Burghart Hoffrichter was the first to present a 7 step solution for the second problem and to point out that rotations didn't help: start mhtvkllcvvfsclcavawasshrqpchsp rev ( 5,29): mhtvkpshcpqrhssawavaclcsfvvcll rev (11,25): mhtvkpshcpqvfsclcavawasshrvcll rev ( 5,22): mhtvksawavaclcsfvqpchspshrvcll rev ( 3,11): mhtcavawaskvlcsfvqpchspshrvcll rev ( 6,11): mhtcavvksawalcsfvqpchspshrvcll rev ( 4, 8): mhtcskvvaawalcsfvqpchspshrvcll rev ( 6, 9): mhtcskaavvwalcsfvqpchspshrvcll Most readers agreed, though Creig Smith's solution did use one. Other readers who showed a 7 step solution were: Michael Van Vertloo, Steve Myers, Don Vilen, Ted Alper, Charles Taylor, and the Wang Global Banking Solutions team of Bruce Oscarson, Curtis Cooley, and Dale Bennett. Tom Dinger Oscar Schoof Geldenhuys Jaco Serguei Patchkovskii Onno Waalewijn A final note: the ingenuity of the DDJ readers makes this a truly delightful column to write. If you have a good solution, please send it early in the month when the issue comes out, because I have to submit my discussion of reader solutions during that month. Reader Solutions to the Fitting Problem Clever readers found many solutions to the Fitting Problem of Rino Banti, because he forgot to tell Ecco that four rectangles should be included in the 16 x 16 geometric design. Even then, the solution is not unique. It looks as if the Venetians will have trouble recovering enough marble pieces to create a floor. Among the clever readers were Andrey Jivsov, Martin Brown, and Jim Brannan. Reader Solutions to the Foxy Problem Many readers submitted perfect solutions to the Foxy problem, meeting the bounds that Liane had set (by keeping A to a winning average of 7 with 9 players on each side and 6 1/3 when 25 players were on each side). These smart readers included: Dennis Okon, Rodney Meyer, Karl Putland, Pauling, Pearl, Earl Paddon, Eric Wiseblatt, Jimmy Hu, Marc Bellusci, John A. Trono, Steve Kietzman, Robert H. Morrison, Robert Huff, Andrew Palfreyman, Matt Jones, Roman Rytov, Tomas G. Rokicki, Jesper Lauridsen, and Art Grant. Dennis Okon was the first to show that Liane's solution was as good as possible. Tomas G. Rokicki showed that the average A win cannot be smaller than 6 + 8/(i-1) where i is the number of players each side. So it can never reach 6. Jesper Lauridsen suggested random lineups and showed that team B still has more than a 1/4 chance of winning and that this chance increases as the number of players per team increases. From Genny@webhabitat.com Mon Apr 23 22:06 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id WAA05331 for ; Mon, 23 Apr 2001 22:06:33 -0400 (EDT) Received: from iridium.mv.net (iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id WAA19392 for ; Mon, 23 Apr 2001 22:06:29 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id WAA21277 for ; Mon, 23 Apr 2001 22:06:28 -0400 (EDT) Received: from flip.webhabitat.com ([64.166.129.103]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id WAA25987 for ; Mon, 23 Apr 2001 22:06:27 -0400 (EDT) Received: by flip.webhabitat.com with Internet Mail Service (5.5.2653.19) id ; Mon, 23 Apr 2001 19:04:39 -0700 Message-ID: From: Genny Engel To: "'DrEcco@ddj.com'" Subject: Foxy Date: Mon, 23 Apr 2001 19:04:38 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C0CC62.EA8EC3E0" Content-Length: 8243 Status: RO This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0CC62.EA8EC3E0 Content-Type: text/plain; charset="iso-8859-1" I just read your answer to "Foxy" in the May issue. I had a come up with a somewhat different pattern. Since the maximum point spread desired was 10 points, it seemed to me the easiest thing would be to divide each team into small groups of five or six. Then, have each group play its same-numbered counterpart. That way you ensure the point spread stays narrow. Once the team is divided into small groups, Foxy can play mix-and-match with the groups to arrange wins or losses or ties. For example, to win: A0 vs. B4 - A wins A1 vs. B5 - A wins A2 vs. B0 - B wins A3 vs. B1 - B wins A4 vs. B2 - B wins A5 vs. B3 - B wins To tie: A0 vs. B0 - A wins A1 vs. B5 - A wins A2 vs. B4 - A wins A3 vs. B1 - B wins A4 vs. B2 - B wins A5 vs. B3 - B wins For each group of six, the choices Foxy has are: 1) win 4 - 2 2) tie 3) lose 2 - 4 4) lose 1 - 5 5) lose 0 - 6 But dividing into groups of six will leave "leftovers" group A24 vs. B24 at the bottom (a loss for B), so the other four groups will need to win by at least a total of two games. So Foxy might prefer to mix, say, three tied groups with one winning group and the "leftovers" group for a net win of one game. The very easiest way is to pay no attention to the margin of the win/loss per group, and just mix the groups so there are more winning groups than losing/tied groups. This is similar to the method of extending the group of nine, but with smaller groups it becomes easier (for me, anyway) to mix-and-match for any arbitrary total number of games while avoiding exceeding the desired point spread. I am delighted to see your Puzzling Adventures now appearing in Scientific American! Genny Engel genny@webhabitat.com or asta@sonic.net ------_=_NextPart_001_01C0CC62.EA8EC3E0 Content-Type: text/html; charset="iso-8859-1"
I just read your answer to "Foxy" in the May issue.  I had a come up with a somewhat different pattern.
 
Since the maximum point spread desired was 10 points, it seemed to me the easiest thing would be to divide each team into small groups of five or six.  Then, have each group play its same-numbered counterpart.  That way you ensure the point spread stays narrow.
 
Once the team is divided into small groups, Foxy can play mix-and-match with the groups to arrange  wins or losses or ties.  For example, to win:
 
A0 vs. B4 - A wins
A1 vs. B5 - A wins
A2 vs. B0 - B wins
A3 vs. B1 - B wins
A4 vs. B2 - B wins
A5 vs. B3 - B wins
 
To tie:
 
A0 vs. B0 - A wins
A1 vs. B5 - A wins
A2 vs. B4 - A wins
A3 vs. B1 - B wins
A4 vs. B2 - B wins
A5 vs. B3 - B wins
 
For each group of six, the choices Foxy has are:
 
1) win 4 - 2
2) tie
3) lose 2 - 4
4) lose 1 - 5
5) lose 0 - 6
 
But dividing into groups of six will leave "leftovers" group A24 vs. B24 at the bottom (a loss for B), so the other four groups will need to win by at least a total of two games.  So Foxy might prefer to mix, say, three tied groups with one winning group and the "leftovers" group for a net win of one game.   The very easiest way is to pay no attention to the margin of the win/loss per group, and just mix the groups so there are more winning groups than losing/tied groups. 
 
This is similar to the method of extending the group of nine, but with smaller groups it becomes easier (for me, anyway) to mix-and-match for any arbitrary total number of games while avoiding exceeding the desired point spread.
 
I am delighted to see your Puzzling Adventures now appearing in Scientific American!
 
Genny Engel
 

 
 
 
 
 
 
------_=_NextPart_001_01C0CC62.EA8EC3E0-- Reader Solutions to the Inheritance Puzzle The following readers matched Ecco and Liane's solutions: Greg Smith, Onno Waalewijn, Tom Dinger, and Patrick R. Schonfeld. Their answers included good arguments for why Ecco and Liane's solutions are probably the best possible. Richard W. Lipp noted ``... what I find most intriguing is that it is more complex than initially apparent. I have not had a lot of time to address this one, but time I have spent has produced spectacular failures.'' He then went on to describe heuristics that stubbornly refused to work. Reader Solutions to the Joints Problem The following readers matched or improved upon Dr. Ecco's solution to the Joints problem: Burghart Hoffrichter, Earl Paddon, Pearl Pauling, Jean-Francois Halleux, and Alan E. Dragoo. Alan's solution was the best I've received so far. Whereas Ecco was able to establish 34 adjacency guarantees, Dragoo's solution was able to establish 15 additional ones. His design involved 5 levels. The first was 4 by 3 but with three missing blocks. The second was 4 by 3. The third was 4 by 3. The fourth was 3 by 3 with an extra block. The fifth was 5 by 2 with many gaps (5 blocks in total). Clever guy. (1,1,2,L) (1,2,1,E) (1,2,2,L) (1,2,3,A) (1,3,1,E) (1,3,2,E) (1,3,3,E) (1,4,2,E) (1,4,3,A) (2,1,1,E) (2,1,2,H) (2,1,3,A) (2,2,1,E) (2,2,2,I) (2,2,3,A) (2,3,1,N) (2,3,2,J) (2,3,3,A) (2,4,1,C) (2,4,2,B) (2,4,3,A) (3,1,1,E) (3,1,2,O) (3,1,3,A) (3,2,1,E) (3,2,2,K) (3,2,3,A) (3,3,1,F) (3,3,2,F) (3,3,3,A) (3,4,1,C) (3,4,2,C) (3,4,3,A) (4,1,1,E) (4,1,2,M) (4,1,3,M) (4,2,1,E) (4,2,2,G) (4,2,3,G) (4,3,1,E) (4,3,2,D) (4,3,3,D) (4,4,2,C) (5,1,2,C) (5,2,2,C) (5,3,1,E) (5,3,2,C) (5,4,2,C) Original: ("A (10) --- B C D E F H I J L M " "B (2) --- A C " "C (6) --- A B D E G M " "D (5) --- A C E F G " "E (11) --- A C D F G J K L M N O " "F (5) --- A D E J N " "G (4) --- C D E K " "H (3) --- A I L " "I (4) --- A H J L " "J (4) --- A E F I " "K (3) --- E G O " "L (4) --- A E H I " "M (3) --- A C E " "N (2) --- E F " "O (2) --- E K ") "total is 68" A: + G K C: + O D: + I N E: + I H: + G I: + E D G: + A H K: + A N: + D O: + C Pearl Pauling -- 84 (1,1,1,N) (1,1,2,E) (1,1,3,E) (1,1,4,E) (1,2,1,E) (1,2,2,E) (1,2,3,O) (1,2,4,E) (1,3,1,E) (1,3,2,E) (1,3,3,E) (1,3,4,E) (1,4,1,E) (1,4,2,E) (1,4,3,M) (1,4,4,C) (2,1,1,F) (2,1,2,D) (2,1,3,D) (2,1,4,G) (2,2,1,F) (2,2,2,J) (2,2,3,K) (2,2,4,G) (2,3,1,L) (2,3,2,I) (2,3,3,E) (2,3,4,C) (2,4,1,L) (2,4,2,H) (2,4,3,M) (2,4,4,C) (3,1,1,A) (3,1,2,A) (3,1,3,C) (3,1,4,C) (3,2,1,A) (3,2,2,A) (3,2,3,B) (3,2,4,C) (3,3,1,A) (3,3,2,A) (3,3,3,A) (3,3,4,C) (3,4,1,A) (3,4,2,A) (3,4,3,A) (3,4,4,C) I guess I did get some connections you didn't get... Here's how mine matches up: A - B C D E F H I J L M B - A C K C - A B D E G M D - A C E F G J K E - A C D F G H I J K L M N O F - A D E J L N G - A C D E K H - A E I L M I - A E H J L J - A D E F I K K - B D E G J O L - A E F H I M - A C E H N - E F O - E K Jean-Francois Halleux: total of 90. (1,1,1,E) (1,1,2,E) (1,2,2,E) (1,2,3,E) (1,3,2,E) (2,1,1,E) (2,1,2,A) (2,1,3,A) (2,1,4,A) (2,2,1,F) (2,2,2,F) (2,2,3,J) (2,2,4,A) (2,3,1,C) (2,3,2,D) (2,3,3,D) (2,3,4,A) (2,4,1,C) (2,4,2,C) (2,4,3,A) (2,4,4,A) (3,1,1,E) (3,1,2,E) (3,1,3,A) (3,2,1,N) (3,2,2,K) (3,2,3,I) (3,3,1,G) (3,3,2,G) (3,3,3,H) (3,4,1,C) (3,4,2,C) (3,4,3,A) (4,1,1,E) (4,2,1,E) (4,2,2,O) (4,2,3,L) (4,3,1,E) (4,3,2,E) (4,3,3,L) (4,4,1,C) (4,4,2,B) (4,4,3,A) (5,3,2,E) (5,3,3,M) (5,4,1,C) (5,4,2,C) (5,4,3,M) Adjacency list -------------- A -- BCDEFHIJLM B -- AC +E C -- ABDEGM +F D -- ACEFG +HJ E -- ACDFGJKLMNO +B F -- ADEJN +CK H -- AIL +DG I -- AHJL +K J -- AEFI +D L -- AEHI +MO M -- ACE +L G -- CDEK +HN K -- EGO +FIN N -- EF +GK O -- EK +L Locations of cubes: Alan E. Dragoo ADragoo@aol.com total is 98 (1,1,2,L) (1,2,1,E) (1,2,2,L) (1,2,3,A) (1,3,1,E) (1,3,2,E) (1,3,3,E) (1,4,2,E) (1,4,3,A) (2,1,1,E) (2,1,2,H) (2,1,3,A) (2,2,1,E) (2,2,2,I) (2,2,3,A) (2,3,1,N) (2,3,2,J) (2,3,3,A) (2,4,1,C) (2,4,2,B) (2,4,3,A) (3,1,1,E) (3,1,2,O) (3,1,3,A) (3,2,1,E) (3,2,2,K) (3,2,3,A) (3,3,1,F) (3,3,2,F) (3,3,3,A) (3,4,1,C) (3,4,2,C) (3,4,3,A) (4,1,1,E) (4,1,2,M) (4,1,3,M) (4,2,1,E) (4,2,2,G) (4,2,3,G) (4,3,1,E) (4,3,2,D) (4,3,3,D) (4,4,2,C) (5,1,2,C) (5,2,2,C) (5,3,1,E) (5,3,2,C) (5,4,2,C) Connections: A - BCDEFGHIJKLMO B - ACEJ C - ABDEFGHIJMN D - ACEFG E - ABCDFGHIJKLMNO F - ACDEJKN G - ACDEKM H - AEILO I - AEHJKL J - ABEFIN K - AEFGIO L - AEHI M - ACEGO N - CEFJ O - AEHKM Reader Solutions to Laser Shuttles Dr. Ecco's solution for Laser Shuttles was not the best possible. Fortunately, several clever readers found better ones. In the best solutions, no astronaut will be required to take more than 3 hops to go from site to site and the total number of edges is 45. Alan Dragoo's solution is a nice example. (http://members.aol.com/adragoo/laser.jpg) Burghart Hoffrichter pointed out: ``by counting the number of horizontal and vertical edges in each rectangle and one diagonal per rectangle and the sides of the triangles, one sees that 45 is the maximum number of non-intersecting edges.'' Brian Nelson thought that deregulation might bring about a reduction in the number of edges. Kees Rijnierse suggested that putting the stations slightly off the grid might make even better solutions possible, but did not know how. Denis Birnie of Transportation & Traffic Systems Ltd in Christchurch, New Zealand suggested several other optimization criteria. Among them: Is there a 4-hop-to-anywhere network such that every journey can be completed by at least 2 routes with only the start and end stations in common? If not, is there a 4-hop primary & 5-hop secondary network? Other readers who demonstrated 45 edge/3 hop designs were: C. Brock Rooney, Pearl Pauling, Rodney Meyer, Peter Scholz, Brian Nelson, Tapani Lindgren, Todd Ginsberg, Ted Alper, Mike White, Vernon R. Brown, Stephen A. Slezic, Kiia Kallio, Tom Rokicki, Matthew D. Ahl, Andy W. Desplenter, Mark Taylor, Kees Rijnierse, Forest Wilkinson, and Doug Newhort (who minimized the average length as well, http://members.home.net/dmewhort/3hub.htm), Still others demonstrated 45 edge/4 hop designs: James Waldby, Christopher W. Curtis, Burghart Hoffrichter, Jason Patterson, Douglas Price, Magne Oestlyngen, John Porter, Bob Morton, Greg Smith, Kees Rijnierse, Denis Birnie, Carey Bingham, Kevin Fox, Steve Bourassa, David Stevenson, Jeffrey A. Hallman. and John Grant. Reader Solutions for Lines of Fire: Several readers showed that if Solo can occupy three hills to begin with, there are 40 such sets that can fire upon all other hills. When Solo can occupy two hills to begin with, there are several pairs that work. Finally, when Solo can occupy only one hill to begin with, he cannot accomplish his mission. Here is the proof following a combination of the formulations of Ralph Nebiker, Michael S. VanVertloo, and Christian Tanguy. Define a safe hill as one that can fire upon all hills that can fire upon it. Both 0 and 16 are safe and the adversary will be able to capture at least one of them after Solo's first move. In either case, the adversary will later be able to capture another hill that will give the adversary control over 18 hills. This is enough to prevent Solo from accomplishing his mission. Solutions to the three were given by Ralph Nebiker Gary Knowles Bill Wade Kakulidis Iulianos Mathew Davies Christian Tanguy Thorsten Koch Michael S VanVertloo Russ Lyttle (who used colored paper and transparencies instead of a computer) ================== detailed solution notes Ralph Nebiker: First: There are 40 sets of three hills, when occupied, that can fire upon all other hills. They are: 1-4-(8, 14, 15) 1-5-(14, 15) 1-(6, 8, 14, 15, 18)-23 2-6-17 4-6-(8, 20, 24) 4-8-10 4-13-24 4-14-20 4-15-(17, 24) 4-16-17 4-17-20 4-18-20 5-6-20 5-8-10 5-13-24 5-14-(22, 24) 5-15-24 5-16-17 5-19-21 6-8-23 6-20-23 6-23-24 8-10-23 8-13-23 10-18-23 13-14-23 13-18-23 13-23-24 16-17-23 So if Solo can occupy three hills on his initial thrust he controls the valley. Second: He introduced the idea of a self-protective hill. These are hills that once occupied guarantee the survival of the occupant because the hill can fire upon all hills that can fire upon it. He used this idea to show that if Solo occupies either 4 and 24 or 5 and 14 on the first two moves, he can control a sufficient number of hills to accomplish the mission. Third: In order to prove Capt Solo can't accomplish his mission of destroying the factories in an alternating move situation starting with just one hill on the initial thrust, he showed that the adversary can safely fire upon 16 or more hills. On Solo's first move he can occupy a hill which covers hill 16 (including 16 itself) or which doesn't. The easy part: If Solo doesn't cover hill 16 and the adversary occupies it the adversary immediately controls 15 hills. There is no combination of moves Solo can put together in two moves that would prevent the adversary from being able to occupy at least one more self-protective hill and thus limit Solo access to less than ten hills - a winning move for the adversary. Again, Solo must use a self-protective hill to cover hill 16. If he doesn't, the adversary can occupy a hill which will destroy Solo's first move and place Solo in the position of the adversary - and unable to occupy 10 hills. The self-protective hills which cover hill 16 are 4, 6, 10, 14, and 16. Strategy. Solo's Adversary's Whatever Solo's second move, at Move Move least one of these hills is open. 4 10 0, 6, 24 6 0 10, 4, 5 10 0 5, 6 14 0 10, 11, 12 16 0 5, 23, 24 For the non-self-protective hills: 1 4 5, 6 2 0 4, 24 (0 also fires on 2!) 3 0 4, 24 13 4 5, 14 15 0 21, 23, 24 17 4 5, 6 19 4 5, 6, 10 22 4 5, 6 Any of the adversary's two move combinations above (except 4-5) limit Solo to less than ten hills. The 4-5 combination alone doesn't deny access to ten hills, but all of 4, 5, 11, 12, and 23 are self protective, and once the 4-5 combination is made, 11, 12, and 23 can be occupied because 5 protects 11, 12, and 23 as well. All five together, 4-5-11-12-23, limit Solo to 8 hills. ====== Christian Tanguy: c) the conditions given in your column exclude a winning strategy for the attacking side. 1) It is not possible to prevent a second move by the defending side. Proof: 22 is the maximum number of hills that can be controlled by two hills i and j (referred to as {i,j}), {1,23} in fact. [ of course, i and j "control" the hills they occupy ] This leaves a minimum of 3 hills which can be occupied by the defense. 2) let us now consider the defense point of view. We can compute for each hill i0 the MINIMUM number of hills N(i0) controlled by {i0,k}, where k is any other hill among the 25. I merely give here the i0 -> N(i0) when N(i0) is less than 10: 1 -> 9 20 -> 9 0 -> 8 6 -> 8 10 -> 8 13 -> 8 16 -> 7 3) therefore, in order to win, the attack must absolutely prevent the occupation of hills {0, 1, 6, 10, 13, 16, 20} by its very first move. 4) we compute for each hill i0 the set of hills T(i0) which can fire on it [T(i0) includes {i0}]. The first move of the attacker must be the intersection of all the T(i0) with i0 =3D 0, 1, 6, 10, 13, 16, 20. 5) the intersection of T(6), T(10), T(13) and T(20) is the empty set. Thus, the attacker is forced to make a losing first move. ================= Michael S VanVertloo: To prevent the player from meeting his goals, the opponent must be able to prevent the player from taking at least 16 hills, or be able to fire on one of the player's tanks. We can assume that the player plays intelligently, and does not make an attempt to end the game by placing a tank where it can be fired upon. Define a "firing set" of a set of hills S to be the set of all hills where : 1) a hill is in S 2) a hill that can be fired upon by a hill in S Therefore, if a player controls the set of hills S, his opponent cannot place a tank on any hill in the firing set of S. While the opponent is not limited to the spaces on which he can place a tank (provided it cannot be fired on presently), the other player must think ahead about which hills to take. For example, if the player takes hill # 1, the game is over, because the opponent can take hill # 6 and the conditions fail. Therefore, the player is limited to a few "safe" hills (those hills which can fire upon all hills that can fire on it). Below is a list of what hills are safe, and if a hill is unsafe, what hills make it unsafe : 0 is safe. 1 is not safe. {6} 2 is not safe. {0, 1, 6, 10, 15, 20} 3 is not safe. {0, 1, 6, 10, 15, 20} 4 is safe. 5 is safe. 6 is safe. 7 is not safe. {0, 6, 10, 13, 16} 8 is not safe. {12} 9 is not safe. {0, 1, 6, 10, 13, 16} 10 is safe. 11 is safe. 12 is safe. 13 is not safe. {4} 14 is safe. 15 is not safe. {24} 16 is safe. 17 is not safe. {12} 18 is not safe. {12} 19 is not safe. {7, 9, 11, 23} 20 is not safe. {7, 11, 23} 21 is safe. 22 is not safe. {2, 3, 4, 7, 9, 11, 23} 23 is safe. 24 is safe. Note that an unsafe hill could become safe if the hills listed in braces are to remain neutral or are aligned with the party wishing to take the unsafe hill. As you can see, hill # 0 is safe, and hill # 16 is safe. There are no safe hills (on the first turn) that can be taken to prevent the opponent from taking either hill # 0 or hill # 16. The player can only prevent the opponent from taking one of them. Also, we know that all safe 2-hill combinations must fire on less than 22 hills. (There is one combination {1, 23}, that can fire on 22 hills, but 1 is unsafe, and 23 cannot fire on 6 to make 1 safe.) Assume that, depending on the player's first move, the opponent chooses either hill # 0 or hill # 16. There is no second move that can prevent the opponent from placing at least one more tank. The sizes of the firing set for {0, *} and {16, *} are below : 0 and 1 result in set size 19. 0 and 2 result in set size 19. 0 and 3 result in set size 18. 0 and 4 result in set size 20. 0 and 5 result in set size 19. 0 and 6 result in set size 19. 0 and 7 result in set size 18. 0 and 8 result in set size 18. 0 and 9 result in set size 17. 0 and 10 result in set size 18. 0 and 11 result in set size 18. 0 and 12 result in set size 18. 0 and 13 result in set size 18. 0 and 14 result in set size 19. 0 and 15 result in set size 19. 0 and 16 result in set size 20. 0 and 17 result in set size 17. 0 and 18 result in set size 18. 0 and 19 result in set size 18. 0 and 20 result in set size 17. 0 and 21 result in set size 18. 0 and 22 result in set size 18. 0 and 23 result in set size 19. 0 and 24 result in set size 18. 16 and 0 result in set size 20. 16 and 1 result in set size 19. 16 and 2 result in set size 19. 16 and 3 result in set size 18. 16 and 4 result in set size 19. 16 and 5 result in set size 19. 16 and 6 result in set size 19. 16 and 7 result in set size 19. 16 and 8 result in set size 19. 16 and 9 result in set size 18. 16 and 10 result in set size 19. 16 and 11 result in set size 19. 16 and 12 result in set size 20. 16 and 13 result in set size 19. 16 and 14 result in set size 19. 16 and 15 result in set size 18. 16 and 17 result in set size 21. 16 and 18 result in set size 19. 16 and 19 result in set size 20. 16 and 20 result in set size 18. 16 and 21 result in set size 18. 16 and 22 result in set size 18. 16 and 23 result in set size 20. 16 and 24 result in set size 20. Reader Solutions to Mapcraft: Some smart readers showed up Dr. Ecco and Liane again with this one. The problem was to find the minimum number of population exchanges to ensure that each group constituted a connected component. The fact is that I know of no algorithm to solve this problem. Nor does Ecco. So, readers who solved it did so by cleverness. For starters, Bruce Wilson and John Porter showed that the sample example in the text of the puzzle could be solved in four exchanges. (4 0) (0 1) (0 4) (4 3) (2 1) (0 3) (1 1) (4 4) producing a grid like this: 2 2 2 2 2 1 1 1 1 2 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 He discovered this solution by ``analyzing the switches made by Liane for redundancy and for pieces that would have been OK in their starting position.'' For the main puzzle, Ecco and Liane had a solution with 15 exchanges. The following clever readers found solutions with 14 exchanges: Phil Goodwin John Porter Chree Haas Michael.S.VanVertloo Igor Pavlovic Charles.Taylor Ben Ziegler Matteo Salsilli Iulian Kakulidis Michael Vielhaber Then, some even more clever people found 13 move exchanges. Ernst Munter John Holland Phil Goodwin Nicholas Sakurai Ralph Nebiker Michael Scheetz Kassim Gora I present Ralph's solution, because it was the first I received. [Dr. Dobbs: Please keep this format] Final arrangment Flips to achieve it 0 1 2 3 4 5 6 7 8 9 Switchs 0 0 0 0 0 0 0 0 0 0 0 0,3 6,2 1 2 2 2 2 0 0 0 0 0 0 2,6 9,0 2 2 2 1 2 2 2 0 0 1 0 2,5 6,0 3 2 2 1 1 1 2 0 1 1 0 9,1 4,5 4 1 1 1 2 2 2 0 1 1 1 0,8 8,1 5 1 2 1 2 2 0 0 1 1 1 0,5 9,5 6 1 2 1 2 0 0 1 1 1 1 6,1 0,6 7 1 2 1 2 0 0 1 1 1 1 4,7 8,3 8 1 2 2 2 2 2 2 2 2 1 3,8 8,5 9 1 1 1 1 1 1 1 1 1 1 2,9 8,6 1,4 9,8 7,4 7,8 1,9 5,9 Finally, Steve Worley suggested the following problem: suppose the only possible exchanges were between neighboring villages. What would the best answer be then? Reader Solutions for the Mates Problem: Readers verified that the best solution with the original scoring was: tent 1: alan,mike tent 2: dave,isaac,larry tent 3: emily,gwenyth,hillary tent 4: bob,carol,jack,nick tent 5: felicia,kris,olivia,petra yielding a total score of 175. For the case when the campers' preferences dropped by 4 points (among those with expressed preferences), the best assignment was: tent 1: alan,issac tent 2: carol,jack,nick tent 3: kris,larry,mike tent 4: bob,felicia,olivia,petra tent 5: dave,emily,gwenyth,hillary yielding a total score of 92 (better than the one Dr. Ecco revealed). Paolo Friedli wondered what Dr. Ecco would have done if there had been 60 kids and 20 tents. I suggested simulated annealing, but there are some excellent genetic algorithm readers out there. For example, Mike Williams suggested the following genetic style technique: arbitrarily assign people to tents calculate and store happiness repeat randomly move some people around calculate potential happiness if better than previous best store best and update current configuration until tired of trying Readers who solved this problem include: Gary Knowles Michael S. VanVertloo Andrew Lipson (who considered the problem a bit easy) Terrence E Vaughn Roger Alley Jean-Francois Halleux Greg Walker Jack Boudreau Mathew Davies (who thought that Dr. Ecco might be suggesting film titles) Carl Smotricz Earl Paddon Onno Waalewijn Yannick Heneault Scott McKinney Iulian Kakulidis Michael Williams Manuel Alvarez Fernandez Tamas Visegrady Paolo Friedli Franco Venturi (who also showed that the maximum two day score if one can't change bunkmates is 262) Reader Solutions to the Microvirus problem First, after taking a few liberties with the biology, I also neglected to tell you about some special cases. The r3 restriction enzyme will not cut every pair of Ts. In particular: if r3 sees TTT, it will cut this as T TT. If r3 sees TTTT, it will cut this as T TT T. If r3 sees TTTTT, it will cut this as T TT TT. Further, there is the potential for an interaction between the enzyme for CT and the one for TT, so you should know that the three enzymes will cut: CTT into C, T, T; CTTT into C, T, TT; CTTTT into C, T, T, TT; CTTCT into C, T, TC, T; and CTTTCT into C, T, TT, CT. With some subset of these hints, the following clever readers found one or more solutions: Onno Waalewijn, David Cox, Patrick R. Schonfeld, Malcolm Rowe, and David Curran. Patrick had a simple explanation for his basic method: "For the short sequence, I simply generated all valid permutations: all permutations in which T follows C, G follows A, and T follows T. Then for each valid permutation, I calculated the r1,r2,r3,r1/r2,r1/r3,r2/r3 cut sizes, and discarded all permutations whose cut sizes did not match the correct ones." His method for the long sequence started with r2 cuts. Malcolm and Patrick both found four solutions for the second problem, which they believe is all there are. First sequence: T-TCCATC-TC-TA-GA-GTCCGTC-TC-TCACACGGC-TCGCACACGGA-GATA-GC-TC T-TCCATC-TC-TA-GA-GTCCGTC-TCACACGGC-TC-TCGCACACGGA-GATA-GC-TC Second sequence: GGA-GT-TACGGCCCCGA-GT-TGGTGT-TACA-GT-TATCGCGAC-T-TT-TTACATGTC-TGGAA-GGCGGA-GGT-T ATGCGAA-GGACGTC-T-TTA-GC-TA-GCCGCGATCCAT-TCGTATA GGA-GT-TACGGCCCCGA-GT-TGGTGT-TACA-GT-TTACATGTC-T-TT-TATCGCGAC-TGGAA-GGCGGA-GGT-T ATGCGAA-GGACGTC-T-TTA-GC-TA-GCCGCGATCCAT-TCGTATA GGA-GT-TGGTGT-TACA-GT-TACGGCCCCGA-GT-TATCGCGAC-T-TT-TTACATGTC-TGGAA-GGCGGA-GGT-T ATGCGAA-GGACGTC-T-TTA-GC-TA-GCCGCGATCCAT-TCGTATA GGA-GT-TGGTGT-TACA-GT-TACGGCCCCGA-GT-TTACATGTC-T-TT-TATCGCGAC-TGGAA-GGCGGA-GGT-T ATGCGAA-GGACGTC-T-TTA-GC-TA-GCCGCGATCCAT-TCGTATA Reader Responses to the Mint Puzzle The reader responses to the Mint puzzle gave me great pleasure. Not only did I see many solutions that improved on Ecco's, but several readers noted the obvious applications of a rational coinage. Martin Brown of Belgium observed: "It might interest you to know that the Belgian currency goes 1/2, 1, 5, 20, 50, which as you can imagine leads to pockets full of change." Harm T. Voordenhout of the Netherlands thinks this question has continental applications: "I had been asking myself the same question for about two years ago. The coming of the euro which would replace a lot of coins in Europe got me wondering about which system of coinage would be the best." The following readers all improved on various aspects of Dr. Ecco's solution: Alexander Enzmann, Austin Gilbert, Jon Beal, Tomas G. Rokicki, Patrick R. Schonfeld, David Stevenson, Steve Kietzman, Martin Brown, Harm Voordenhout, Rodney Meyer, and Jimmy Hu. However, the best overall solutions, in terms of completeness and original extensions, came from Ted Alper. Here were his solutions, some of which were equaled by other readers: For three coins: If you insist on intuitive exchances, the best average you can get is 5.3131... you can do this with denominations (1,5,22) (that is, with 1-cent, 5-cent, and 22-cent coins), but if you allow non-intuitive denominations, you can achieve 5.2020... with denominations (1,12,19) And if you allow EXCHANGES you can have an average exchange number of 3.9191... with (16,19,21) [Dr. Dobb's: please keep formatting] FOUR COINS: Best Intutitive Average is: 4.1414 Achieved with: (1,3,11,37). Best Non-Intutitive Average is: 3.9293 Achieved with: (1,5,18,25) EXCHANGE: Best Exchange Average: 3.1212 Achieved with: (13,28,32,33). FIVE COINS: Best Intutitive Average is: 3.4949 Achieved with: (1,3,7,16,40). Best Non-Intutitive Average: 3.3232 Achieved with: (1,5,16,23,33). EXCHANGE: Best Exchange Average: 2.7273 Achieved with: (13,24,30,32,33). SIX COINS: Best Intutitive Average is: 3.1616 Achieved with: (1,2,5,11,25,62). Best Non-intuitive Average: 2.9495 Achieved with: (1,4,6,21,30,37) EXCHANGE: average of 2.5151 Achieved with: (1,8,21,38,44,49) He showed by comparison to the optimum possible that his solution is best: "For 6 coins, exchanging for the values 1...99: at most 6 values can be done with only 1 coin You can get at most (6*5)/2 + 6 = 21 different possible values with 2 coins (no exchange) and at most and another 15 values with exchanges of size 2 (bigger - smaller). So in the best case, in which ALL the remaining values take 3 coins, you'll have a total number of coins required of 1*6 + 2*(21+ 15) + 3*(99 - 6 - 21 - 15) = 6 + 2*(36) + 3*(57) = 6 + 72 + 171 = 249 which is achieved with the coin sets I already computed." Here were Alper's solution when each coin was worth a multiple of 5 cents. THREE COINS Best Intutitive Average is: 2.5263 Achieved with: (5,15,40) Best Non-Intutitive Average is: 2.5263 Achieved with: (5, 15,40) Best Exchange Average: 2.2105 Achieved with: (5,30,45) -- FOUR COINS Best Intutitive Average is: 2.1579 Achieved with: (5,10,25,60) Best Non-Intutitive Average is: 2.1053 Achieved with: (5,10,30,45) Best Exchange Average: 1.8947 Achieved with: (10,25,65,70). -- FIVE COINS Best Intutitive Average is: 1.9474 Achieved with: (5,10,15,30,65) Best Non-Intutitive Average is: 1.8421 Achieved with: (5,15,25,30,65) Best Exchange Average: 1.7368 Achieved with: (5,10,15,45,80). From martin.brown@pandora.be Fri Nov 17 11:07 EST 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id LAA11031 for ; Fri, 17 Nov 2000 11:07:20 -0500 (EST) Received: from smtp.pandora.be (hercules.telenet-ops.be [195.130.132.33]) by cs.nyu.edu (8.9.1/8.9.1) with SMTP id LAA17689 for ; Fri, 17 Nov 2000 11:07:19 -0500 (EST) Received: (qmail 13348 invoked from network); 17 Nov 2000 16:07:15 -0000 Received: from unknown (HELO pandora.be) ([213.224.172.145]) (envelope-sender ) by hercules.telenet-ops.be (qmail-ldap-1.03) with SMTP for ; 17 Nov 2000 16:07:15 -0000 Message-ID: <3A154980.62F780E8@pandora.be> Date: Fri, 17 Nov 2000 16:06:40 +0100 From: Martin Brown Reply-To: martin.brown@pandora.be Organization: Nezumi X-Mailer: Mozilla 4.74 [en] (Win95; U) X-Accept-Language: en-GB,en-US,nl MIME-Version: 1.0 To: Dennis Shasha Subject: Re: Mint Coins References: <200010241129.HAA29310@griffin.cs.nyu.edu> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 1109 Status: RO Dear Dennis, My PC has been quietly running idle time on the change given problem and gives the following interesting results (where P is total count of coins to do all exchanges 1 to 99) : N Pmin Pactual Coin Sequence 5 262 270 13, 24, 30, 32, 33 6 249 249 13, 24, 27, 32, 33, 49 7 234 234 1, 11, 18, 34, 39, 42, 48 (many solutions) 8 217 219 9, 13, 32, 34, 37, 42, 48, 49 9 198 209 7, 14, 21, 33, 37, 43, 45, 46, 48 10 188 198 8, 16, 24, 36, 38, 41, 42, 45, 47, 51 Beyond 10 coins my algorithm is far too slow. My goal was to find a currency scheme with change given where the mean was 2 and 198/99 = 2. There were several solutions N=10 at P=199 and I was beginning to think that would be it when after a few days it hit a 198. I believe they are global optima, but my search heuristics cannot be fully justified so there might be an isolated solution missed. > Nice work and interesting comment about Belgium. > Dennis Have a good weekend. Best regards, Martin Brown The following clever people all improved on Dr. Ecco's solution for monopoles: Jon Beal, Rodney and Jialin Meyer, Steve Hammer, Richard Lipp, Greg Smith, Pearl Pauling, Ernst Munter, Paolo Friedli, Dennis Cumro, Jean-Francois Halleux, Burghart Hoffrichter, Steve Kietzman, Gene Wagenbreth, Patrick Schonfeld, Tomas Rokicki, Michael Vielhaber, Tom Dinger, Russ Williams, C. Mark Yendt, The best solution for four rooms with a single monopole per room was 66 monopoles altogether as shown first by Ernst Munter with the solution: room 1: 24 26 27 28 29 30 31 32 33 36 37 38 39 41 42 44 45 46 47 48 49 room 2: 9 10 12 13 14 15 17 18 20 54 55 56 57 58 59 60 61 62 room 3: 1 2 4 8 11 16 22 25 40 43 53 66 room 4: 3 5 6 7 19 21 23 34 35 50 51 52 63 64 65 Others who showed that 66 were possible include: Ernst Munter, Paolo Friedli, Steve Kietzman, Gene Wagenbreth, Tomas Rokicki, Paolo Friedli, Michael Vielhaber, Tom Dinger. Tom Dinger also proposed a recursive construction which I closely paraphrase: Take a maximal assignment for n rooms, call it M(n). For n = 1, the maximal assignment is 1 2. Double all the values of the monopoles in the rooms; this will not cause a violation of the problem constraints for those rooms. This results in n rooms, with the even numbers 2..2*M(n) properly assigned. Now, in the one additional room, place the odd-numbered monopoles 1..(2*M(n)+1). This room also satisfies the constraints, because the sum of any two of the monopole values in that room will be even, but no even numbered monopole is in that room. Problem 2 required putting at least 52 monopoles plus 52 spares in some number of rooms without putting a monopole and its spare in the same room. The following readers showed that 7 rooms (not the obvious 8) were enough: Bart Massey, Paolo Friedli, Tomas Rokicki, Tom Dinger, Onno Waalewijn, Bart Massey was able to fit 65 monopoles with spares in those rooms. Here was his design: room 1: 1 3 5 10 14 16 18 20 22 29 31 44 48 50 52 56 room 2: 2 8 12 13 16 27 32 33 38 42 52 room 3: 1 3 5 7 9 11 13 15 17 19 21 23 25 29 35 37 41 43 45 47 49 53 55 room 4: 24 28 30 31 32 33 34 35 36 37 38 39 40 42 44 45 46 48 49 50 51 53 room 5: 4 6 8 9 11 21 23 24 26 39 40 41 56 57 58 59 room 6: 2 6 10 18 19 22 26 27 30 34 43 47 51 54 55 58 59 room 7: 4 7 12 14 15 17 20 25 28 36 46 54 57 In problem 3, spares were allowed to be in the same room as the original monopole, but the monopole constraint (no two monopoles, even ones with the same value, added together could equal the third) still held. Nobody gave a correct solution with fewer than 5 rooms. Tomas Rokicki was able to put 123 monopoles in those five rooms -- an admirable achievement. Room 1: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 56 58 60 62 66 68 97 99 101 103 105 107 109 111 113 115 117 119 121 123 Room 2: 2 6 10 14 18 29 33 37 40 41 45 48 49 52 71 72 75 76 79 83 84 87 91 95 106 110 114 118 122 Room 3: 4 12 20 22 30 36 38 39 54 57 67 70 80 85 86 88 94 104 112 120 Room 4: 8 26 31 32 35 44 47 50 53 59 65 74 77 89 92 93 98 102 116 Room 5: 16 24 28 34 42 43 46 51 55 61 63 64 69 73 78 81 82 90 96 100 108 From tomc@cybernex.net Sat Oct 9 16:37 EDT 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id QAA26723 for ; Sat, 9 Oct 1999 16:37:07 -0400 (EDT) Received: from pop.cybernex.net (pop.cybernex.net [204.141.116.15]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id QAA08377 for ; Sat, 9 Oct 1999 16:37:01 -0400 (EDT) Received: from cybernex.net (dhyp2-147.cybernex.net [207.198.214.147]) by pop.cybernex.net (Mail-clerk/Homer) with ESMTP id QAA21775 user; Sat, 9 Oct 1999 16:34:42 -0400 Message-ID: <37FFA68D.FE346398@cybernex.net> Date: Sat, 09 Oct 1999 16:33:17 -0400 From: Tom Carmichael Reply-To: tomc@fragment.com X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Re: September Puzzle (Monopoles) References: <199910051026.GAA06124@shasha.cs.nyu.edu> Content-Type: multipart/mixed; boundary="------------9C9D1DF84D42AC4D631F8E4B" Content-Length: 468 Status: R This is a multi-part message in MIME format. --------------9C9D1DF84D42AC4D631F8E4B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Just for completeness, I figured I'd send you the results of my full recursion test. My program found a total of 29,931 solutions of fitting 66 monopoles in 4 rooms. Don't know if you care or not, but I'm including a zip file of the output listing them. Again, thanks for the interesting puzzles! Tom Notes on the Panamax Problem The best solutions to the Panamax problem came from Dennis Yelle, Steve Hammer, Nick Knight, and James Waldby. They noted that routing the ship in the opposite direction would make the cost much less, but McLean wants to know the worst case. The first problem was posed by Ecco as follows: The ship is going to 8 ports (numbered 0..7) and has two piles of up to four each. Every port deposits one container that goes to the farthest possible port. What is the smallest overhead (extra moves) per cycle (a visit to all 8 ports in order) that you can manage? Dennis Yelle had a solution that averaged 16 overhead moves per cycle, though the initial pattern repeats itself only after 5 cycles. Steve Hammer proposed another solution having an average of 13 1/3 overhead moves per cycle and whose initial configuration was repeated every three cycles. The overhead varies per cycle from 10 to 15 and again 15. Start with a "Full" ( 7 containers) well-ordered, ship. OH means overhead and the parentheses denote the order of containers. [Dr. Dobb's, please keep formatting] Start with a "Full" ( 7 containers) well-ordered, ship. At 0: ( 1,2,3,4 ) ( 5,6,7 ) At 1, remove 1, put on 0, yielding: ( 2,3,4 ) ( 0,5,6,7 ) At 2, remove 2, put on 1, yielding: ( 1,3,4 ) ( 0,5,6,7 ) At 3, remove 1 (OH), remove 0 (OH), remove 3, move 4 (OH) giving: ( ) ( 4,5,6,7 ) put on 2, put on 1 (OH), put on 0 (OH) yielding: ( 0,1,2 ) ( 4,5,6,7 ) At 4, remove 4, put on 3, yielding: ( 3,0,1,2 ) ( 5,6,7 ) At 5, remove 5, put on 4, yielding: ( 3,0,1,2 ) ( 4,6,7 ) At 6, remove 4 (OH), remove 3 (OH), remove 6, move 7 (OH) giving: ( 7,0,1,2 ) ( ) put on 5, put on 4 (OH), put on 3 (OH) yielding: ( 7,0,1,2 ) ( 3,4,5) At 7, remove 7, put on 6, yielding: ( 0,1,2 ) ( 6,3,4,5) At 0, remove 0, put on 7, yielding: ( 7,1,2 ) ( 6,3,4,5) At 1, remove 7 (OH), remove 6 (OH), remove 1, move 2 (OH) giving: ( ) ( 2,3,4,5 ) put on 0, put on 7 (OH), put on 6 (OH) yielding: ( 6,7,0 ) ( 2,3,4,5 ) At 2, remove 2, put on 1, yielding: ( 1,6,7,0 ) ( 3,4,5 ) At 3, remove 3, put on 2, yielding: ( 1,6,7,0 ) ( 2,4,5 ) At 4, remove 2 (OH), remove 1 (OH), remove 4, move 5 (OH) giving: ( 5,6,7,0 ) ( ) put on 3, put on 2 (OH), put on 1 (OH) yielding: ( 5,6,7,0 ) ( 1,2,3 ) At 5, remove 5, put on 4, yielding: ( 6,7,0 ) ( 4,1,2,3 ) At 6, remove 6, put on 5, yielding: ( 5,7,0 ) ( 4,1,2,3 ) At 7, remove 5 (OH), remove 4 (OH), remove 7, move 0 (OH) giving: ( ) ( 0,1,2,3 ) put on 6, put on 5 (OH), put on 4 (OH) yielding: ( 4,5,6 ) ( 0,1,2,3 ) At 0, remove 0, put on 7, yielding: ( 7,4,5,6 ) ( 1,2,3 ) At 1, remove 1, put on 0, yielding: ( 7,4,5,6 ) ( 0,2,3 ) At 2, remove 0 (OH), remove 7 (OH), remove 2, move 3 (OH) giving: ( 3,4,5,6 ) ( ) put on 1, put on 0 (OH), put on 7 (OH) yielding: ( 3,4,5,6 ) ( 7,0,1 ) At 3, remove 3, put on 2, yielding: ( 4,5,6 ) ( 2,7,0,1 ) At 4, remove 4, put on 3, yielding: ( 3,5,6 ) ( 2,7,0,1 ) At 5, remove 3 (OH), remove 2 (OH), remove 5, move 6 (OH) giving: ( ) ( 6,7,0,1 ) put on 4, put on 3 (OH), put on 2 (OH) yielding: ( 2,3,4 ) ( 6,7,0,1 ) At 6, remove 6, put on 5, yielding: ( 5,2,3,4 ) ( 7,0,1 ) At 7, remove 7, put on 6, yielding: ( 5,2,3,4 ) ( 6,0,1 ) At 0, remove 6 (OH), remove 5 (OH), remove 0, move 1 (OH) giving: ( 1,2,3,4 ) ( ) put on 7, put on 6 (OH), put on 5 (OH) yielding: ( 1,2,3,4 ) ( 5,6,7 ) Steve Hammer and James Walby both had 24 move overhead solutions to the second problem: You have the eight busy ports I mentioned before and four piles each of height 12. Each port sends 6 containers to the farthest port in the cycle. What is the smallest overhead per cycle that you can manage? Here is Walby's solution, where each 6 container group is denoted by a single letter (the letter of its port of destination) and stacks are listed from bottom to top (so EA means A over E): [Dr. Dobb's, please keep formatting] Arrival Cost to Port Stacks Leave Actions to leave A FC EA DB G 0 off A, on H B FC EH DB G 0 off B, on A C FC EH GA D 0 off C, on B D FB EH GA D 1*6 off D, on C, move H E CH FB GA E 1*6 off E, on D, move B F DB CH GA F 0 off F, on E G DB CH GA E 1*6 move A, off G, on F H DB CH EA F 1*6 off H, move C, on G Total 4*6 The question remains open whether sending containers to the farthest port yields the highest overhead. From andrew_ppp@hotmail.com Sat Jul 14 02:01 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id CAA17198 for ; Sat, 14 Jul 2001 02:01:22 -0400 (EDT) Received: from hotmail.com (f215.law7.hotmail.com [216.33.237.215]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id CAA04418 for ; Sat, 14 Jul 2001 02:01:22 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 13 Jul 2001 23:01:22 -0700 Received: from 24.221.162.16 by lw7fd.law7.hotmail.msn.com with HTTP; Sat, 14 Jul 2001 06:01:22 GMT X-Originating-IP: [24.221.162.16] From: "Andrew Palfreyman" To: o__1@hotmail.com Cc: shasha@cs.nyu.edu, andrew_ppp@hotmail.com Subject: Re: Perimeters: questions Date: Fri, 13 Jul 2001 23:01:22 -0700 Mime-Version: 1.0 Message-ID: X-OriginalArrivalTime: 14 Jul 2001 06:01:22.0633 (UTC) FILETIME=[689C7B90:01C10C2A] Content-Type: text/plain; format=flowed Content-Length: 1135 Status: R (Dennis: algorithmic stuff FYI). Me too. I basically located a "sweet spot", and then dithered each point +/- that position, moving the new sweet spot to the local maximum. No fancy gradient ascent; just plain old dithering. In all cases the other two counts are precisely 775 and 100, so I reckon that's it. I want to say "Proof follows", but I don't think I have the patience. Incidentally, the solutions don't use up any perimeter properties of the 76x76 area; it could just as well have been much larger. As a side note, it had crossed my mind that I was the subject of a meta-puzzle when Dennis suggested "collaboration". A sort of Prisoner's Dilemma situation, if you will. Basically, you would quote me a number, and I would have to decide whether or not it was reachable or not. But the longer I failed to reach it, the greater my chance of losing the competition by not submitting an entry. But perhaps you were the "Designated Lying Philosopher"; in which case, I would be happy to submit, say, 3117, and thereby definitely lose! I was therefore very pleased once I started seeing 3119 solutions :). Andrew From o__1@hotmail.com Sat Jul 14 18:32 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id SAA23500 for ; Sat, 14 Jul 2001 18:32:17 -0400 (EDT) Received: from hotmail.com (f37.law12.hotmail.com [64.4.19.37]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id SAA26845 for ; Sat, 14 Jul 2001 18:32:19 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 14 Jul 2001 15:32:18 -0700 Received: from 138.89.84.233 by lw12fd.law12.hotmail.msn.com with HTTP; Sat, 14 Jul 2001 22:32:18 GMT X-Originating-IP: [138.89.84.233] From: "Michael Birken" To: andrew_ppp@hotmail.com Cc: shasha@cs.nyu.edu Subject: Re: Perimeters: questions Date: Sat, 14 Jul 2001 22:32:18 -0000 Mime-Version: 1.0 Message-ID: X-OriginalArrivalTime: 14 Jul 2001 22:32:18.0607 (UTC) FILETIME=[D72223F0:01C10CB4] Content-Type: text/plain; format=flowed Content-Length: 442 Status: R My algorithm was similar, but I used a series of heuristics to try to speed it up. For instance, if the total visible area was less than 2900 or less than the total visible area in the best solution found so far, then the guards tended to repell each other. Depending on other criteria, some tended to attract each other. The movements were governmented by probability and the probabilities were updated by the heuristics. - Mike Rosetta Notes: There were two parts to the puzzle: figuring out the graph isomorphism of the encrypted graph with the template graph, after resolving the errors; and cracking the single substitution code. Several solved the first problem and a remarkably large number solved both. Those who solved both include: Eugene Eric Kim, Earl Paddon, Pearl Pauling, Alan E. Dragoo, Andrey Jivsov, Grulg Bvvlp (encrypted), Bob Angstadt, Sam Stump, Gabin Kattukaran, Robert H. Morrison, Landon Rabern, Andy W. Desplenter, and Jonathan Chen. Those who solved the first part include: Richard W. Lipp, Wesley T. Perkins, Gabin Kattukaran, Christian Tanguy, and Burghart Hoffrichter. Oh, I nearly forgot to mention an important point. Scott Warren, chief scientist of Rosetta, Inc., wrote and said: ``I'm writing to ask you to consider mentioning in a future column that `Rosetta' is a registered trademark of Rosetta Inc.'' Napoleon, watch out. Reader Solutions to the Simple Problem For a game with such simple rules, only a few hardy readers attempted a solution. The two-player game was this: the first player places Xs and the second player places Os on an infinite board. The goal is to get four in a row either vertically or horizontally (diagonally doesn't count). The first players has a clear advantage. The question is: if we make it a rule that the second player wins if he can prevent the first one from winning in 10 moves, then does either side have a winning strategy. Greg Smith was the first to show that the first player could win and Tomas G. Rokicki was the first to show that 8 moves was required. ======== Rokicki further showed that this holds even if the moves are forced to be adjacent (i.e. the first player must always place an x next to an existing x or existing o, except on the very first move). He writes: ``The main trick is, just like in Pente, to always form another open 2, or extend an existing 2, without ever allowing the other player to block and form an open 2 at the same time. There's always a way to do this in the `Simple' game.'' === MIGHT NOT WORK Ted Alper showed by use of a clever tessellation that there is no winning strategy for 5 in a row. Here is the tessellation. A B C C A B D D E E G H F F G H ``That is, two adjacent squares are adjoined to form a "domino"... and two adjacent dominos share the same orientation (whether horizontal or vertical), but the next two dominos in any direction from them will have the OTHER orientation. Any winning position of length 5 must have 2 squares from the same domino. When the first player takes any square, the O player takes the remaining square,'' thus ensuring eternal frustration to the X player. Victor Allis and his colleagues showed in AAAI 1993 that the first player has a forced win if diagonals are allowed. Solutions to the Stars and Starlets Puzzle Several readers improved on Dr. Ecco's solution to this problem. The best solutions, starting with the suggestion of Jon Beal and Chris Young had the following flavor: [there are two fundamentally different solutions disregarding permutations When you disregard simple permutations of the scenes within each day, and of the order of shooting for the first three days, there should be no other answers! ] Scenes Day 1 1 Hacket 6 Thompson McDougal Anderson Scolaro Spring 14 Anderson Scolaro 18 Scolaro McDougal Hacket Thompson Day 2 3 McDougal Scolaro Mercer Brown 9 Casta McDougal Mercer Scolaro Thompson 10 Casta McDougal Scolaro Patt 16 Scolaro McDougal Casta Mercer 17 Scolaro Patt Brown Day 3 2 Patt Hacket Brown Murphy 5 Mercer Anderson Patt McDougal Spring 11 Patt 12 Hacket Thompson McDougal Murphy Brown 15 Thompson Murphy McDougal Patt Day 4 4 Casta Mercer 7 Casta Patt 8 Mercer Murphy 13 Hacket Murphy Casta Patt 19 Casta This gives a total of $3,341,440 for actors' fees (a substantial savings over the original cost of $4,975,360). Other readers with similarly excellent solutions (i.e. that gave the same actor fee total) included: Thomas Cloutier, Tomas G. Rokicki, Jason Strickland, Onno Waalewijn, Christian Grigis, Paolo Friedli, Tom Dinger, Charles Taylor, Alan Dragoo, Geoffrey Probert, Patrick R. Schonfeld, and Frank Adrian. Several clever readers improved on Dr. Ecco's solution but left some unnecessary actor fees relative to the Young et al. solution: Greg Smith, Jeff Hafner, Nick Knight, Craig Stevenson, Philip Staite, Earl Paddon, Charles E. Killian II, Pike Enz, Jason Strickland, Paul Gerken, Sy Wong, and Geoffrey Probert. Reader Solutions to the Sticks Problem General Collins in fact presented a slight inconsistency regarding the stick mines, which Ecco ignored in his solution. The dimensions given by the general work for a park that is 7/8 kilometer tall rather than 1 kilometer tall. With the dimensions given, either K, J, I, V and G would not be on the edge of the park or C, X, F, E and D would not be. If the park is indeed 7/8 kilometer tall, then there are also some redundant hints, mostly vertical: Q is 2 above P, O is 2 above B, M is 3 above X, I is 1 above W, W is 3 above L, A is to the left and downward of P, and C is to the right and downward of A. With the correction to 7/8 of a kilometer there is only one solution. Otherwise there are an infinite number involving vertical translation. Some readers found other inconsistent constraints to drop, resulting in moving some points. A salute to all these clever readers: John A. Trono, Pike Enz, Tom Carmichael, Russ Williams, Pearl Pauling, Eden Mei, Andrew Palfreyman, Steven Bryant, Tomas G. Rokicki, Alan E. Dragoo, Dennis Yelle, Greg Smith, Jonathan Chen, Burghart Hoffrichter, Jimmy Hu, Christopher Creutzig, and Paolo Friedli. From: "David Berson" From: "Prof. Dr. Michael Vielhaber" Several readers told me they thought the subway puzzle was too easy. Naturally, I apologized. When writing this column, I realized that at least some respondents had simplified the problem for themselves by assuming that there is a train ready to depart at every station at every moment. (That simplification makes the problem beyond easy!) Another simplification was to ignore the time to switch trains. Still, hats off to those readers who beat Dr. Ecco in their answers to the first two problems. The first such correct answer I received was from Alan E. Dragoo. Who proposed a method for dropping 13 stinky postcards off in 140 minutes after getting some extra sleep (and, ominously, acting closer to rush hour): A nasty person can drop postcards at 13 stations in 140 minutes by boarding the special train at station (2,4) at 7:40, arriving at (0,0) at 8:30. He/she then boards the eastbound train at 8:40 and disembarks at (0,3) at 9:10. Finally, she/he boards the southbound train at 9:20 and arrives at (4,3) at 10:00. I know of no solution that works (without the above simplifications) when the poster begins at 6 AM. Alan also sent in one of many good 19 station/240 minute solutions: Starting at (0,0) at 6:00, he/she takes the special train to (2,4) at 6:50; takes the 7:00 westbound train to (2,1) at 7:30; switches to the northbound train at 7:40, arriving at (0,1) at 8:00; 8:10 east to (0,3) at 8:30; 8:40 south to (4,3) at 9:20; and 9:30 west to (4,0) at 10:00. Others who found a way to deliver postcards to 19 stations in 240 minutes include Tom Dinger, Tamas L. Visegrady, B. Hoffrichter, and Charles Taylor. Solutions to the Sultan's Problem: Several readers matched or improved upon Liane's solution to the Trains for the Sultan problem, including Dr. Burghart Hoffichter, James Waldby, Chris Rosenbury, and D. F. Curran. Several other solutions used Hasan's layout, but improved the scheduling by causing trains to wait at certain stations, thus leaving the tracks clearer. James Waldby found a solution to the first problem (50 people trains) that reduces the time from 105 minutes (Liane's solution) to 90 + 3 epsilon where epsilon is the time to wait. An asterisk represents that epsilon time. For convenience, let's make epsilon be one minute. Typical trains do two minute stops. start time route taken 0 AEF, wait one minute, FBCBG 0 BAEFBAE 0 CBD DBC**CBD 0 DBCBD, wait two minutes, DBC 0 EFBAEFB 1 FBAEFBA 2 GBAE, wait one minute, EFBD Chris Rosenbury proposed the following when five trains can carry 150 passengers. The goal is to reduce the size of station B to two platforms by staggering train departures. start time route taken 0 EFBD (150 people) 0 AE, wait 15 minutes, then EF (150 people) 0 FBAE (150 people) 0 GBA (50 people) 5 CBG (50 people) 10 CBD (150 people) 10 DBC (150 people) 15 FBC (50 people) D. F. Curran (DFCurran@aol.com) proposed a different layout with 6 tracks instead of 7 and two extra platforms in station C. He further proposed switches in the middle of a track to allow trains travelling in the opposite direction to pass one another in the middle of a track. (In Zurich, two-way traffic on one track is accomplished by building a short stretch of two tracks in the middle. Trams moving in the opposite direction are timed so they pass each other at exactly this section of track.) He was then able to show that 60 minutes was enough. Reader Solutions to the Fair Swedes Problem Many readers found correct solutions to the Gutoldenborg map problem, most by ``sitting at the kitchen table and scribbling'' as one reader put it. Others used genetic algorithms, gradually refining the solution. Still others used exhaustive search, but more on that later. Finally, Joe Celko managed to find a solution in SQL, amazing! These readers sent me solutions: Juan Pancorbo, Kerry D. Millen, Pearl Pauling, Ralph Nebiker, Blaine Deal, Scot Billman, Michael S. VanVertloo, Jimmy Hu, Roger Alley, Michael Goldberg, Burghart Hoffrichter, Ernst Munter, Odd Tangen, Mike Robinson, John "Goodboy" Holland, Serguei Patchkovskii, Friedrich von Solms, Franco Venturi, Mark J. Murphy, Jeff Gerald, James Heginbottom, Bill Rooney, Jean-Philippe Langlois, and Bryan S. McDaniel. As Ralph Nebiker wrote: This could be a really difficult problem if the boundary conditions and populations weren't quite so well defined. So, I decided to pursue that angle and persuaded some respondents to try to find 14 districts each having approximately 12,000 people and to make it so that the maximum deviation from 12,000 was minimal. The three best solutions to this problem came from Roger Alley, Friedrich von Solms, and Serguei Patchkovskii (whose exhaustive search method used 2.5 hours on a cluster of 39 500MHz 21164 Alphas). The maximum deviation from 12,000 these solutions produced was a surprisingly low 29. Solution: (11 48 64) Population: 11992 Diff: 8 (8 15 19 37 66) Population: 11975 Diff: 25 (2 14 36 40 56) Population: 12022 Diff: 22 (10 31 46 62) Population: 11996 Diff: 4 (12 27 43 57) Population: 11996 Diff: 4 (5 25 47 55 58) Population: 12008 Diff: 8 (7 24 32 42 61) Population: 12005 Diff: 5 (1 23 28 45) Population: 12003 Diff: 3 (6 13 30 41 51) Population: 11996 Diff: 4 (3 17 21 33 52) Population: 12005 Diff: 5 (4 9 26 34 49) Population: 11971 Diff: 29 (22 38 50 59 65) Population: 11987 Diff: 13 (16 20 39 53 54 60) Population: 12020 Diff: 20 (18 29 35 44 63) Population: 12000 Diff: 0 ========================= From Michael.S.VanVertloo@Rose-Hulman.Edu Tue Dec 1 15:52:25 1998 Return-Path: Michael.S.VanVertloo@Rose-Hulman.Edu Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id PAA28702 for ; Tue, 1 Dec 1998 15:52:25 +0100 Received: from aurora.rose-hulman.edu (aurora.rose-hulman.edu [137.112.8.16]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id PAA29858 for ; Tue, 1 Dec 1998 15:52:24 +0100 (MET) Received: from vanverms.laptop.rose-hulman.edu ("port 2118"@vanverms.laptop.rose-hulman.edu) by RoseVC.Rose-Hulman.Edu (PMDF V5.1-12 #17642) with SMTP id <01J4TICKTISM9M2HRA@RoseVC.Rose-Hulman.Edu> for Dennis.Shasha@inria.fr; Tue, 1 Dec 1998 09:57:06 EST Date: Tue, 01 Dec 1998 09:55:51 -0500 From: Michael Van Vertloo Subject: Re: January 1999 - Fair Swedes To: Dennis Shasha Reply-to: Michael.S.VanVertloo@Rose-Hulman.Edu Message-id: <36640377.3709@Rose-Hulman.edu> MIME-version: 1.0 X-Mailer: Mozilla 3.01 (Win95; I) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <199812010556.GAA25682@wanda.inria.fr> Status: R After thinking through it for a while, the solution just fell out. If there were more than two possibilities for creating a district, it would have been much more difficult. Another possibility would be to create districts of 8000. Then one can't immediately draw a boundary line between a territory of 3000 and one of 2000. Dennis Shasha wrote: > > Nice job. Do you think it was a bit too easy? From Michael.S.VanVertloo@Rose-Hulman.Edu Tue Dec 1 18:15:58 1998 Return-Path: Michael.S.VanVertloo@Rose-Hulman.Edu Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id SAA30032 for ; Tue, 1 Dec 1998 18:15:58 +0100 Received: from aurora.rose-hulman.edu (aurora.rose-hulman.edu [137.112.8.16]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA02973 for ; Tue, 1 Dec 1998 18:15:55 +0100 (MET) Received: from vanverms.laptop.rose-hulman.edu ("port 2538"@vanverms.laptop.rose-hulman.edu) by RoseVC.Rose-Hulman.Edu (PMDF V5.1-12 #17642) with SMTP id <01J4TNCIXCTO9M2FLP@RoseVC.Rose-Hulman.Edu> for Dennis.Shasha@inria.fr; Tue, 1 Dec 1998 12:20:37 EST Date: Tue, 01 Dec 1998 12:19:24 -0500 From: Michael Van Vertloo Subject: Re: January 1999 - Fair Swedes To: Dennis Shasha Reply-to: Michael.S.VanVertloo@Rose-Hulman.Edu Message-id: <3664251C.4A75@Rose-Hulman.edu> MIME-version: 1.0 X-Mailer: Mozilla 3.01 (Win95; I) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <199812011529.QAA28960@wanda.inria.fr> Status: R There actually is no solution, since every territory of 3000 needs to be within 2 spaces of one with 2000. Territory #57 is not. Michael Dennis Shasha wrote: > > Michael, > That's a very nice variant. > Maybe I'll suggest it in the writeup. > Do you have a solution for the 8,000 problem? > Dennis From jimmy@ghs.com Fri Dec 4 01:16:35 1998 Return-Path: jimmy@ghs.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id BAA14339 for ; Fri, 4 Dec 1998 01:16:34 +0100 From: jimmy@ghs.com Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id BAA00423 for ; Fri, 4 Dec 1998 01:16:32 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id TAA08842 for ; Thu, 3 Dec 1998 19:16:27 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id TAA08669 for ; Thu, 3 Dec 1998 19:16:25 -0500 (EST) Received: from eta.ghs.com (root@eta.ghs.com [208.8.104.2]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id TAA06061 for ; Thu, 3 Dec 1998 19:13:10 -0500 (EST) Received: from elbe.ghs.com (elbe.ghs.com [192.67.158.245]) by eta.ghs.com (8.8.5/8.7.3) with ESMTP id QAA24786 for ; Thu, 3 Dec 1998 16:16:21 -0800 (PST) Received: from tahiti.ghs.com (tahiti.ghs.com [192.67.158.110]) by elbe.ghs.com (8.8.8/8.8.8) with SMTP id QAA15653 for ; Thu, 3 Dec 1998 16:16:21 -0800 (PST) Received: by tahiti.ghs.com (5.4R3.10/200.1.1.4) id AA02975; Thu, 3 Dec 1998 16:19:12 -0800 Date: Thu, 3 Dec 1998 16:19:12 -0800 Message-Id: <9812040019.AA02975@tahiti.ghs.com> To: DrEcco@ddj.com Subject: Fair Swedes Status: R Dear Dr. Ecco, Regarding the Fair Swedes problem, here is a possible mapping: (1,32) (2,47,58) (3,52) (4,38,54) (5,56,61) (6,13) (7,14,24) (8,66) (9,26) (10,46) (11,64) (12,28) (15,19,37) (16,34,44) (17,21,33) (18,53,60) (20,29,39) (22,49,50) (23,45) (25,55) (27,57) (30,41,51) (31,62) (35,63) (36,40) (42,65) (43,59) (48) It was pretty easy to do this, since each district (other than #48) fell into one of two categories: 2000 or 3000 population districts. Any three "2k" districts or any two "3k" districts could combine to form a "6k" district. The populations were such that no matter which districts you joined, you would always wind up with a district with 5900 to 6100 combined population, since each district was very close to 2000 or 3000. Also, you could almost tell by the way the map was drawn which districts should combine with other districts (was it a map of 28 districts with extra lines added??). I was able to come up with a solution by hand, after marking each district with a 2 or a 3. To make the problem more interesting, I made a metric to measure how close the districts were to exactly 6000 population. The metric is this: Metric = Sum for each district: (Population of district - 6000) ^ 2 With this metric, the lower the number the better (all 6000 population districts would rate a 0 metric). The solution I give tries to minimize this metric (it tries to get populations as close to 6000 as possible). I'm not sure if I found the optimal solution or not (I did it by hand again), but it makes for a more challenging problem. It was possible to optimize my solution by hand because about half the districts were fixed (they could only combine in 1 way). So I just had to fiddle with the remaining half, and the total number of ways that those districts could combine was small. Jimmy Hu jimmy@ghs.com From RAlley7240@aol.com Fri Dec 4 23:52:17 1998 Return-Path: RAlley7240@aol.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id XAA21988 for ; Fri, 4 Dec 1998 23:52:17 +0100 From: RAlley7240@aol.com Received: from imo17.mx.aol.com (imo17.mx.aol.com [198.81.17.7]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA24524 for ; Fri, 4 Dec 1998 23:52:15 +0100 (MET) Received: from RAlley7240@aol.com by imo17.mx.aol.com (IMOv18.1) id 2VUWa23510 for ; Fri, 4 Dec 1998 17:51:34 -0500 (EST) Message-ID: Date: Fri, 4 Dec 1998 17:51:34 EST To: Dennis.Shasha@inria.fr Mime-Version: 1.0 Subject: Re: Fair Swedes Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: AOL 3.0 for Windows 95 sub 62 Status: R As I expected, 11000 required a pretty big range. My program generated 1136 solutions for a range of 10042-11958 (inclusive), but none for the range 10043-11959. I'll look into 12000. Roger From RAlley7240@aol.com Mon Dec 7 07:52:43 1998 Return-Path: RAlley7240@aol.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id HAA02882 for ; Mon, 7 Dec 1998 07:52:43 +0100 From: RAlley7240@aol.com Received: from imo16.mx.aol.com (imo16.mx.aol.com [198.81.17.6]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id HAA03358 for ; Mon, 7 Dec 1998 07:52:41 +0100 (MET) Received: from RAlley7240@aol.com by imo16.mx.aol.com (IMOv18.1) id BUUOa22776 for ; Mon, 7 Dec 1998 01:52:24 -0500 (EST) Message-ID: Date: Mon, 7 Dec 1998 01:52:24 EST To: Dennis.Shasha@inria.fr Mime-Version: 1.0 Subject: Re: Fair Swedes Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: AOL 3.0 for Windows 95 sub 62 Status: R In a message dated 98-12-06 15:57:04 EST, you write: << Hmm. Couldn't you combine neighboring regions with 6,000 inhabitants? >> Yes, but that would only give some of the solutions. There are 12,000-person districts which are NOT combinations of two 6,000-person districts (for example, a linear string of 2K 3K 2K 3K 2K districts). I should check, however, and see how many of these types of districts there are. Roger From patchkov@ucalgary.ca Fri Dec 11 18:05:03 1998 Return-Path: patchkov@ucalgary.ca Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id SAA12832 for ; Fri, 11 Dec 1998 18:05:02 +0100 Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA04363 for ; Fri, 11 Dec 1998 18:04:59 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id MAA25155 for ; Fri, 11 Dec 1998 12:04:56 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id MAA17234 for ; Fri, 11 Dec 1998 12:04:54 -0500 (EST) Received: from ds11.acs.ucalgary.ca (root@ds11.acs.ucalgary.ca [136.159.244.11]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id MAA04436 for ; Fri, 11 Dec 1998 12:00:22 -0500 (EST) received: from acs1.acs.ucalgary.ca(136.159.34.201) by ds11.acs.ucalgary.ca via smap (V2.0) id ZZ886834; Fri, 11 Dec 98 10:03:40 -0700 Received: by acs1.acs.ucalgary.ca (AIX 4.1/UCB 5.64/4.03) id AA69050; Fri, 11 Dec 1998 10:03:40 -0700 Message-Id: <9812111703.AA69050@acs1.acs.ucalgary.ca> Subject: Swedes - Jan 1999 To: DrEcco@ddj.com Date: Fri, 11 Dec 98 10:03:39 MST From: "Serguei Patchkovskii" X-Mailer: ELM [version 2.3 PL11K] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Status: R Hi, Thanks for the nice problem. There is rather a lot of possible rezonings satisfying the conditions set out in the problem, namely 9396 of them (this does not count permutations of the numbers of mega-districts, only distinct groupings of the mini- districts). In all cases, the largest deviation from the desired population of 6000 (+80) comes from the the mega-district consisting of mini-districts 2, 47, and 58, so that in this sense all solutions are equivalent. The best solution in the RMS sense is: New district 1 population 5971 contains: 1 32 New district 2 population 6080 contains: 2 47 58 New district 3 population 5999 contains: 3 52 New district 4 population 5994 contains: 4 54 38 New district 5 population 6020 contains: 5 56 61 New district 6 population 5997 contains: 6 13 New district 7 population 6014 contains: 7 24 14 New district 8 population 5997 contains: 8 66 New district 9 population 6013 contains: 9 26 New district 10 population 5997 contains: 10 46 New district 11 population 6016 contains: 11 64 New district 12 population 6005 contains: 12 28 New district 13 population 5978 contains: 15 37 19 New district 14 population 5986 contains: 16 20 44 New district 15 population 6006 contains: 17 33 21 New district 16 population 6007 contains: 18 60 53 New district 17 population 5942 contains: 22 49 50 New district 18 population 6010 contains: 23 45 New district 19 population 5940 contains: 25 55 New district 20 population 5988 contains: 27 57 New district 21 population 5982 contains: 29 34 39 New district 22 population 5999 contains: 30 51 41 New district 23 population 5999 contains: 31 62 New district 24 population 6053 contains: 35 63 New district 25 population 6019 contains: 36 40 New district 26 population 5994 contains: 42 65 New district 27 population 5994 contains: 43 59 New district 28 population 5976 contains: 48 (or, of course, any of the 28! possible permutations of the numbers of mega-districts). This has the RMS deviation from the average population of only 27.037. No other solution has a smaller (or the same) RMS error. Finding all the solution took about 7 hours of CPU time on 500MHz 21164 alpha using brute-force algorithm implemented by a program appended at the end. It should be possible to get a much more elegant (and faster) solution by first constructing all possible groupings of the mini-districts (there isn't that much of them), and then searching for space-covering combinations of those. I am however too lazy to implement it - especially since I sleep rather more than 7 hours a day and can wait for the brute force search to finish ;-) If I am allowed to make a suggestion with respect to your column, I'd like to note that most of the problems which appeared there during the last half a year were about doing a recursive search of a rather small discrete solution space, which kind of gets repetitive. It would be nice to see Dr. Ecco having to deal with a problem involving some *other* kind of math... Regards, /Serge.P From RAlley7240@aol.com Mon Dec 14 20:22:23 1998 Return-Path: RAlley7240@aol.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id UAA01169 for ; Mon, 14 Dec 1998 20:22:23 +0100 From: RAlley7240@aol.com Received: from imo29.mx.aol.com (imo29.mx.aol.com [198.81.17.73]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id UAA03972 for ; Mon, 14 Dec 1998 20:22:21 +0100 (MET) Received: from RAlley7240@aol.com by imo29.mx.aol.com (IMOv18.1) id 6ZJAa19659 for ; Mon, 14 Dec 1998 14:09:00 -0500 (EST) Message-ID: <4444f555.3675624c@aol.com> Date: Mon, 14 Dec 1998 14:09:00 EST To: Dennis.Shasha@inria.fr Mime-Version: 1.0 Subject: Re: Fair Swedes Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: AOL 3.0 for Windows 95 sub 62 Status: R Hi, At least for my program, that's a much easier problem. The range 11972 - 12028 (inclusive) produced no solutions, while the range 11971 - 12029 produced 14256 distinct solutions. Here is one: Solution: (11 48 64) Population: 11992 Diff: 8 (8 15 19 37 66) Population: 11975 Diff: 25 (2 14 36 40 56) Population: 12022 Diff: 22 (10 31 46 62) Population: 11996 Diff: 4 (12 27 43 57) Population: 11996 Diff: 4 (5 25 47 55 58) Population: 12008 Diff: 8 (7 24 32 42 61) Population: 12005 Diff: 5 (1 23 28 45) Population: 12003 Diff: 3 (6 13 30 41 51) Population: 11996 Diff: 4 (3 17 21 33 52) Population: 12005 Diff: 5 (4 9 26 34 49) Population: 11971 Diff: 29 (22 38 50 59 65) Population: 11987 Diff: 13 (16 20 39 53 54 60) Population: 12020 Diff: 20 (18 29 35 44 63) Population: 12000 Diff: 0 Total diff: 150 Roger From RAlley7240@aol.com Mon Dec 14 23:37:56 1998 Return-Path: RAlley7240@aol.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id XAA02065 for ; Mon, 14 Dec 1998 23:37:56 +0100 From: RAlley7240@aol.com Received: from imo20.mx.aol.com (imo20.mx.aol.com [198.81.17.10]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA06863 for ; Mon, 14 Dec 1998 23:37:54 +0100 (MET) Received: from RAlley7240@aol.com by imo20.mx.aol.com (IMOv18.1) id IAMHa07111 for ; Mon, 14 Dec 1998 17:09:58 -0500 (EST) Message-ID: Date: Mon, 14 Dec 1998 17:09:58 EST To: Dennis.Shasha@inria.fr Mime-Version: 1.0 Subject: Re: Fair Swedes Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: AOL 3.0 16-bit for Windows sub 38 Status: RO Hi, For the range 11971-12029, the smallest total variance is 150 (the solution I sent you previously is the only one with that variance). However, if you expand the acceptable range around 12000, there are solutions with smaller total variances. Here are the 2 (there are only 2) solutions with the smallest total variance (124): Solution: (27 43 57 62) Population: 11996 Diff: 4 (31 36 40 66) Population: 12007 Diff: 7 (5 10 14 46 56) Population: 11988 Diff: 12 (11 48 64) Population: 11992 Diff: 8 (23 32 45 65) Population: 12000 Diff: 0 (7 13 24 37 42) Population: 12011 Diff: 11 (8 15 19 25 58) Population: 12001 Diff: 1 (2 6 47 55 61) Population: 12013 Diff: 13 (1 12 28 59) Population: 11987 Diff: 13 (4 9 26 49 54) Population: 11963 Diff: 37 (16 20 22 34 38 50) Population: 12012 Diff: 12 (18 29 35 44 63) Population: 12000 Diff: 0 (3 39 52 53 60) Population: 12001 Diff: 1 (17 21 30 33 41 51) Population: 12005 Diff: 5 Total diff: 124 Solution: (27 43 57 62) Population: 11996 Diff: 4 (31 36 40 66) Population: 12007 Diff: 7 (5 10 14 46 56) Population: 11988 Diff: 12 (11 48 64) Population: 11992 Diff: 8 (23 32 45 65) Population: 12000 Diff: 0 (7 13 24 42 51) Population: 12006 Diff: 6 (8 15 19 25 58) Population: 12001 Diff: 1 (2 6 47 55 61) Population: 12013 Diff: 13 (17 21 30 33 37 41) Population: 12010 Diff: 10 (3 39 52 53 60) Population: 12001 Diff: 1 (18 29 35 44 63) Population: 12000 Diff: 0 (16 20 22 34 38 50) Population: 12012 Diff: 12 (1 12 28 59) Population: 11987 Diff: 13 (4 9 26 49 54) Population: 11963 Diff: 37 Total diff: 124 Roger From freddyvs@ansys.co.za Wed Dec 16 09:31:21 1998 Return-Path: freddyvs@ansys.co.za Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id JAA14024 for ; Wed, 16 Dec 1998 09:31:18 +0100 Received: from liapta.pta.lia.net (liapta.pta.lia.net [196.38.157.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id JAA19903 for ; Wed, 16 Dec 1998 09:30:56 +0100 (MET) Received: from pta011.pta.lia.net ([196.38.157.11] helo=ansys.co.za) by liapta.pta.lia.net with smtp (Exim 1.92 #1) for Dennis.Shasha@inria.fr id 0zqCXP-0001sz-00; Wed, 16 Dec 1998 10:42:31 +0200 Received: from FRED [5.5.5.167] by ansys.co.za [5.5.5.150] with SMTP (MDaemon.v2.7.SP1.R) for ; Wed, 16 Dec 98 10:20:01 +0200 From: "Friedrich von Solms" To: Subject: Re: Fair Swedes, Jan 99 Date: Wed, 16 Dec 1998 10:20:00 +0200 Message-ID: <01be28cc$dffb9980$a7050505@FRED> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 X-MDaemon-Deliver-To: Dennis.Shasha@inria.fr Reply-To: freddyvs@ansys.co.za Status: R Dennis, In reply to your 14 of 12000, a solution; 3+52+53+17+60 21+41+33+30+51+18 37+19+15+6+13 8+66+25+55 58+47+2+40+36 48+24+61+5 35+63+11+64 20+39+29+44+16+34 54+4+38+65+42 9+26+49+22+50 7+14+56+31+62 32+1+23+45 28+59+12+43 46+27+10+57 Many regards, Freddy -----Original Message----- From: Dennis Shasha To: freddyvs@ansys.co.za Date: 12 December 1998 16:01 Subject: Re: Fair Swedes, Jan 99 >Nice. >Would you like to try for 14 districts of 12,000. >It's much harder. >Dennis >>From freddyvs@ansys.co.za Fri Dec 11 17:00:26 1998 >Return-Path: freddyvs@ansys.co.za >Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id RAA12336 for ; Fri, 11 Dec 1998 17:00:14 +0100 >Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) > by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id QAA03191 > for ; Fri, 11 Dec 1998 16:59:58 +0100 (MET) >Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) > by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id KAA24114 > for ; Fri, 11 Dec 1998 10:59:46 -0500 (EST) >Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id KAA29827 for ; Fri, 11 Dec 1998 10:59:41 -0500 (EST) >Received: from liapta.pta.lia.net (root@liapta.pta.lia.net [196.38.157.1]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id KAA19408 for ; Fri, 11 Dec 1998 10:55:29 -0500 (EST) >Received: from pta005.pta.lia.net ([196.38.157.5] helo=ansys.co.za) > by liapta.pta.lia.net with smtp (Exim 1.92 #1) > for drecco@ddj.com > id 0zoV7H-0007JI-00; Fri, 11 Dec 1998 18:08:32 +0200 >Received: from FRED [5.5.5.167] by ansys.co.za [5.5.5.150] with SMTP (MDaemon.v2.7.SP1.R) for ; Fri, 11 Dec 98 17:29:31 +0200 >From: "Friedrich von Solms" >To: >Subject: Fair Swedes, Jan 99 >Date: Fri, 11 Dec 1998 17:29:29 +0200 >Message-ID: <01be251b$0b6a1980$a7050505@FRED> >MIME-Version: 1.0 >Content-Type: text/plain; > charset="iso-8859-1" >Content-Transfer-Encoding: 7bit >X-Priority: 3 >X-MSMail-Priority: Normal >X-Mailer: Microsoft Outlook Express 4.71.1712.3 >X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 >X-MDaemon-Deliver-To: drecco@ddj.com >Reply-To: freddyvs@ansys.co.za >Status: R > >Dennis, > >A solution to the "Fair Swedes puzzle in the January 1999 issue of Dr Dobbs: > >Join districts >3 & 52 >53 & 17 & 60 >21 & 33 & 41 >30 & 18 & 51 >6 & 13 >8 & 66 >37 & 15 & 19 >40 & 36 >2 & 47 & 58 >25 & 55 >48 remains >24 & 61 & 5 >7 & 14 & 56 >31 & 62 >46 & 27 >20 & 39 & 44 >16 & 29 & 34 >35 & 63 >11 & 64 >65 & 42 >23 & 45 >10 & 57 >12 & 43 >32 & 1 >28 & 59 >54 & 4 & 38 >9 & 26 >49 & 50 & 22 > >Giving 28 districts all 6000 +-100 > > >Regards, > >Freddy > >freddyvs@ansys.co.za > > From jpl@iname.com Tue Dec 22 20:22:20 1998 Return-Path: jpl@iname.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id UAA29090 for ; Tue, 22 Dec 1998 20:22:16 +0100 Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id UAA20643 for ; Tue, 22 Dec 1998 20:22:13 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA02006 for ; Tue, 22 Dec 1998 14:22:11 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id OAA20232 for ; Tue, 22 Dec 1998 14:22:09 -0500 (EST) Received: from tun.com (tun.com [209.51.4.29]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id OAA11727 for ; Tue, 22 Dec 1998 14:21:27 -0500 (EST) Received: from iname.com (jpl@bluethunder.tun.net [192.168.0.3]) by tun.com (8.8.7/8.8.7) with ESMTP id NAA03846 for ; Tue, 22 Dec 1998 13:22:08 -0600 Sender: jpl@tun.com Message-ID: <367FF198.DF84D9A1@iname.com> Date: Tue, 22 Dec 1998 13:23:04 -0600 From: Jean-Philippe Langlois X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: DrEcco@ddj.com Subject: Solution to problem of 99/01 Content-Type: multipart/mixed; boundary="------------A7255835EEE6DD5D6A76B542" Status: R This is a multi-part message in MIME format. --------------A7255835EEE6DD5D6A76B542 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear Dennis, Please find below a little Prolog program that finds solutions to the district mergers problem. When run to find all solutions, it tells me it found 9396. I'm not sure how to verify that it's correct. What I know is that I carefully sorted all results so that duplicates would be eliminated. Just for the record, here's the first solution the program gave me: S = [[1, 32], [2, 47, 58], [3, 52], [4, 34, 38], [5, 14, 56], [6, 13], [7, 24, 61], [8, 66], [9, 26], [10, 57], [11, 64], [12, 43], [15, 19, 37], [16, 20, 54], [17, 21, 33], [18, 53, 60], [22, 49, 50], [23, 45], [25, 55], [27, 62], [28, 59], [29, 39, 44], [30, 41, 51], [31, 46], [35, 63], [36, 40], [42, 65], [48]] This is the list of lists of districts that should be merged. Please find attach the source code of the program. I appreciate your column very much. What I would like to see is more about how other readers found solutions, what reasoning they used, what tools, etc., instead of just the solutions. Best regards, --Jean-Philippe Langlois --------------A7255835EEE6DD5D6A76B542 Content-Type: application/x-perl; name="prog.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="prog.pl" /* * prog.pl * * DDJ's Dr Ecco column of 1999/01. * * This problem has too many choices for a brute force approach to * work. * * Simple research shows that some districts have only one merger * possibility from the very beginning. Making these choices first * further reduce the number of merger possibilities for the other districts. * and thus limits our search space. Even though it is expensive to search * which district has the smallest number of mergers possible, it reduces the * number of choices so much that it allows a Pentium Pro 200MHz to find * 9360 solutions (all solutions if this program is correct) in about 10 * minutes. * * Important facts were used to simplify: districts will merge with one, two or * zero other districts because they all have populations of around 3000, 2000 or * 6000. * * An important trick is that we sort everything to avoid duplicates, e.g. a merger * [1,2,3] is the same as a merger [2,1,3]. If sorted, duplicates can easily be * eliminated. * * Use the go/0 predicate to find a solution. */ /* utilities */ genlist( [X|L], I ) :- I > 0, X = I, I2 is I - 1, genlist( L, I2 ). genlist( [], 0 ). contains( L1, L2 ) :- member( X, L2 ), member( X, L1 ), delete( L2, X, L3 ), contains( L1, L3 ). contains( _, [] ). delete_list( L1, [X|L2], O) :- delete( L1, X, L3 ), delete_list( L3, L2, O ). delete_list( L1, [], L1 ). /* Facts */ neighbor(1,32). neighbor(1,45). neighbor(1,12). neighbor(1,28). neighbor(1,38). neighbor(2,55). neighbor(2,47). neighbor(2,36). neighbor(2,5). neighbor(3,52). neighbor(3,53). neighbor(4,54). neighbor(4,16). neighbor(4,34). neighbor(4,38). neighbor(4,9). neighbor(5,61). neighbor(5,2). neighbor(5,56). neighbor(6,13). neighbor(6,15). neighbor(6,55). neighbor(7,42). neighbor(7,64). neighbor(7,48). neighbor(7,24). neighbor(7,14). neighbor(8,19). neighbor(8,25). neighbor(8,66). neighbor(9,38). neighbor(9,26). neighbor(9,49). neighbor(10,45). neighbor(10,46). neighbor(10,57). neighbor(10,12). neighbor(11,63). neighbor(11,18). neighbor(11,64). neighbor(11,65). neighbor(12,45). neighbor(12,43). neighbor(12,28). neighbor(13,24). neighbor(13,48). neighbor(13,51). neighbor(13,37). neighbor(14,61). neighbor(14,56). neighbor(14,42). neighbor(15,37). neighbor(15,19). neighbor(15,55). neighbor(16,20). neighbor(16,44). neighbor(16,34). neighbor(16,54). neighbor(17,51). neighbor(17,33). neighbor(17,51). neighbor(17,18). neighbor(17,60). neighbor(17,53). neighbor(17,52). neighbor(18,51). neighbor(18,48). neighbor(18,64). neighbor(18,63). neighbor(18,60). neighbor(19,37). neighbor(19,25). neighbor(19,55). neighbor(20,60). neighbor(20,39). neighbor(20,44). neighbor(21,52). neighbor(21,41). neighbor(21,33). neighbor(22,49). neighbor(22,26). neighbor(22,38). neighbor(22,50). neighbor(23,32). neighbor(23,42). neighbor(23,45). neighbor(24,48). neighbor(24,55). neighbor(24,61). neighbor(25,58). neighbor(25,55). neighbor(26,38). neighbor(27,46). neighbor(27,62). neighbor(27,57). neighbor(28,38). neighbor(28,59). neighbor(29,44). neighbor(29,39). neighbor(29,60). neighbor(29,35). neighbor(29,65). neighbor(29,34). neighbor(30,41). neighbor(30,37). neighbor(30,51). neighbor(31,56). neighbor(31,36). neighbor(31,62). neighbor(31,46). neighbor(32,38). neighbor(32,65). neighbor(32,42). neighbor(33,52). neighbor(33,41). neighbor(33,51). neighbor(34,44). neighbor(34,65). neighbor(34,38). neighbor(35,60). neighbor(35,63). neighbor(36,47). neighbor(36,40). neighbor(36,56). neighbor(37,51). neighbor(38,65). neighbor(38,59). neighbor(38,50). neighbor(39,60). neighbor(39,44). neighbor(40,58). neighbor(40,66). neighbor(41,51). neighbor(42,65). neighbor(42,64). neighbor(43,59). neighbor(43,57). neighbor(45,56). neighbor(45,46). neighbor(46,56). neighbor(47,55). neighbor(47,58). neighbor(48,64). neighbor(52,53). neighbor(53,60). neighbor(55,61). neighbor(58,66). neighbor(63,65). population(1,2992). population(2,2032). population(3,3021). population(4,1973). population(5,2020). population(6,2977). population(7,2003). population(8,3004). population(9,2985). population(10,3024). population(11,3032). population(12,3004). population(13,3020). population(14,1980). population(15,2026). population(16,2008). population(17,1990). population(18,1984). population(19,1978). population(20,2008). population(21,2008). population(22,1991). population(23,2987). population(24,2031). population(25,2969). population(26,3028). population(27,2991). population(28,3001). population(29,1993). population(30,2010). population(31,2995). population(32,2979). population(33,2008). population(34,2010). population(35,3027). population(36,2991). population(37,1974). population(38,2019). population(39,1979). population(40,3028). population(41,2020). population(42,2983). population(43,3004). population(44,1970). population(45,3023). population(46,2973). population(47,2024). population(48,5976). population(49,1975). population(50,1976). population(51,1969). population(52,2978). population(53,2030). population(54,2002). population(55,2971). population(56,1991). population(57,2997). population(58,2024). population(59,2990). population(60,1993). population(61,2009). population(62,3004). population(63,3026). population(64,2984). population(65,3011). population(66,2993). /* Rules */ /* Are districts connected? */ /* Since we don't duplicate neighbor(X,Y) to neighbor(Y,X), we use this 'connected' predicate. We also use it to find if 3 districts are connected. */ connected( X, Y ) :- neighbor( X, Y ). connected( X, Y ) :- neighbor( Y, X ). connected( X, Y, Z ) :- connected( X, Y ), connected( X, Z ), X =\= Y, X =\= Z, Z =\= Y. connected( X, Y, Z ) :- connected( X, Y ), connected( Y, Z ), X =\= Y, X =\= Z, Z =\= Y. /* the summ of population of several districts */ population( X, Y, P ) :- population( X, PX ), population( Y, PY ), P is PX+PY. population( X, Y, Z, P ) :- population( X, Y, PXY ), population( Z, PZ ), P is PXY + PZ. /* can districts merge? */ can_merge( _, X ) :- population( X, P ), P < 6101, P > 5899. can_merge( L, X, Y ) :- connected( X, Y ), member( X, L ), member( Y, L ), population( X, Y, P ), P < 6101, P > 5899. can_merge( L, X, Y, Z ) :- connected( X, Y, Z ), member( X, L ), member( Y, L ), member( Z, L ), population( X, Y, Z, P ), P < 6101, P > 5899. /* verify/find a merger */ merger( _, X, [X] ) :- can_merge( _, X ). merger( LD, X, M ) :- can_merge( LD, X, Y ), sort( [X,Y], M ). merger( LD, X, M ) :- can_merge( LD, X, Y, Z ), sort( [X,Y,Z], M ). merger_list( LD, X, LM ) :- bagof( L1, merger( LD, X, L1 ), L1s ), sort( L1s, LM ). merger_lists( LD, [X|Q], LLM ) :- merger_list( LD, X, L1 ), merger_lists( LD, Q, L2 ), LLM = [[X,L1]|L2]. merger_lists( _, [], [] ). /* * Solving algorithm * */ go :- go( S ), writef( 'Found solution: %w\n', [S] ). go( S ) :- genlist( LD, 66 ), /* [66,65,64,...,1] */ solve( LD, S1, 1 ), sort( S1, S ). solve( LD, S, Depth ) :- next_district( LD, [N,D,LM] ), /* optional output to see what's going on without using the trace mode */ /*writef( 'Going to %w (%w possibilities, depth %w)\n', [D, N, Depth] ),*/ member( M, LM ), delete_list( LD, M, LD2 ), Depth2 is Depth + 1, solve( LD2, S2, Depth2 ), S = [M|S2]. solve( [], [], _ ). next_district( LD, NDLM ) :- next_district( LD, LD, [], NDLM ). /* next_district( +List of Districts available, +List of districts to browse, +list of possible choices built so far, -district picked ) */ next_district( LD, [D|LDQ], LNDLM, NDLM ) :- merger_list( LD, D, LM ), length( LM, N ), next_district( LD, LDQ, D, LM, [[N,D,LM]|LNDLM], NDLM ). next_district( _, [], LNDLM, NDLM ) :- /* stop recursive descent if it's the last element, chose the district with the smallest number of possibilities */ sort( LNDLM, [NDLM|_] ). next_district( _, _, D, [M], _, [1,D,[M]] ). /* stop search here if only one possibilities */ next_district( LD1, LD2, _, LM, LNDLM, NDLM ) :- length( LM, N ), N > 1, next_district( LD1, LD2, LNDLM, NDLM ). --------------A7255835EEE6DD5D6A76B542-- From patchkov@ucalgary.ca Sun Dec 20 22:12:46 1998 Return-Path: patchkov@ucalgary.ca Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id WAA14213 for ; Sun, 20 Dec 1998 22:12:46 +0100 Received: from ds11.acs.ucalgary.ca (ds11.acs.ucalgary.ca [136.159.244.11]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id WAA04181 for ; Sun, 20 Dec 1998 22:12:43 +0100 (MET) received: from acs1.acs.ucalgary.ca(136.159.34.201) by ds11.acs.ucalgary.ca via smap (V2.0) id ZZ970760; Sun, 20 Dec 98 14:12:22 -0700 Received: by acs1.acs.ucalgary.ca (AIX 4.1/UCB 5.64/4.03) id AA85876; Sun, 20 Dec 1998 14:12:21 -0700 Message-Id: <9812202112.AA85876@acs1.acs.ucalgary.ca> Subject: Re: Swedes - Jan 1999 To: Dennis.Shasha@inria.fr (Dennis Shasha) Date: Sun, 20 Dec 98 14:12:21 MST From: "Serguei Patchkovskii" In-Reply-To: <199812120845.JAA24352@gerard.inria.fr>; from "Dennis Shasha" at Dec 12, 1998 9:45 am X-Mailer: ELM [version 2.3 PL11K] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Status: RO Hi, > Nice. Now that you have the program, perhaps you'd like to try > a variant I never put in: > 14 districts of about 12,000. > Same rules. This one is a *lot* more interesting. The search space is a lot bigger, and therefore it is necessary to use the brute force somewhat smarter to get the answer in a reasonable time. I had to modify the program to use the search order encouraging early culls (this speeds up the original problem by a factor of 4) and to detect duplicate solutions earlier in the search (this saves a factor of 60 on the original problem). Both modifications together bring the search time for the original problem down to less than two minutes. Using the "same rules" is not really rewarding: I found more than 30,000 solutions with maximum deviation from 12,000 under 100 after 30 minutes of searching (and exhausting less than 1% of the search space). I therefore confined the search to solutions with maximum deviations of 30 or less. There is still quite a few of those, namely 1254 solutions with max error of 30, and 12646 with max error of 29 (there are no solutions with the maximum error below 29). The "best" solution in the sense of the lowest RMS deviation from 12,000 (12.7839) is: Solution rank = 29 New district 1 population 11990 contains: 1 12 43 59 New district 2 population 12013 contains: 32 23 45 10 New district 3 population 11998 contains: 28 38 65 22 50 New district 4 population 11987 contains: 57 27 62 31 New district 5 population 12017 contains: 42 7 14 24 13 New district 6 population 12007 contains: 56 5 36 46 2 New district 7 population 11971 contains: 34 4 9 26 49 New district 8 population 11995 contains: 63 35 29 44 39 New district 9 population 11992 contains: 11 64 48 New district 10 population 12005 contains: 61 55 47 6 58 New district 11 population 12016 contains: 37 19 15 30 41 21 New district 12 population 11985 contains: 18 17 60 20 16 54 New district 13 population 12006 contains: 51 33 52 53 3 New district 14 population 11994 contains: 40 66 8 25 Even though my updated program is a lot faster than the first version, the exhaustive search for the modified problem is still pretty expensive. Fortunately, I had to install PVM for my real job, and so used this little problem for debugging and testing. The search took about 2.5 hours on a cluster of 39 500MHz 21164 Alphas - which would have translated into some four days on one of them alone. Thanks to the Christmas break, there were no other contenders for the cluster - so that I was able to get away while still in one piece. I guess this takes the candle as the most useless application of one of the top-1000 supercomputing sites ;-) Have a merry Christmas, /Serge.P Reader Solutions to the Tundra Puzzle The bad typo in the initial pipe layout of the print version of the tundra problem was due to a bug in my puzzle version control. Please accept my apologies. The web version of the puzzle has the correct initial layout. Fortunately, many brave readers tried to solve the problem anyway (often after sending me an "I am confused..." email). The following clever ones obtained the optimal answer, which is the same as the one published in last month's issue: Dennis Yelle, Pike Enz, Rodney Meyer, Richard Stanford, Chad Harrington, Richard S. Fleischmann, Bruce Moskowitz, Bryan S. McDaniel, Jean-Philippe Langlois, Matthew Cuba, Geoffrey Probert, Randy Von Smith, Andrew Palfreyman, Jimmy Hu, Robert Sparks, Rick Cohan, James Larson, Conrad Schlundt, Phil Staite, Christopher Diggins, and David Stevenson. To: jondobbs Subject: reader solutions to wildfire Reader Solutions to the Wildfire Problem Several of the solutions proposed by readers used a diagaonal placement of cisterns and some produced far better results than Dr. Ecco's, notably those of Onno Waalewijn (who proposed using every fifth diagonal), Tomas G. Rokicki (who varied the gaps slightly go achieve high and low density coverage http://tomas.rokicki.com/fire/), and Rodney Meyer. Tomas expressed the advantage of diagonals this way: "Diagonal rows of cisterns work better to enclose fires than orthogonal rows. This is because the fires tend to spread orthogonally, and also because diagonal rows block the fire in two directions at once, where orthogonal rows only block the fire in one direction." Andrew Palfreyman on the other hand chose a strategy in which he excluded strikes closest to the edges of the forest with surprisingly good results. Stuart Halloway fought fires by arranging cisterns in squares having holes. Mark Murphy used a random pattern and suggested mating this puzzle with the one about biodiversity. John Trono tried a variety of strategies. I think the diagaonal strategies have it, but suspect that cistern layout depends a lot on the assumptions, viz. regular wind direction changes along north-south-east-west axes. A more realistic simulation in which wind direction may change continuously would be very worthwhile when this idea is reduced to practice. Reader Solutions to the Wordsnake Puzzle The wordsnakes puzzle was to find an ordering among a list of words that gives the highest possible score, where the score is the sum of the scores of the overlaps among adjacent words and the score of an overlap is the square of the size of the overlap. The puzzle presented a list (not in order) and asked readers to find the best order. Alan Schnell, Patrick R. Schonfeld, Earl Paddon, John A. Trono, Dennis Yelle, Kim Pfeifle, Tomas Rokicki, and Dave Curran matched Liane's solution of 357. Schonfeld, Yelle, and Rokicki found 40 solutions that reached this total. Schonfeld was the first to prove that there cannot be a better one as follows: "1. Each word in the given 39-word list has at least one successor. 2. For each word in the list, determine which successor has the maximum overlap with the word. 3. Add up the squares of these maximum successor overlaps. The sum is 358. 4. Because the last word of a Wordsnake does not have a successor, the sum in the previous step must be reduced by the smallest squared overlap, which is one. 5. Therefore, the maximum score is 357." David Curran reported an excellent English 18 letter worksnake: "conversationalists." This simple word yields a score of 663 having the breakdown: con, conversation, conversational, conversationalist, conversationalists, and lists. Genny Engel managed to beat this with the 15 letter wordsnake "misrepresentions": misrepresent, misrepresentation, misrepresentations, representation, representations, presentations, and ions. This gave her a score of 843. Martin Laeuter of the mathematics department at Leipzig suggests the following 18 letter German wordsnake: verwirtschaftetest. From this, the following words are present giving a total of 993 points, an impressive achievement. verwirtschaftete, verwirtschaftetes, erwirtschaftetes, erwirtschaftetest, and wirtschaftetest. "OK, now to the meanings. The used verbs are verwirtschaften, erwirtschaften and wirtschaften. To begin from the last, wirtschaften is the action of organising things economically, e.g. making ends meet in the household or the tasks of a manager (to manage affairs). erwirtschaften is working so that money or other means are available to pay expenses. verwirtschaften is simply bad wirtschaften, bad management." Wordsnakes suggested other games to some clever readers: Earl Paddon suggested a new game called Hidden Wordsnake. "Simply, a hidden Wordsnake is a regular Wordsnake which is also a word. Examples are hidden (hid, hidden, den), intended (intend, tend, end, ended), and controlled ( control, troll, roll, rolled, led). Hope it isn't contagious, seems as though I cannot look at a word without trying to break it down." He notes as an example that the following all appear in Websters New Universal Unabridged, 2nd Edition: "ate" can be broken down to a,at,ate,te,e. David Cox suggested a variant in which there is a bonus if the overlap of two consecutive words in a wordsnake is a word itself. Michael D. Christenson reports a game for people with amazing memories: "We play a phonic version while hiking called `Jabberwalking' One person starts with a word: harmonica, for instance. The next person repeats that, and adds a word: harmo-Nicaragua. The third person repeats the string: harmo-Nicara-guacamole. This can go on for hours, depending on the hike." From jallamekk@hotmail.com Wed Aug 2 10:59 EDT 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id KAA29589 for ; Wed, 2 Aug 2000 10:59:14 -0400 (EDT) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id KAA22542 for ; Wed, 2 Aug 2000 10:59:13 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id KAA06534 for ; Wed, 2 Aug 2000 10:59:09 -0400 (EDT) Received: from hotmail.com (f174.law6.hotmail.com [216.32.241.174]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id KAA29243 for ; Wed, 2 Aug 2000 10:59:08 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 2 Aug 2000 07:58:37 -0700 Received: from 130.67.112.146 by lw6fd.law6.hotmail.msn.com with HTTP; Wed, 02 Aug 2000 GMT X-Originating-IP: [130.67.112.146] From: "tHE tROOPER" To: DrEcco@ddj.com Subject: Wordsnakes from Norway Date: Wed, 02 Aug 2000 14:58:37 GMT Mime-Version: 1.0 Message-ID: X-OriginalArrivalTime: 02 Aug 2000 14:58:37.0180 (UTC) FILETIME=[22F883C0:01BFFC92] Content-Type: text/plain; format=flowed Content-Length: 3150 Status: R Hi, I'm writing to you about my findings on the wordsnake problem in DDJ July. I hope I'm not to late replying to this problem. With a busted arm in plaster, I had some spare time. I discovered the following; Wordsnake with highest score A wordsnake with score 357 from the wordlist provided in the magazine: incredible blemish mishapen penultimate tense seem emerge merger geriatric tricky yes essential ally yet eternal alas lasting stinger gerund underdevelop eloped pediatric trice icer certain invent terrible blend lending ingrate rates tessilate later terrestrial trials sudden denude dense sea As far as I can tell, there are 40 wordsnakes with score 357, all of length 145 in long form (20 starting with "incredible" and the other 20 starting with "invent"). All of these ends with "sea". Outline of the method of discovery of these 40 wordsnakes: I started with a basic recursive function that explores all possible wordsnakes. This took an awful lot of time to execute so I made the following adjustment: Before deciding to make another recursion, estimate a smallest possible maximum score following this path of exploration. If this is lower than the highest score found so far, don't bother to explore further. This dramatically decreased the running time, and made it possible to discover the 40 wordsnakes in about 5 minutes. If I set the highest score equal to 357 before starting the recursion, it took under a minute to execute the algorithm. The longest possible wordsnake This was a much harder nut to crack. I was unable to make an algorithm that explored all relevant combinations, and the best I could do was a length of 182, and it only uses 37 of the 39 words in the list: incredible blemish mishapen penultimate eloped dense emerge essential alas lasting geriatric certain invent trials stinger rates seem merger gerund underdevelop pediatric tricky yet tessilate terrible blend denude eternal later terrestrial lending ingrate tense sea ally yes sudden The shortest possible wordsnake I gave up on this one. Best 18 and 50 letter wordsnakes Finding a decent wordlist on the internet wasn't easy. Most of them was lists for cracking passwords, containing lots of gibberish and semistandard words. I'm sure that my solutions for the Norwegian wordsnakes uses standard words, but I'm doubtful if my solutions for the English does; Norwegian: uoverensstemmelse uoverensstemmelsen overensstemmelsen sen en Length 18, score 589 arbeidsgiverforening arbeidsgiverforeningen arbeidsgiverforeningens stortingsrepresentant stortingsrepresentanten stortingsrepresentantene Length 46, score 1855 English: preacknowledgment preacknowledgments reacknowledgments Length 18, score 578 no nonrepresentational nonrepresentationalism representationalism microspectrophotometric microspectrophotometrical microspectrophotometrically spectrophotometrically Length 48, score 2365 Thanks for the interesting problems! -- Jostein Trondal One Handed Java Programmer ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ============= Claire: Here are corrections. Some of them introduce new names. ============= Dear Jon, Here are my corrections to the galleys. Thanks, Dennis 1. Please include the short bio that you put in my first column. It reads: Dennis, a professor of computer science at New York University, is the author of The Puzzling Adventures of Dr. Ecco (Dover, 1998), Codes, Puzzles, and Conspiracy (W. H. Freeman & Co. 1992), Database Tuning: a principled approach (Prentice Hall, 1992) and (coauthored with Cathy Lazere) Out of Their Minds: the lives and discoveries of 15 Great Computer Scientists (Copernicus/ Springer Verlag, 1998). He can be contacted at DrEcco@ddj.com. 2. Line 21: I had: ``We're trying to crack a major drug cartel,'' the police commissioner explained. You replaced by: The police commissioner explained. ``We're trying to crack a major drug cartel.'' I find my opening more dramatic, so would like you to take another look. 3. line 240: I had: We don't know whom to trust. You replaced by We don't know who to trust. But, I think whom is correct since it is the object of trust. So, I think my text should stand. 4. (my mistake on 286) * If we know that X lies, then his accusations may or may not be true.'' should be * If X lies, then his accusations may or may not be true.'' 5. 2131 (my mistake) Did a lot of game tree analysis should be This is hard to solve in closed form. I used game tree analysis in my favorite programming language, K. 6. 345 (my mistake) I received .... should be As of the mid-March deadline for this column, I received .... 7. p. 3, last line of first column: before Albert H. Benke, please put in Jon Beal Corrections to Ambulance 2.16 -- took out --> lit 2.18 -- with a cigarette --> smoking 2.44 -- the hospital --> the hospital and deliver him to the emergency room 2.102 -- in the array language K --> in her favorite language K 3.6 -- Reader: How about --> Reader: What could you do 3.36 -- add Correction The figures reflecting Ecco's solutions published in the January issue were inconsistent with the text, as pointed out by several attentive readers. The text solutions were correct, but the figures were not. Here are the corrected figures. [Dr. Dobb's: please insert the corrected ones] Corrections to Beams column: 1. Line 2.75, please change 3:1.1 to 3:2.1 2. Please change the caption to read: The temple design idea, not necessarily to scale. 3. 3.85: and Art Grant --> Art Grant, and Dennis Yelle. 4. 3.90: as good as --> the best Corrections to Beats Column 1. Very important (problem in the figure): Some of the blocks are missing directions: two in the third row that should point left; one in the third from the bottom that should point right. After you correct, please check it very carefully before resending to me. At that point, please fax to 212-254-7947. 2. After 2.72, but part of the italics, please add: Note that it is not necessary for each car to perform a circuit of 10, just so long as every street is visited every 10 minutes. 3. 2.133: Reader Notes --> Reader Notes on the Tundra Problem 5. 3.20: and David Stevenson --> David Stevenson, John Trammel, and Paul Wagner change name from biodiversity to beasts Deirdre, I couldn't read the line numbers in the fax. On page 3, second column under reader notes, there is a sentence that ends in "best order". Could you add a parentheses after that: (The word list had a slight bug. Allen Windhorn pointed out the correct spelling of the word "tessellate." Fortunately, this made no difference in the approach to the solution or the score.) Deidre, now start a new paragraph. To: deirdredobbs Subject: omniheurist corrections Corrections to Blood: 1. 2.1: please change the first paragraph to: He wore a sports jacket and a tie, but a stethoscope dangled from his neck. Dr. Max Jacobs looked us over for a few seconds each. 2. 2.13: please begin the new paragraph with "As you may know... 3. 2.57: idea --> suggestion 4. 2.131: question --> question concerning the game Simple 5. 3.52, 3.58 3.65, 3.68, 3.82, 3.87, 3.94, 3.133 4.6, 4.13, 4.23, 4.30 --- all of these are inconsistent with what I send because they are not fixed width. Please use fixed width for the O's and X's and blanks as in my original mail. 6. 4.81: and Frank Adrian --> Frank Adrian, Mark Whitaker, Jacques Belzile, Fernando H. Kato, David Berson, Mathew Davies, John A. Trono, Philip Staite, Scott Williams, Carl Smotricz, Francis C. Swasey, Larry Holding, Kurt Jones, Herb Halvorson, Kurt Jones, Malcolm Kay, Brenton Hoffski, and Terje Mathisen. Corrections to Calabaza: 2.125: starts." --> starts. Now let's try it for the gourds the artisan really build." 3.15: takes n minutes --> causes the gourd to drain in n minutes 3.16: is the minute below --> will cause the gourd to drain in one minute 4.3: and Andy W. Desplenter --> Andy W. Desplenter, Mark Taylor, Kees Rijnierse, Forest Wilkinson, and Doug Newhort (who minimized the average length as well, http://members.home.net/dmewhort/3hub.htm), 4.11: and Denis Birnie --> Denis Birnie, Carey Bingham, Kevin Fox, Steve Bourassa, David Stevenson, Jeffrey A. Hallman. and John Grant. 2.31: sat back --> sat up 2.50: linear array --> linear pathway 3.11: she asked --> Elena asked 3.16: others --> several 3.18-3.21: eliminate paragraph [leads nowhere] 3.25: 5.3131 --> 5.3131 coins needed to pay any bill from 1 to 99 cents. 3.70: and James Heginbottom --> James Heginbottom, and Robert Morrison. 3.80: Patrick Schonfeld --> Patrick Schonfeld and Robert Morrison From andrew_ppp@hotmail.com Sat Dec 9 15:23 EST 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id PAA05388 for ; Sat, 9 Dec 2000 15:23:40 -0500 (EST) Received: from hotmail.com (f172.law7.hotmail.com [216.33.237.172]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id PAA16061 for ; Sat, 9 Dec 2000 15:23:41 -0500 (EST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 9 Dec 2000 12:23:09 -0800 Received: from 63.70.210.20 by lw7fd.law7.hotmail.msn.com with HTTP; Sat, 09 Dec 2000 20:23:09 GMT X-Originating-IP: [63.70.210.20] From: "Andrew P" To: shasha@cs.nyu.edu Cc: andrew_ppp@hotmail.com Subject: 25th Anniversary screw-up Date: Sat, 09 Dec 2000 12:23:09 -0800 Mime-Version: 1.0 Message-ID: X-OriginalArrivalTime: 09 Dec 2000 20:23:09.0751 (UTC) FILETIME=[D8D0CC70:01C0621D] Content-Type: text/plain; format=flowed Content-Length: 674 Status: R Dennis, I presume you're aware that the latest issue shows inconsistencies for both the 8-puzzle and the 12-puzzle Causality solutions. For the 8-puzzle: 1. The diagram does not match the text solution in many ways. 2. The text solution is missing the edge GB, which is mandatory for all possible solutions. For the 12-puzzle: The diagram omits the text solution path HC. The 12-puzzle text solution is correct, and corresponds to #11 of the 24 solutions I sent you already. Cheers, Andrew Palfreyman _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com From shasha@cs.nyu.edu Sat Dec 16 11:29 EST 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id LAA21320 for ; Sat, 16 Dec 2000 11:28:59 -0500 (EST) Received: from griffin.cs.nyu.edu (griffin.cs.nyu.edu [128.122.140.54]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id LAA09221 for ; Sat, 16 Dec 2000 11:28:58 -0500 (EST) Received: (from shasha@localhost) by griffin.cs.nyu.edu (8.9.1/8.9.1) id LAA21316; Sat, 16 Dec 2000 11:28:56 -0500 (EST) Date: Sat, 16 Dec 2000 11:28:56 -0500 (EST) From: Dennis Shasha Message-Id: <200012161628.LAA21316@griffin.cs.nyu.edu> To: dblake@mfi.com, shasha@cs.nyu.edu Subject: figures Content-Type: text Content-Length: 171 Status: R Dear Deirdre, Figure 2 is ok. Figure 1 has an extra ED. Could you put the corrected figures on the web to replace the incorrect ones as soon as thismonth? Thanks, Dennis Corrections to the Chimps Column: 265-277 is a different font from the rest. No reason for this I think. Last month's solution: please format it as a table (3.40 to 3.58). Corrections to Dig: (Omniheurist Puzzle Corner) 2.117: What labeling would guarantee --> Can you find a labeling that would guarantee 2.119: numeric labels --> positive whole number labels 2.127: find a label such --> find a labeling such 3.41: no matterwhat --> no matter what 3.82: and Dean Clamons --> Dean Clamons, Tom Dinger, Oscar Schoof, Geldenhuys Jaco, Serguei Patchkovskii, and Onno Waalewijn. 3.103: and Dale Bennett --> Dale Bennett, Tom Dinger, Oscar Schoof, Geldenhuys Jaco, Serguei Patchkovskii, and Onno Waalewijn. From joshualynch@yahoo.com Tue Jan 5 19:13:22 1999 Return-Path: joshualynch@yahoo.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id TAA05753 for ; Tue, 5 Jan 1999 19:13:19 +0100 Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA11853 for ; Tue, 5 Jan 1999 19:13:17 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id NAA00562 for ; Tue, 5 Jan 1999 13:13:19 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id NAA10336 for ; Tue, 5 Jan 1999 13:00:51 -0500 (EST) Received: from send102.yahoomail.com (send102.yahoomail.com [205.180.60.90]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id NAA06371 for ; Tue, 5 Jan 1999 13:01:11 -0500 (EST) Message-ID: <19990105180156.22345.rocketmail@send102.yahoomail.com> Received: from [153.36.178.107] by send102.yahoomail.com; Tue, 05 Jan 1999 10:01:56 PST Date: Tue, 5 Jan 1999 10:01:56 -0800 (PST) From: Joshua Lynch Subject: Fair Swedes solution To: DrEcco@ddj.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Status: R This is a solution to the Fair Swedes problem from the Jan. 1999 issue of DDJ. The first thing I did was find all possible new districts that satisfied the population requirement. I found 151 using a little C++ program. I then wrote a C++ program to do a brute-force search with heuristics through combinations of 28 of these 151 possible new districts, but pretty quicky decided it was going to take too long. My next attempt was with a C++ program using a genetic algorithm inspired by the April 1997 DDJ article on Differential Evolution. This approach got me a nearly-optimal solution in 1,908,876 generations (2 days on my P100). However, the program crashed before finding a valid solution. I used the nearly-optimal solution with pen, paper, and coffee to find an optimal solution in about 1 hour. I received the February issue of DDJ a few days before finishing this problem. I checked my solution against yours, and they are slightly different solutions. The differences are in 4 south-eastern new districts. My solution follows as a list of all allowed new districts (based on population), with an asterisk by those in the optimal solution. I'll follow the list with the nearly-optimal solution from my genetic algorithm and the changes I made by hand. Each line of the list of allowed new districts looks like this: 0: population 6015 1 45 where 0 is the number of the new district, 6015 is the population of the new district, and 1 and 45 are the old districts that compose the new district. 0: population 6015 1 45 *1: population 5971 1 32 2: population 5993 1 28 3: population 5996 1 12 4: population 6061 2 5 61 5: population 6043 2 5 56 *6: population 6080 2 47 58 7: population 6076 2 5 47 *8: population 5999 3 52 9: population 5951 4 16 44 10: population 5989 4 16 20 11: population 5953 4 34 44 12: population 5976 4 29 34 13: population 5991 4 16 34 14: population 5968 4 38 50 *15: population 6002 4 34 38 16: population 5983 4 22 38 17: population 6000 4 16 38 18: population 5994 4 38 54 19: population 5985 4 34 54 20: population 5983 4 16 54 *21: population 5991 5 14 56 22: population 6020 5 56 61 23: population 6060 5 24 61 24: population 6009 5 14 61 25: population 5948 6 55 *26: population 5997 6 13 27: population 5992 7 14 61 28: population 5974 7 14 56 *29: population 6043 7 24 61 30: population 6014 7 14 24 *31: population 5997 8 66 32: population 5973 8 25 *33: population 6013 9 26 34: population 6021 10 57 35: population 5997 10 46 36: population 6047 10 45 *37: population 6028 10 12 38: population 6043 11 65 *39: population 6016 11 64 40: population 6058 11 63 41: population 6027 12 45 42: population 6008 12 43 43: population 6005 12 28 44: population 5980 14 56 61 45: population 6020 14 24 61 46: population 5969 15 37 51 47: population 6010 15 30 37 *48: population 5978 15 19 37 49: population 6009 16 20 60 50: population 5995 16 20 39 51: population 6037 16 34 38 52: population 6011 16 29 34 53: population 6026 16 20 34 54: population 5957 16 39 44 55: population 5988 16 34 44 56: population 5971 16 29 44 57: population 5986 16 20 44 *58: population 5980 16 44 54 59: population 6020 16 34 54 60: population 6018 16 20 54 61: population 6018 17 33 41 62: population 6006 17 21 33 63: population 5982 17 18 33 64: population 5979 17 41 51 65: population 5933 17 37 51 66: population 5967 17 33 51 *67: population 5969 17 30 51 68: population 5943 17 18 51 69: population 5989 17 51 53 70: population 6028 17 33 53 71: population 6004 17 18 53 72: population 6013 17 53 60 73: population 5952 17 51 60 74: population 5962 17 39 60 75: population 5991 17 33 60 76: population 5976 17 29 60 77: population 5991 17 20 60 78: population 5967 17 18 60 79: population 5973 18 41 51 80: population 5927 18 37 51 81: population 5961 18 33 51 82: population 5963 18 30 51 *83: population 6007 18 53 60 84: population 5946 18 51 60 85: population 5956 18 39 60 86: population 5970 18 29 60 87: population 5985 18 20 60 88: population 5921 19 37 51 89: population 5962 19 30 37 *90: population 5980 20 29 39 91: population 5957 20 39 44 92: population 5988 20 34 44 93: population 5971 20 29 44 94: population 6031 20 53 60 95: population 5971 20 44 60 96: population 5980 20 39 60 97: population 5994 20 29 60 98: population 5985 21 33 51 99: population 5997 21 41 51 *100: population 6036 21 33 41 101: population 6038 21 30 41 102: population 6020 22 34 38 103: population 5985 22 38 49 *104: population 5942 22 49 50 105: population 5986 22 38 50 *106: population 6010 23 45 107: population 5970 23 42 108: population 5966 23 32 *109: population 5940 25 55 *110: population 5995 27 62 111: population 5988 27 57 112: population 5964 27 46 *113: population 5991 28 59 114: population 6022 29 34 38 115: population 5982 29 34 39 116: population 5942 29 39 44 117: population 5973 29 34 44 118: population 6016 29 53 60 119: population 5956 29 44 60 120: population 5965 29 39 60 121: population 5996 29 34 60 122: population 6004 30 37 41 123: population 6038 30 33 41 124: population 5999 30 41 51 125: population 5953 30 37 51 126: population 5987 30 33 51 127: population 5999 31 62 *128: population 5968 31 46 129: population 5986 31 36 130: population 5990 32 65 131: population 5962 32 42 132: population 5997 33 41 51 133: population 5951 33 37 51 134: population 6005 34 38 50 135: population 5959 34 39 44 136: population 5999 34 38 44 *137: population 6053 35 63 *138: population 6019 36 40 139: population 5963 37 41 51 140: population 6002 39 53 60 141: population 5942 39 44 60 142: population 6021 40 66 *143: population 5994 42 65 144: population 5967 42 64 145: population 6006 42 45 146: population 5994 43 59 *147: population 6001 43 57 148: population 5996 45 46 *149: population 5976 48 150: population 6037 63 65 This is the nearly-optimal solution. It is a list of new districts from the list above. The problem with this solution is that old district 12 is not assigned to a new district, and old district 66 is assigned to two new districts (31 and 142). 1: population 5971 1 32 6: population 6080 2 47 58 8: population 5999 3 52 15: population 6002 4 34 38 21: population 5991 5 14 56 26: population 5997 6 13 29: population 6043 7 24 61 31: population 5997 8 66 33: population 6013 9 26 35: population 5997 10 46 39: population 6016 11 64 48: population 5978 15 19 37 58: population 5980 16 44 54 67: population 5969 17 30 51 83: population 6007 18 53 60 90: population 5980 20 29 39 100: population 6036 21 33 41 104: population 5942 22 49 50 106: population 6010 23 45 109: population 5940 25 55 110: population 5995 27 62 113: population 5991 28 59 129: population 5986 31 36 137: population 6053 35 63 142: population 6021 40 66 143: population 5994 42 65 147: population 6001 43 57 149: population 5976 48 My optimal solution is found by replacing new districts 35, 129, 142 with 37, 128, 138. Here it is in short: *1: population 5971 1 32 *6: population 6080 2 47 58 *8: population 5999 3 52 *15: population 6002 4 34 38 *21: population 5991 5 14 56 *26: population 5997 6 13 *29: population 6043 7 24 61 *31: population 5997 8 66 *33: population 6013 9 26 *37: population 6028 10 12 *39: population 6016 11 64 *48: population 5978 15 19 37 *58: population 5980 16 44 54 *67: population 5969 17 30 51 *83: population 6007 18 53 60 *90: population 5980 20 29 39 *100: population 6036 21 33 41 *104: population 5942 22 49 50 *106: population 6010 23 45 *109: population 5940 25 55 *110: population 5995 27 62 *113: population 5991 28 59 *128: population 5968 31 46 *137: population 6053 35 63 *138: population 6019 36 40 *143: population 5994 42 65 *147: population 6001 43 57 *149: population 5976 48 This is the first of your DDJ problems I have worked on, and I have enjoyed it very much. Joshua Lynch St. Paul, MN _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com From vbresan@jagor.srce.hr Tue Jan 5 19:38:07 1999 Return-Path: vbresan@jagor.srce.hr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id TAA05997 for ; Tue, 5 Jan 1999 19:38:06 +0100 Received: from jagor.srce.hr (jagor.srce.hr [161.53.2.130]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA12162 for ; Tue, 5 Jan 1999 19:38:02 +0100 (MET) Received: from localhost (vbresan@localhost) by jagor.srce.hr (8.9.0/8.9.0) with SMTP id TAA16645 for ; Tue, 5 Jan 1999 19:37:57 +0100 (MET) Date: Tue, 5 Jan 1999 19:37:57 +0100 (MET) From: Viktor Bresan To: Dennis Shasha Subject: Re: Fair Swedes In-Reply-To: <199812271724.SAA14142@gerard.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: R On Sun, 27 Dec 1998, Dennis Shasha wrote: > By all means send a solution. > Your name won't appear in the next issue, but a few hence. All right! Here it comes: District(s) Population 1. 3, 52 5999 2. 21, 33, 41 6036 3. 30, 51, 17 5969 4. 19, 15, 37 5978 5. 8, 66 5997 6. 55, 25 5940 7. 53, 60, 18 6007 8. 13, 6 5997 9. 48 5976 10. 58, 47, 2 6080 11. 40, 36 6019 12. 20, 39, 29 5980 13. 35, 63 6053 14. 11, 64 6016 15. 7, 24, 61 6043 16. 5, 56, 14 5991 17. 31, 62 5999 18. 16, 4, 54 5983 19. 44, 34, 38 5999 20. 9, 26 6013 21. 49, 22, 50 5942 22. 65, 32 5990 23. 42, 23 5970 24. 1, 28 5993 25. 59, 43 5994 26. 45, 46 5996 27. 10, 12 6028 28. 27, 57 5988 Well, that's it. From peter@engcorp.com Sun Jan 10 03:55:10 1999 Return-Path: peter@engcorp.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id DAA20726 for ; Sun, 10 Jan 1999 03:55:09 +0100 Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id EAA19168 for ; Sun, 10 Jan 1999 04:01:14 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id WAA06698 for ; Sat, 9 Jan 1999 22:01:13 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id WAA12888 for ; Sat, 9 Jan 1999 22:01:03 -0500 (EST) Received: from granite.sentex.net (granite.sentex.ca [199.212.134.1]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id WAA18275 for ; Sat, 9 Jan 1999 22:00:58 -0500 (EST) Received: from server1 ([206.51.25.79]) by granite.sentex.net (8.8.8/8.6.9) with SMTP id WAA10625 for ; Sat, 9 Jan 1999 22:00:45 -0500 (EST) Message-Id: <199901100300.WAA10625@granite.sentex.net> Received: from sinbad by server1 with SMTP for DrEcco@ddj.com ; Saturday, 09 Jan 1999 21:49:30 EST Date: Sat, 09 Jan 1999 21:49:35 EST From: Peter Hansen To: DrEcco@ddj.com X-Mailer: J Street Mailer (build 98.6.3) Subject: Fair Swedes Status: R For DDJ, January 1999: Using a genetic algorithm (my first) and a little bit of human assistance (my environment had a hard time maintaining biodiversity and I had to tweak the procreation parameters as the algorithm approached the final answer), I found the following mapping. I believe this mapping is also an optimal one if one wishes to minimize the sum of the absolute values of the differences of the population of each district from 6000. Districts New Old Population 1 1, 32 5971 2 2, 47, 58 6080 3 3, 52 5999 4 4, 38, 54 5994 5 5, 56, 61 6020 6 6, 13 5997 7 7, 14, 24 6014 8 8, 66 5997 9 9, 26 6013 10 10, 46 5997 11 11, 64 6016 12 12, 28 6005 13 15, 19, 37 5978 14 16, 20, 44 5986 15 17, 21, 33 6006 16 18, 53, 60 6007 17 22, 49, 50 5942 18 23, 45 6010 19 25, 55 5940 20 27, 57 5988 21 29, 34, 39 5982 22 30, 41, 51 5999 23 31, 62 5999 24 35, 63 6053 25 36, 40 6019 26 42, 65 5994 27 43, 59 5994 28 48 5976 ------- 167976 The genome used was an array of 84 bytes arranged in groups of three (because observation showed that a new district would always be formed from 1 to 3 old districts). The old district numbers were randomly distributed through the genome space and the remaining 18 bytes were left as zero. Within any group of three, the bytes represented from 0 to 3 old district numbers which together made up a potential new district. Each generation, the fitness of a given genotype was evaluated based on three criteria. (Actually, inverse fitnesses were used to allow the algorithm to approach 0 instead of some arbitrary large number.) A negative fitness value was assigned the farther away any district in a group was from its brethren. The fitness became still more negative the farther away from the target 6000 +/-100 the population of a potential new district was. Finally, an empty district was also penalized, to ensure the final solution had 28 full districts. Propagation of the genotypes was based on a number of probabilities, some fixed, some tied to the fitness of the specimen. A given genotype was allowed to procreate a limited number of times, the better ones were more likely to be propagated forward to the next generation intact, and the best candidate was also propagated intact. Some effort was made to identify close relatives (highly similar genetic material) and avoid excessive incestual procreation to maintain biodiversity. The genetic material was transferred from the two parents by first selecting one as the "dominant" mate, and removing from a random location a random length of the genome. This was used as the starting point for the genome of the offspring. Since this would "use up" a quantity of the district numbers (which should not be repeated in a given genome) from the second mate, a scan was performed in which all unused genes were removed and appended in the same order to the end of the offspring. Finally, each new generation was subjected to a small mutational influence which might cause swapping of two or more bytes in the genome. That all said, I confess I was not able to get the algorithm to converge completely at any time. One set of parameters was enough to reach a fitness of -1, which is only one step away from a solution, but this had one district which was not connected (two old districts were together but the third was across the map). Largely, I believe, because of the coarseness of my tools (command-line Java with no GUI), I took long enough to get even that far that I ended up hardcoding the nearly complete solution with the disconnected district "fixed", to get the algorithm past its mental block. Restarting it at this point quickly reached the final state. I believe low genetic diversity was the source of the problem, and the algorithm didn't have enough different genetic material present from which to construct an alternative solution once it had almost converged on an answer. It basically sat for thousands of generations, as the world did with the dinosaurs, I suppose, smugly thinking it had already produced the pinnacle of evolution. Not having a meteor handy, I applied my own hand of fate to give it a push in the right direction. ----------------------------------------------------------- Peter Hansen Engenuity Corporation peter@engcorp.com www.engcorp.com Guelph, Ontario, Canada ----------------------------------------------------------- From mathew@kuifje.demon.co.uk Sun Jan 10 11:46:50 1999 Return-Path: mathew@kuifje.demon.co.uk Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id LAA21946 for ; Sun, 10 Jan 1999 11:46:50 +0100 Received: from cs.nyu.edu (CS.NYU.EDU [128.122.80.78]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA28616 for ; Sun, 10 Jan 1999 11:52:57 +0100 (MET) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id FAA08809 for ; Sun, 10 Jan 1999 05:53:01 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id FAA21318 for ; Sun, 10 Jan 1999 05:52:52 -0500 (EST) Received: from post.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id FAA17838 for ; Sun, 10 Jan 1999 05:52:49 -0500 (EST) Received: from [194.222.69.225] (helo=kuifje.demon.co.uk) by post.mail.demon.net with smtp (Exim 2.10 #1) id 0zzIUC-00059J-00 for DrEcco@ddj.com; Sun, 10 Jan 1999 10:52:48 +0000 Message-ID: Date: Sun, 10 Jan 1999 10:51:31 +0000 To: DrEcco@ddj.com From: "Dr. Mathew R. Davies" Subject: Fair Swedes MIME-Version: 1.0 X-Mailer: Turnpike (32) Version 3.05 Status: R Dear Dr. Ecco, Her Brittanic Majesty's Foreign and Commonwealth Office takes great pleasure in submitting its solution to the Fair Swedes partitioning problem that was posed in the January, 1999 edition of Dr. Dobb's Journal. We had initially considered the imposition of a "no-fly" zone over both the North and South of Goetoldenborg, but our military advisers raised fears that the high-G turns that would be required at either end of the city might cause problems for our boys in blue. We then tried the Demster-Schaefer approach, but even the vast pool of resources available to us here proved insuffcient to deal with the "2 to the omega" build up of parallel hypotheses. Instead, we used goat entrails to devise a cunning partition that we believe meets all of Evangeline's liberal demands. To this end, we propose the formation of the following set of super-districts, each created by combining a connected set of the original districts: Super-District Old Districts New Population -------------- ------------- -------------- 1 22, 49, 50 5942 2 16, 20, 34 6026 3 36, 40 6019 4 11, 64 6016 5 7, 14, 24 6014 6 4, 38, 54 5994 7 25, 55 5940 8 27, 46 5964 9 8, 66 5997 10 29, 39, 44 5942 11 10, 12 6028 12 42, 65 5994 13 21, 30, 41 6038 14 48 5976 15 6, 13 5997 16 28, 59 5991 17 3, 52 5999 18 9, 26 6013 19 2, 47, 58 6080 20 5, 56, 61 6020 21 23, 45 6010 22 15, 19, 37 5978 23 17, 33, 53 6028 24 31, 62 5999 25 35, 63 6053 26 18, 51, 60 5946 27 43, 57 6001 28 1, 32 5971 Je vous souhaite une bonne annee! -- Mathew Davies From benjamin.c.chaffin@intel.com Sun Jan 10 22:56:28 1999 Return-Path: benjamin.c.chaffin@intel.com Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by wanda.inria.fr (8.8.7/8.6.6) with ESMTP id WAA23458 for ; Sun, 10 Jan 1999 22:56:27 +0100 Received: from calliope1.fm.intel.com (calliope1.fm.intel.com [132.233.247.10]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA05819 for ; Sun, 10 Jan 1999 23:02:29 +0100 (MET) Received: from fmsmsx17.intel.com (fmsmsx17.fm.intel.com [132.233.58.209]) by calliope1.fm.intel.com (8.9.1a/8.9.1/d: relay.m4,v 1.6 1998/11/24 22:10:56 iwep Exp iwep $) with ESMTP id WAA17322 for ; Sun, 10 Jan 1999 22:02:24 GMT Received: by FMSMSX17 with Internet Mail Service (5.5.2232.9) id ; Sun, 10 Jan 1999 14:02:24 -0800 Message-ID: <4575832C8E71D111AC4100A0C96B512702D1F246@FMSMSX36> From: "Chaffin, Benjamin C" To: "'Dennis Shasha'" Subject: RE: Question on January puzzle Date: Sun, 10 Jan 1999 14:02:22 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" Status: R Well, true enough, you don't districts connected by a single point, though you can get a better solution if you allow them. If single-point connections are not allowed, then the best solution I could find is solution A below, which has a total deviation of 510. (That is, the sum over the 28 districts of abs(population-6000) is 510.) There are a few permutations of this solution which also have a total deviation of 510, such as replacing 4,38,54 and 16,34,44 with 4,16,54 and 34,38,44. One might be tempted the try to break the tie between these by seeing which has the lowest maximum error, but since 2,47,58 must be part of any solution and has an error of 80, this doesn't work. Perhaps the tie could be broken by some more subtle metric. If single-point connections are allowed, then the best solution I could find is solution B below, which has a total deviation of 492. In either case, the worst legal solution I found is solution C below, which has a total deviation of 840. Again, there are a number of permutations of this solution with the same total error. Thanks for a fun problem! Ben Chaffin ################### SOLUTION A #################### New district #1: 1 32 : population 5971 New district #2: 2 47 58 : population 6080 New district #3: 3 52 : population 5999 New district #4: 4 38 54 : population 5994 New district #5: 5 56 61 : population 6020 New district #6: 6 13 : population 5997 New district #7: 7 14 24 : population 6014 New district #8: 8 66 : population 5997 New district #9: 9 26 : population 6013 New district #10: 10 46 : population 5997 New district #11: 11 64 : population 6016 New district #12: 12 28 : population 6005 New district #13: 15 19 37 : population 5978 New district #14: 16 34 44 : population 5988 New district #15: 17 21 33 : population 6006 New district #16: 18 53 60 : population 6007 New district #17: 20 29 39 : population 5980 New district #18: 22 49 50 : population 5942 New district #19: 23 45 : population 6010 New district #20: 25 55 : population 5940 New district #21: 27 57 : population 5988 New district #22: 30 41 51 : population 5999 New district #23: 31 62 : population 5999 New district #24: 35 63 : population 6053 New district #25: 36 40 : population 6019 New district #26: 42 65 : population 5994 New district #27: 43 59 : population 5994 New district #28: 48 : population 5976 #################################################### ################### SOLUTION B #################### New district #1: 1 23 : population 5979 New district #2: 2 47 58 : population 6080 New district #3: 3 52 : population 5999 New district #4: 4 38 54 : population 5994 New district #5: 5 7 14 : population 6003 New district #6: 6 13 : population 5997 New district #7: 8 66 : population 5997 New district #8: 9 26 : population 6013 New district #9: 10 46 : population 5997 New district #10: 11 42 : population 6015 New district #11: 12 28 : population 6005 New district #12: 15 19 37 : population 5978 New district #13: 16 34 44 : population 5988 New district #14: 17 21 33 : population 6006 New district #15: 18 53 60 : population 6007 New district #16: 20 29 39 : population 5980 New district #17: 22 49 50 : population 5942 New district #18: 24 56 61 : population 6031 New district #19: 25 55 : population 5940 New district #20: 27 57 : population 5988 New district #21: 30 41 51 : population 5999 New district #22: 31 62 : population 5999 New district #23: 32 45 : population 6002 New district #24: 35 63 : population 6053 New district #25: 36 40 : population 6019 New district #26: 43 59 : population 5994 New district #27: 48 : population 5976 New district #28: 64 65 : population 5995 #################################################### ################### SOLUTION C #################### New district #1: 1 12 : population 5996 New district #2: 2 47 58 : population 6080 New district #3: 3 52 : population 5999 New district #4: 4 38 54 : population 5994 New district #5: 5 24 61 : population 6060 New district #6: 6 13 : population 5997 New district #7: 7 14 56 : population 5974 New district #8: 8 66 : population 5997 New district #9: 9 26 : population 6013 New district #10: 10 45 : population 6047 New district #11: 11 63 : population 6058 New district #12: 15 19 37 : population 5978 New district #13: 16 20 34 : population 6026 New district #14: 17 33 53 : population 6028 New district #15: 18 51 60 : population 5946 New district #16: 21 30 41 : population 6038 New district #17: 22 49 50 : population 5942 New district #18: 23 32 : population 5966 New district #19: 25 55 : population 5940 New district #20: 27 62 : population 5995 New district #21: 28 59 : population 5991 New district #22: 29 39 44 : population 5942 New district #23: 31 46 : population 5968 New district #24: 35 65 : population 6038 New district #25: 36 40 : population 6019 New district #26: 42 64 : population 5967 New district #27: 43 57 : population 6001 New district #28: 48 : population 5976 #################################################### > -----Original Message----- > From: Dennis Shasha [SMTP:Dennis.Shasha@inria.fr] > Sent: Friday, January 08, 1999 11:40 PM > To: bchaffin@teleport.com > Subject: Re: Question on January puzzle > > I'm looking at the January redistricting problem, and the answer to > this > question is not obvious to me from the text of the column: are districts > connected > by a single point considered to be connected? > > Ben Chaffin > bchaffin@teleport.com > > > Dear Ben, > No they are not connected. > You don't need them to be. > Best, > Dennis Corrections to Enemy's Enemy 3.15: get a difficulty of less than --> find a strategy having a difficulty of less than 3.30: can only mark --> can mark only 3.84: September 1999). --> September 1999): 3.92: and C. Mark Yendt, --> C. Mark Yendt, and Onno Waalewijn. 3.112: paraphrase --> paraphrase, though it is suboptimal 3.115: 1 2 --> room: 1 2 4.22: Tomas Rockicki --> Tomas Rokicki Corrections to Escape 1. 2.23: 20 -> 19 2. 2.81: for traveling --> to travel 3. 2.84: add an end quote Then insert: "But wait," said Liane, "It looks as if the robots have passed only 5 rooms." "Nice observation, young lady," the warden said. "The cells are the narrow line segments pointing north-south. The north-south corridors are very wide whereas the east-west ones are very narrow. So, you should count each vertical line segment as a cell. 4. 218: 12:02:15 --> 12:03:35 5. 2.129: replace period by question mark 6. 3.94: cals --> calls In the prison figure: on the bottom, the initial door should be at the 10th line, where the line on the left is line 1. Please see my figure. Also, the thick lines on the left should go to the 6th position. Corrections to the Getting Even Piece: In Bio: The l Lives --> The Lives 2.2: began to explain --> began his explanation 2.5: change last sentence to: Mathematics, in turn, helps us ensure that those option streams yield us positive net income at low risk while providing a service for our customers. 3.60: Please lay out using these line breaks: Dave Gwenyth Hillary Isaac Jack Larry Olivia Rivera, or Dave Gwenyth Hillary Isaac Larry Olivia Petra Sam, or Dave Gwenyth Hillary Isaac Larry Olivia Rivera Sam. Dear Deirdre, 1. In Bio, second to last line, Springer-Verlag, 1997 should be Springer-Verlag, 1998 2. Line 2.38, cde should be in italics. 3. 2.74 under three --> three 4. I messed up the parentheses on the bottom so 2.133, 2.134, 3.2, and 3.3 should read: (The f moves to position 1 and bcde are moved one to the right; remember that the sequence numbering starts at 0). 5. 3.3. "Fortunately" should start a paragraph. 6. 3.45 continued its obsessions with --> returned to its twin obsessions: 7. following the last line 4.7, please add the following names: Dan Falk David Seaman Lee Thomason Steve Worley Please ack this email. Best, Dennis 1. 2.8: a infintissimo --> an infintissimo 2. 2.19-2.23: please eliminate that paragraph. 3. 2.131: Several other solutions used Hasan's layout, but improved --> Several other solutions improved 4. 3.4 and 3.5, if you find it difficult to print an epsilon (a Greek E), then please use x instead of the italicized E, so people don't get confused with a train station. 3.6: minutes. --> minutes and let an asterisk represent a one minute wait. Dear Deirdre, 1. Figure 1, d, e, and f have a small bug The length two vertical lines are one dot too low. Here is what they should look like: . . . . | | | .____. . . | | | . . . . . ._____ . . . . . . | | | .____. . . | | | .____. . . . ._____ . . . . . . | | | .____. . . | | | .____. . . | | | . ._____ . . 2. 2.104. "Symmetrically for Steeps" refers to articulation so should be moved up one line (to 2.103). Inside the parentheses in 2.104, put in the word "Compensation" 3. 2.106: one flat line segment --> one flat line segment anywhere he likes 4. Fig. 2: attachment --> articulation unattached --> isolated attached --> articulated 3.5: let's stay with "Articulated Flats and Steeps" --> let's stay with "Articulated Flats and Steeps" of size 4 and greater Foxy correct: Replace 2.33 and 2.34 by: Liane sketched out the relationships as you can see here on the side. 2.109: before "used all three", insert were able to figure out how to pick up 14 victims. 2.128: add: Thus the ambulances picked up 19 victims altogether. 3.23: John Trono tried a variety of strategies --> John Trono suggested a criss-crossing diagonal strategy that worked nicely. In the Bio: and Codes, Puzzles, and Conspiracy --> Codes, Puzzles, and Conspiracy 3.60: order of objects --> order of the auction 3.36: please indent slightly "actually spent..." 3.45: please indent slightly "actually spent..." 3.47: please indent slightly "actually spent..." 3.67: please indent slightly "Carla wins..." 3.74: please indent slightly "Carla wins..." 3.76: please indent slightly "Brad wins..." In fact, if possible, please move 3.65-3.67 to the next column 4.65 ff: Reader Notes on Flats and Steeps So far, there is no web version of the articulated Flats and Steeps game. I guess people must still be working on closed forms solutions. Christopher Creutzig reports a Prolog program that suggests that Flats has a winning strategy on the 4 by 4 board. I will report on other progress in the coming months. Corrections to Joints in Space: The trouble with the fax is I can't read the line numbers, so please accept these estimates 1. second paragraph on second column of p. 2 (2.83 I think) "in all matters of joint ventures" --> "in all manner of joint ventures" 2. 2.102. From your encoding, it looks as if --> From your encoding, can we conclude that 3. 2.103. empath," said --> empath?" asked 4. 3.17 and station B can hold six trains --> and station B can hold four trains 5. 3.63. and Bryan S. McDaniel --> Bryan S. McDaniel, Jacco Kulman, Kakulidis Iulian, Joshua Lynch, Viktor Bresan, Peter Hansen, Mathew R. Davies, and Benjamin C. Chaffin. .5: was an optical propulsion physicisist and she --> described herself as an optical propulsion physicisist. She 2.10: are laser shuttles. A laser shuttle --> 2.10: are laser shuttles,'' she continued. ``A laser shuttle 2.58: --'m not good--> --I'm not good 2.83: steep player --> the steep player 2.84: with Figure --> to the first move as in Figure 2.85: like Figure 2(d) --> as in Figure 2(d) 2.86: seven steeps --> seven steep moves 2.89: one more steep and --> oone more steep move 2.93: the flats --> flats 2.95(insert): Please remember that Straight Flats and Steeps leaves open the much more complex Articulated Flats and Steeps, especially for larger sizes. I will report on web sites having clever algorithms in a future column. 2.110: Desplenter, and Jonathan Chen --> Desplenter, Jonathan Chen, Mayne Oestlyngen, and Jacco Kulman. From shasha@shasha.cs.nyu.edu Tue Apr 14 22:01 EDT 1998 Return-Path: Received: from cs.nyu.edu by griffin.cs.nyu.edu (SMI-8.6/1.20) id WAA22681; Tue, 14 Apr 1998 22:01:41 -0400 Received: from shasha.cs.nyu.edu by cs.nyu.edu (SMI-8.6/1.20) id WAA27443; Tue, 14 Apr 1998 22:01:41 -0400 Received: by shasha.cs.nyu.edu (SMI-8.6/1.20) id WAA29529; Tue, 14 Apr 1998 22:01:41 -0400 Date: Tue, 14 Apr 1998 22:01:41 -0400 From: shasha@shasha.cs.nyu.edu (Dennis Shasha) Message-Id: <199804150201.WAA29529@shasha.cs.nyu.edu> To: dblake@mfi.com, shasha@cs.nyu.edu Subject: ecco column/lines of fire Content-Type: text Content-Length: 306 Dear Deirdre, Just a few comments on this column: 1. line 2.49. Solo smiled --> Solo nodded Reason: I want to make it clear that the answer is yes. 2. line 2.103 Please note the availability of the table on the ddj web site. (That way, people can use it as inputs to their programs.) Thanks, Dennis Dear Deirdre, Thanks for your excellent work. Best, Dennis In the bio, Out of their Minds has a pub date of 1995 (hardcover) and 1998 (softcover). I'd be happy if you used the 1998 date. 2.2: demeanor --> prosody 2.3: looked much --> looked and sounded much 2.8: felt it --> had felt it 2.9-2.12: ``The paradox of modern time is that communication and transport have become nearly instantaneous, enabling people to communicate and mingle as never before, yet ethnic tension becomes ever more brutish,'' 2.35: 10x10 grid, with each cell containing has --> 10x10 grid. Each cell contains --> 2.52: Liane said --> I said 2.128,2.129: delete that sentence 3.24: Can you find a state where each group has a connected region using 15 or fewer exchanges? --> Can you find 15 or fewer exchanges to achieve a state in which each group has a continuous region? 3.51: slightly better --> slightly better (the expected number of flips is 55) 3.64: arriving at the final value --> becoming in-bounds. 3.81: proof following --> idea of the proof following look at simple.notes for new solutions. 2.11 shouldn't surprise anybody --> should surprise nobody. 2.30 A few --> The few 2.67 their wealth --> his or her wealth 2.68: The centimillionaire would each --> Each centimillionaire would 3.6: bowed the visitor out --> led the visitor to the door 3.29: add: Third, is there any way to do either the original problem or the second one with fewer phone calls? 3.123: and Paulo Friedli --> Paolo Friedly, David Berson, and Prof. Dr. Michael Vielhaber. Dear Deirdre, I find myself disagreeing with some of your edits. Dennis 1. 2.1-2.5: ``I manufacture money,'' Eli Tyler said, his ready grin making his eyes gleam. He was wearing a shirt with beautiful coins from around the earth. 2. 2.13-2.14: ``What a terrible problem!'' Ecco said, matching Tyler's grin. 3. 2.52: a shake of his head --> a frown 4. 2.74: For example, --> On the other hand, 5. 3.10: insert at the beginning: Can you do better? 6. 3.24: may --> may, if these coins are available, Dear Deirdre, Thanks for editing so fast. The only thing likely to change between now and the 16th (when I leave) are new solvers of the fitting puzzle. If you don't mind, I'll collect those and send them on by then. Corrections to Monopoles puzzle: 2.09: pointing his hand --> sweeping his arm 2.38: mean, exactly --> mean exactly [Deirdre, not sure about this one. Use your judgement.] 2.44: exactly three --> three 2.49: will show --> will exhibit 3.14: same room as the original --> same room as the original and there is a full set (52) of spares. 3.33: as originals --> as originals and there is a full set (59) of spares. 3.52: and Jim Brannan. --> Jim Brannan, and Rodney Meyer. Figure 1: at most three edges --> at least three edges Well within the 200 foot height limit of the canal. Steven Augart Denis Birnie Wim Nuij Mike Larsen Norman Roundy From j-waldby@pat7.com Sun Jul 8 19:41 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id TAA19464 for ; Sun, 8 Jul 2001 19:41:13 -0400 (EDT) Received: from iridium.mv.net (iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id TAA22357 for ; Sun, 8 Jul 2001 19:41:15 -0400 (EDT) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id TAA22930 for ; Sun, 8 Jul 2001 19:41:14 -0400 (EDT) Received: from femail1.sdc1.sfba.home.com (femail1.sdc1.sfba.home.com [24.0.95.81]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id TAA00271 for ; Sun, 8 Jul 2001 19:41:13 -0400 (EDT) Received: from pat7.com ([24.7.41.239]) by femail1.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010708234106.ZTKQ26599.femail1.sdc1.sfba.home.com@pat7.com> for ; Sun, 8 Jul 2001 16:41:06 -0700 Sender: j-waldby@mercury.mv.net Message-ID: <3B48EF81.B584152A@pat7.com> Date: Sun, 08 Jul 2001 18:40:49 -0500 From: James Waldby Reply-To: j-waldby@pat7.com Organization: su X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.16-22 i586) X-Accept-Language: en MIME-Version: 1.0 To: drEcco@ddj.com Subject: "Dr. Ecco" July 2001 DDJ - some solutions Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 3008 Status: R Five weeks ago I wrote a program that produced millions of solutions for the beams problem, but then I got busy on other things and didn't send them all in. Anyhow, here are a few unusual solutions. If I remember correctly, column 3 = lengths of back parts, and column 4 = lengths of front parts. The line before each solution gives a solution serial number, the number n of different solutions found using those same lengths, a storage error count m, and two hash numbers h. - James Waldby (Two sets of nearly-equal-length-beams) 8193. n 69240 m0 h 127232 138401 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.2 1.4+2.8 4.2 Beam 4. Length 11.8 3.3+3.9+4.6 0.4+2.4+4.4+4.6 Beam 5. Length 11.8 2.0+2.4+3.1+4.3 1.1+3.3+3.7+3.7 Beam 6. Length 12.1 1.0+2.1+2.2+6.8 0.1+0.7+1.0+1.2+1.2+2.4+2.5+3.0 (Two short, two medium, two long lengths) 24993. n 2128 m0 h 84524 199686 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.7 1.4+3.3 0.1+4.6 Beam 4. Length 5.6 1.0+4.6 1.2+4.4 Beam 5. Length 14.5 2.2+2.4+3.1+6.8 0.4+2.5+3.7+3.7+4.2 Beam 6. Length 15.1 2.0+2.1+2.8+3.9+4.3 0.7+1.0+1.1+1.2+2.4+2.4+3.0+3.3 (A pair and a triple of equal lengths - one of four found) 8522. n 396 m0 h 39019 181322 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.3 4.3 0.1+4.2 Beam 4. Length 4.3 1.0+3.3 1.0+3.3 Beam 5. Length 4.3 2.1+2.2 0.7+1.1+2.5 Beam 6. Length 27.0 1.4+2.0+2.4+2.8+3.1+3.9+4.6+6.8 0.4+1.2+1.2+2.4+2.4+3.0+3.7+3.7+4.4+4.6 (Another pair and triple) 48838. n 92 m0 h 66491 438123 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 5.5 2.2+3.3 1.1+4.4 Beam 4. Length 5.5 2.4+3.1 0.1+1.2+4.2 Beam 5. Length 5.5 1.4+2.0+2.1 1.0+1.2+3.3 Beam 6. Length 23.4 1.0+2.8+3.9+4.3+4.6+6.8 0.4+0.7+2.4+2.4+2.5+3.0+3.7+3.7+4.6 (With 5 beams being unbroken pieces - one of 6 such solutions) 4589. n 422 m0 h 69035 247663 Beam 1. Length 4.0 1.3+2.7 4.0 Beam 2. Length 4.0 1.4+2.6 0.4+3.6 Beam 3. Length 4.2 1.4+2.8 4.2 Beam 4. Length 4.4 2.0+2.4 4.4 Beam 5. Length 4.6 4.6 4.6 Beam 6. Length 26.7 1.0+2.1+2.2+3.1+3.3+3.9+4.3+6.8 0.1+0.4+0.7+1.0+1.1+1.2+1.2+2.4+ 2.4+2.5+3.0+3.3+3.7+3.7 From j-waldby@pat7.com Mon Jul 9 14:17 EDT 2001 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA00495 for ; Mon, 9 Jul 2001 14:17:18 -0400 (EDT) Received: from femail1.sdc1.sfba.home.com (femail1.sdc1.sfba.home.com [24.0.95.81]) by cs.nyu.edu (8.9.3+Sun/8.9.3) with ESMTP id OAA22098 for ; Mon, 9 Jul 2001 14:17:19 -0400 (EDT) Received: from pat7.com ([24.7.41.239]) by femail1.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010709181718.LHKV26599.femail1.sdc1.sfba.home.com@pat7.com> for ; Mon, 9 Jul 2001 11:17:18 -0700 Sender: j-waldby@cs.nyu.edu Message-ID: <3B49F50A.369B1B72@pat7.com> Date: Mon, 09 Jul 2001 13:16:42 -0500 From: James Waldby Reply-To: j-waldby@pat7.com Organization: su X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.16-22 i586) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Re: "Dr. Ecco" July 2001 DDJ - some solutions References: <200107091521.LAA16252@shasha.cs.nyu.edu> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 1927 Status: R Dennis Shasha wrote: > > Thanks. > Could you tell me again how many solutions you found and > how you found them? > Dennis Sure (although this isn't "again", since I didn't email about it before) - 1. Number of solutions -- Depends on how long the program runs, and whether we count variations. For example, about 30000 distinct-set-of-lengths* solutions arose when program ran 2 hours (on 450MHz Linux system) and about 85000 after 10 hours. I imagine this is a tiny fraction of the solutions possible. *A given set of lengths possibly may be formed in multiple ways with different pieces of stone. For example, the program found 69240 different ways to make the lengths-combination set of (4.0, 4.0, 4.2, 11.8, 11.8, 12.1). The program reported 1330440470 variants of the first 25000 distinct-lengths sets. 2. How the program works -- Briefly, exhaustive search via for loops nested 12 deep. The even-layer loops select a next-larger length for a back piece; odd-layer loops select (via direct index) an exact-match length for a front piece, if any is available, else break. Available lengths are maintained in ascending order [1] in lists. The back list starts out with 131072 (2^17) entries and the front list starts with 1048576 (2^20), since there are 17 and 20 back and front pieces. Each list entry contains a length and a bit mask. The length is the sum of the piece lengths corresponding to the bits in the mask. Before each for-loop step, the program makes a new copy of the list to strip out pieces that conflict with the cumulative mask of used pieces. [2] [1] Generating pieces in increasing order provides an upper bound on length of (47.9 - 11 - current total)/m for current beam, when m+1 beams are left to find, and also lessens how much of the lists need to be copied. [2] List-trimming is expensive at outer levels, but gets progressively faster at inner levels of fors. Corrections to Rosetta 1. I really prefer putting "the woman said" after the quote on line 2.4 rather than on line 2.1. But I defer to you if you insist. 2. 2.123 -- delete "and mapping" 3. 3.17 -- possible --> possible. (Hint: There are three 2s, two xs and a v in the license plate.) 4. 3.74 -- A, --> A. 5. 3.79 -- and Rodney P. Meyer --> Rodney P. Meyer, Benjamin C. Chaffin, Serguie Patchkovskii, Bharat Chandramouli, Hans Knorr, and Christopher Mills. 6. 3.82 -- from Yves Piguet and Ted Alper --> from Ben Chaffin. 7. 3.83 -- Yves's --> Ben's 8. 3.84 -- 1, 2, 4, 8, 15, 29 90, 136, 202, 258, 314, and 492. --> 2, 4, 8, 16, 32, 60, 73, 116, 207, 230, 341, and 452. 9. 3.86 --- 1064 --> 1023 10. 3.87 -- Ted's --> Ben's 11. 3.89 -- 2737: 9, 16, 18, 20, 24, 32, 64, 119, 220, 404, 744, and 1369. --> 2556: 16, 18, 19, 20, 24, 32, 64, 128, 237, 420, 712, and 1187. 12. 3.11 -- numbers --> sequences Corrections to Omniheurist Column: Simple 2.13: conversational --> professorial 2.94: replace parens by dashes. 2.109: figured it out --> figured them out 2.114: is one approach that works --> is a design that works 2.117: Cut out For the first time in my writing this column, nearly --> Nearly 2.128: Is there a mathematical model of history there? --> Are border states always fickle? Actors piece: 1. Let's change the title to something more fun. Actors --> Stars and Starlets 2. 2.52 in the scenes, listed in order: --> in each scene, one line per scene, listed in the order of the script: 3. 3.8: and Patrick R. Schonfeld --> Patrick R. Schonfeld, and Alan E. Dragoo 3. 3.19: add a new sentence: It's tough to be a heir. Correction to Sticks: 1. In my bio, please add the following book reference that just came out: Pattern Discovery in Biomolecular Data : Tools, Techniques, and Applications by Jason Wang, Bruce Shapiro, Dennis Shasha Oxford University Press, 1999. 2. 2.100. Change "figure" to "child" 3. 3.26 in solution --> in the solution 4. 3.38 mentioned below as having correct solutions --> mentioned below 5. 3.64 T0 --> T0 (time 0) 6. 3.50: Marty Pinaud Marty Pinaud, Burghart Hoffrichter, 7. 3.52 Philip Straite --> Philip Straite (and later Kevin A Shepherd) 8. 3.83: Jimmy Hu and later Scott J. Taylor --> Jimmy Hu, Scott J. Taylor, and Jeff Hafner --> 9. 3.107 Ralph Fellow --> Ralph Fellow and Magne Oestlyngen 10. 3.109 his --> their 11. 3.111, please add: Magne went on to give a nine minute solution using 5 calabazas and assuming that each one flows at the same rate (as in Jimmy Hu's assumption). .bp From magne@spacetec.no Mon Nov 1 13:57 EST 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id NAA00254 for ; Mon, 1 Nov 1999 13:56:55 -0500 (EST) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id NAA02727 for ; Mon, 1 Nov 1999 13:56:55 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id NAA26435 for ; Mon, 1 Nov 1999 13:56:54 -0500 (EST) Received: from spacetec.no (jupiter.spacetec.no [192.51.5.11]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id NAA23580 for ; Mon, 1 Nov 1999 13:56:51 -0500 (EST) Received: from spacetec.no (isdn-10.spacetec.no [192.107.114.43]) by spacetec.no (8.9.1a/8.9.1) with ESMTP id TAA32045 for ; Mon, 1 Nov 1999 19:56:13 +0100 Message-ID: <381DE2DE.5774726E@spacetec.no> Date: Mon, 01 Nov 1999 19:58:38 +0100 From: Magne =?iso-8859-1?Q?=D8stlyngen?= Organization: Kongsberg Spacetec X-Mailer: Mozilla 4.6 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: DrEcco@ddj.com Subject: Calabaza Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 2738 Status: R Hello, I don't think it is possible to use less than 5 c. (Or, in general, less than m c.'s, when the fastest you can drain a c. is m minutes.) To start marking minutes after 40 minutes is easy. Just fill the c.'s like this: c1 c2 c3 c4 c5 -------------- 5 5 5 5 11 5 5 5 5 5 5 5 11 11 5 5 5 5 5 11 11 11 5 5 5 11 11 11 11 5 -------------- 40 41 42 43 44 then continue using 5 minute drains. But, it is faster to start after 10 minutes. Since filling a c. takes no time, I assume plugging/unplugging a hole also takes no time. Like this: time c1 c2 c3 c4 c5 ----------------------- 0 s5 s11 s11 s11 s11 1 | | | | | 2 | | | | | 3 | | | | | 4 | | | | | 5 s5 | | | | 6 | | | | | 7 | | | | | 8 | | | | | 9 | | | | | 10 s5 | p p p 11 | s5 u - - 12 | | s5 u - 13 | | | s5 u 14 | | | | s5 15 s5 | | | | s5 - start a 5m drain s11 - start a 11m drain p - plug hole (pauses drain) u - unplug hole (starts drain again) | - water flows - - no flow Solving the second part is much like this. We have n = m + m + 1 (n is odd) and n = m + m + 2 (n is even) When n is odd, the solution is like the one above, with s5=sm and s11=sn and with c1..cm We can start counting after 2*m minutes If n is even, things get harder. In general, we need to drain one c. 1 minute after another. If we manages that, we can do something similar to the 5/11 solution above. If m is odd, it isn't *that* hard. We do (m-1)/2 n-drains in c1 and m m-drains in c2..cm ( ((m-1)/2) * n + 1 = m * m ) We pauses c3..cm at time m*m-1, and restart them so we get a timeline similar to the one above. Then we continue doing m-drains. If m is even too, it is 'impossible'. Since both n and m is even, there is no combination of n-/m-drains that will give us a 1-minute interval. If we can assume that the water-flow is constant (it flows just as fast when the c. is full, as when the c. is almost emty), it is possible. We fill c1 m/4 times with n-drains We fill c2..cm m/2 times with m-drains At time (m*m)/2 when c2..cm is empty, fill them again with m-drain. At time (m*n)/4 = (m*m)/2 + m/2 c1 is empty, and is filled with m-drain, and c2..cm (which is now is half-full) is changed from m-drain to n-drain. c2..cm would have drained for m/2 more minutes, now they will drain for n/2=m+1 minutes (and c1 wil drain for m minutes) m minutes after this, c1 is empty and c2..cm has 1 minute left. This is the same as in the other solutions. We can start counting from (m*(m+3))/2 I really prefer the n-is-odd solution.. :-) -- Magne Oestlyngen From magne@spacetec.no Tue Nov 2 05:33 EST 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id FAA14684 for ; Tue, 2 Nov 1999 05:30:47 -0500 (EST) Received: from spacetec.no (jupiter.spacetec.no [192.51.5.11]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id FAA14373 for ; Tue, 2 Nov 1999 05:30:45 -0500 (EST) Received: from spacetec.no (metis.spacetec.no [192.51.5.180]) by spacetec.no (8.9.1a/8.9.1) with ESMTP id LAA23842 for ; Tue, 2 Nov 1999 11:30:12 +0100 Sender: magne@spacetec.no Message-ID: <381EBD33.43A41AD2@spacetec.no> Date: Tue, 02 Nov 1999 11:30:11 +0100 From: Magne =?iso-8859-1?Q?=D8stlyngen?= Organization: KSPT X-Mailer: Mozilla 4.7 [en] (X11; I; IRIX 6.5 IP32) X-Accept-Language: en MIME-Version: 1.0 To: Dennis Shasha Subject: Re: Calabaza References: <199911020351.WAA10603@shasha.cs.nyu.edu> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Content-Length: 1356 Status: R Dennis Shasha wrote: > 10 minutes is the record so far. > Others have also done it, but only a few. Anyone done it in 9? Well, then. Lets do it. (Assuming flow is constant) > time c1 c2 c3 c4 c5 > ----------------------- > 0 s5 s11 s11 s11 s11 > 1 | | | | | > 2 | | | | | > 3 | | | | | > 4 | | | | | > 5 s5 | | | | > 6 | | | | | > 7 | | | | | > 8 | | | | | > 9 | | | | | > 10 s5 | p p p > 11 | s5 u - - > 12 | | s5 u - > 13 | | | s5 u > 14 | | | | s5 > 15 s5 | | | | > > s5 - start a 5m drain > s11 - start a 11m drain > p - plug hole (pauses drain) > u - unplug hole (starts drain again) > | - water flows > - - no flow Improving this.. Let c1 be. Don't fill c5 at the start. Instead, pipe the flows from c2-c4 into c5 (c5 with both holes open). After 5 minutes, 3 * 5/11 = 15/11 have flown into c5, and 5/5 = 11/11 have flown out. That leaves 4/11 still in c5. Let c2-c4 flow normally (no change from the original diagram). Plug a hole in c5 (makes it a 11-minute drain), and it will last for 4 minutes (empties out at time 9). So this is like the original, except c5 drains first at 9 instead of 14. -- Magne Østlyngen From BHoffricht@aol.com Tue Nov 9 14:47 EST 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA29738 for ; Tue, 9 Nov 1999 14:47:31 -0500 (EST) From: BHoffricht@aol.com Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA28238 for ; Tue, 9 Nov 1999 14:47:26 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id OAA26341 for ; Tue, 9 Nov 1999 14:47:24 -0500 (EST) Received: from imo25.mx.aol.com (imo25.mx.aol.com [198.81.17.69]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id OAA28647 for ; Tue, 9 Nov 1999 14:47:23 -0500 (EST) Received: from BHoffricht@aol.com by imo25.mx.aol.com (mail_out_v23.6.) id 4LINa16030 (4422) for ; Tue, 9 Nov 1999 14:46:47 -0500 (EST) Message-ID: <0.fb63361d.2559d427@aol.com> Date: Tue, 9 Nov 1999 14:46:47 EST Subject: Omniheurist Corner To: DrEcco@ddj.com MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: AOL 3.0.i for Windows sub 74 Content-Type: text/plain; charset="us-ascii" Content-Length: 2373 Status: R Dear Dr. Ecco, Since the minimum time of a gourd you can measure is 5 minutes, you need 5 gourds to measure single minutes, starting one ofter another with a delay of one minute and immediate refill. The starting sequence can be achieved after 40 minutes (as required) and can be illustrated as follows: ----- ----- ----- ----- ----- ----- ----- ----- ----- (40 min) ---------- ----- ----- ----- ----- ----- ----- (41 min) ---------- ---------- ----- ----- ----- ----- (42 min) ---------- ---------- ---------- ----- ----- (43 min) ---------- ---------- ---------- ----------- (44 min) The pattern observed reveals that 40 min. is minimal, but I have no rigorous proof. To generalize (2. question) minimum time k to drain one has won if it is possible to build 2 sequences which differ in total time by 1 minute. For example if sequence s1 has m minutes and s2 has m+1 minutes, (k-1)*s1 have (k-1)*m minutes, (k-2)*s1+s2 have (k-2)*m+(m+1)=(k-1)*m+1 minutes and so on until (k-1)*s2 have (k-1)m+k-1 minutes. So with k such sequences you have the starting position. Now the problem reduces to the question: for which n it is impossible to build the sequences s1 and s2 with 1 minute duration difference. The simple case is n=2k+1 drain time for two holes if k is the drain time for one hole. So solve a*k + b*(2k+1) = 1. The simplest solution ist a = -2 and b = 1, so s1 is 2k and s2 is 2k+1. The starting sequence described above can be achieved after (n-1)*2k = 2k*2k = 4k^2 minutes, which agrees perfecly with the first solution (k=5, n=11, t=40 minutes). There remains the harder case n=2(k+1). The diophantine equation a*k+2b(k+1) = 1 is soluble if and only if gcd(k, 2(k+1)) = 1, which is impossible for even k. But for odd k = 2m-1 we want 1 = a*k+2b(k+1) = a*(2m-1)+4b*m, which has the solution a = 2m-1 and b=1-m viz. a = k and b = -[k/2], so s1 is k^2 and s2 is k^2-1. The starting sequence described above can be achieved after (n-1)*(k^2-1) = 4k*(k^2-1) minutes. Example: k=3,m=2,n=8 --- --- --- --- --- --- --- --- --- (27 min) -------- --- --- --- --- --- --- ---- (29 min) -------- -------- --- --- --- --- (28 min) Conclusion: for the numbers n = 4k+2 there is no solution, n = 2k + 1 are nearly trivial and n = 4k are moderate to solve. Best wishes and please continue to invent interesting puzzles! Burghart Hoffrichter, Hamburg From jhafner@jpg.com Thu Nov 18 14:45 EST 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA18454 for ; Thu, 18 Nov 1999 14:45:27 -0500 (EST) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id OAA13095 for ; Thu, 18 Nov 1999 14:45:25 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id OAA17997 for ; Thu, 18 Nov 1999 14:45:20 -0500 (EST) Received: from mail.jpg.com (mail.jpg.com [209.12.88.2]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id OAA20536 for ; Thu, 18 Nov 1999 14:45:16 -0500 (EST) Received: from jhafner ([209.12.88.235]) by mail.jpg.com (Post.Office MTA v3.5.3 release 223 ID# 0-62220U100L100S0V35) with SMTP id com for ; Thu, 18 Nov 1999 14:48:56 -0500 Message-ID: <38345569.659C@jpg.com> Date: Thu, 18 Nov 1999 14:37:13 -0500 From: jhafner@jpg.com (Jeff Hafner) Reply-To: jhafner@jpg.com Organization: Pegasus Imaging Corp. X-Mailer: Mozilla 3.04 (Win95; I) MIME-Version: 1.0 To: DrEcco@ddj.com Subject: Calabaza: two gourd solution Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 1443 Status: RO Well, there is a two gourd solution that works *IF* you can drain the contents of one gourd into another. If you can do this then just follow this procedure: 1) Have two holes unplugged on Gourd A and one hole unplugged on Gourd B. 2) Fill Gourds A & B. 3) When Gourd A empties (5min) refill it. 4) When Gourd A empties again (5min), plug it and catch the remaining 1 min of water from Gourd B in Gourd A. 5) When Gourd B empies (1min) plug it, unplug one hole on Gourd A, and catch the water from it in Gourd B. 6) Repeat the previous step, switching A and B once a minute. You can begin marking minutes after only 10min (step 4) have passed. If it takes time to switch gourd positions then this can be solved with three gourds. Also, in the solution for question 3 on Calabaza you state, "If n is even, then the integer below (n/2) -- call it m -- is odd (=(n/2)-1)". But if N=6 then M= (6/2)-1 = 3-1 = 2. If N=6 then N & M are both even, and no solution is possible (I'm 99% sure of that.) It looks like any N that is even and has an even M has no solution (I'm about 90% sure of that.) Let me know if I've made any mistakes. Thanks. -- Jeff Hafner mailto:jhafner@jpg.com (813) 875-7575 ex.335 Pegasus Imaging Corporation "Leaders in digital imaging" Our web sites- http://pegasustools.com and http://jpg.com Our newsgroup- news://news.pegasustools.com/developer-tools Check out "BETTER JPEG" live- http://www.jpegwizard.com From kshepherd@officeiq.com Fri Nov 19 01:32 EST 1999 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id BAA25597 for ; Fri, 19 Nov 1999 01:32:50 -0500 (EST) Received: from mv.mv.com (root@mv.mv.com [192.80.84.1]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id BAA26472 for ; Fri, 19 Nov 1999 01:32:42 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by mv.mv.com (8.8.8/mem-971025) with ESMTP id BAA23128 for ; Fri, 19 Nov 1999 01:32:39 -0500 (EST) Received: from poobah.ilux.com (poobah.officeiq.com [206.86.22.11]) by mercury.mv.net (8.8.8/mem-971025) with ESMTP id BAA11681 for ; Fri, 19 Nov 1999 01:32:38 -0500 (EST) Message-Id: <199911190632.BAA11681@mercury.mv.net> Received: from dodgy (dodgy.officeiq.com [206.86.22.43]) by poobah.ilux.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id W8556LVS; Thu, 18 Nov 1999 22:32:20 -0800 From: "Kevin Shepherd" To: DrEcco@ddj.com Date: Thu, 18 Nov 1999 22:20:00 -0800 Subject: Nov '99 solution given in Dec '99 Reply-to: kshepherd@officeiq.com Priority: normal X-mailer: Pegasus Mail for Win32 (v3.12a) Content-Type: text Content-Length: 1495 Status: RO I believe I may have found a faster solution for part 2, and an error in part 3. I hope that the following makes sense: 1. I agree, five gourds. 2. The following scheme gives a start time after ten minutes: TIME ZERO: At time zero, Run gourd 'A' removing two stoppers, continually - giving a five minute 'clock'. At time zero start gourds 'B', 'C', 'D' and 'E' removing one stopper on each. TIME TEN: ( minute clock now started ) After ten minutes, ( i.e. two empties of gourd 'A' ) replace the stopper in each of gourds 'C', 'D' and 'E'. TIME ELEVEN: One minute later, gourd 'B' will have emptied, and can now be run continually as a two - stopper five minute clock offset by one minute from 'A'. Still at time eleven unstopper gourd 'C' which will empty one minute later. TIME TWELVE: ... switch 'C' to a five minute clock, open 'D' TIME THIRTEEN: ... switch 'D' to five minute clock, open 'E' TIME FOURTEEN: .. switch 'E' to a five minute clock. 3. You state in your solution that if n is even, then (n/2)-1 is odd and yet if n=6, m=(6/2)-1 == 2 these are both even likewise n=10, m=4 etc. The problem of one minute interval measuring happens whenever: L.n.mod(m) - K.n.mod(m) = 1 has no solutions ( where L and K are +ve integers ) Thank you for maintaining a very interesting and entertaining column, I also enjoyed your book of puzzles. Kevin A Shepherd iLux Corporation kshepherd@ilux.com http://www.ilux.com Web site analysis for NT and Unix from any browser world-wide Corrections to Subway Column 1. 2.113: little girl --> girl 2. 3.69: would require 60 flips --> would require an expected 60 flips 3. 3.82: If p has one live neighbor, then bet p-n2 --> In that case, if Fred bets p-n2, 4. 3.106: include Charles Taylor and --> include Charles Taylor, John Hadreas, and 5. 3.121 $X or ($M-$X) --> $X and ($M-$X) --> 2.122: and read --> and summarized 3.51: apologize --> apologized 3.52: realize --> realized 3.53: simplified --> had simplified 3.92: and Charles Taylor --> Charles Taylor, and Joe Straitiff. In the figure: R should be B. This is extremely important. 2.50 -- Gotoldenborg should have an umlaut 2.76 --- suffices --> suffice 2.88 --- suffices --> suffice 2.112 --- five hours --> fifty minutes 3.30 --- move exchanges, by hand alas. (I know of no algorithmic solution to this problem.) --> move exchanges. 2.54-2.57 becomes: 12-year old Liane stopped strumming her guitar and said, "So, a leg is an edge in a graph. From what I see there is no path from B to E." 2.131 -- 2.132 become: In Ecco's best arrangement, using the same placement, nearly 1,000 cells burn out when each cistern holds enough water to put out only one fire. 3.11: goes 1, 5 --> goes 1/2, 1, 5 3.27: Rodney Meyer, and Jimmy Hu --> Rodney Meyer, Jimmy Hu, Bruce Moskowitz, and Matt Lasley From brucemoskowitz@yahoo.com Thu Nov 9 06:57 EST 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id GAA27294 for ; Thu, 9 Nov 2000 06:57:45 -0500 (EST) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id GAA09522 for ; Thu, 9 Nov 2000 06:57:47 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id GAA10061 for ; Thu, 9 Nov 2000 06:57:46 -0500 (EST) Received: from smtp1b.mail.yahoo.com (smtp3.mail.yahoo.com [128.11.68.135]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id GAA22172 for ; Thu, 9 Nov 2000 06:57:45 -0500 (EST) Received: from unknown (HELO moskowitz2) (209.187.60.1) by smtp.mail.vip.suc.yahoo.com with SMTP; 9 Nov 2000 11:57:43 -0000 X-Apparently-From: Reply-To: From: "Bruce Moskowitz" To: Subject: Mint answers Date: Thu, 9 Nov 2000 06:59:04 -0500 Message-ID: <000101c04a44$751c62c0$6fbf43ce@moskowitz2> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Content-Type: text/plain; charset="iso-8859-1" Content-Length: 1811 Status: R Dear Dennis Shasha ("Dr. Ecco"), I greatly enjoyed your column, "Mint", in the November, 2000, issue of Dr. Dobbs Journal and had fun programming my laptop to find the solutions, at least for the case of intuitive counting. (It's amazing how much can be accomplished by brute force code.) I would like to add to the solutions that you published in the December, 2000, issue. Following the three items you used to discuss the solutions: 1. For three coins: in addition to the set (23, 5, 1), the set (22, 5, 1) also gives an average of 5.313131... for payments from 1 to 99 cents. For four coins: in addition to the set (38, 11, 3, 1), the set (37, 11, 3, 1) also gives an average of 4.141414... For five coins: the set (40, 16, 7, 3, 1) gives an average of 3.494949... for intuitive counting; this is superior to the set (44, 17, 8, 3, 1) for intuitive counting. The superior set is non-intuitive because, for example, 21 is best counted by three coins of 7. For six coins: the set (62, 25, 11, 5, 2, 1) gives an average of 3.161616... for intuitive counting; this is superior to the set (45, 21, 8, 5, 2, 1) for intuitive counting. The superior set is non-intuitive because, for example, 33 is best counted by three coins of 11. 2. I don't know whether nonintuitive sets are necessary. 3. Now consider the case of all prices being multiples of 5 cents. For four coins: in addition to the set (65, 25, 10, 5), the set (60, 25, 10, 5) also gives an average of 2.1578947... For five coins: in addition to the set (65, 30, 25, 10, 5), the set (55, 35, 15, 10, ) also gives an average of 1.9473684... Sincerely, Bruce Moskowitz ( BruceMoskowitz@yahoo.com ) _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From mlstadc.erols.com@emailcenter.net Thu Nov 16 08:13 EST 2000 Received: from cs.nyu.edu (cs.nyu.edu [128.122.80.78]) by griffin.cs.nyu.edu (8.9.1/8.9.1) with ESMTP id IAA22797 for ; Thu, 16 Nov 2000 08:13:42 -0500 (EST) Received: from iridium.mv.net (root@iridium.mv.net [199.125.85.17]) by cs.nyu.edu (8.9.1/8.9.1) with ESMTP id IAA06124 for ; Thu, 16 Nov 2000 08:13:41 -0500 (EST) Received: from mercury.mv.net (root@mercury.mv.net [199.125.85.40]) by iridium.mv.net (8.9.3/8.9.3/mem-971025) with ESMTP id IAA24538 for ; Thu, 16 Nov 2000 08:13:40 -0500 (EST) Received: from c012.sfo.cp.net (c012-h000.c012.sfo.cp.net [209.228.13.91]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id IAA26376 for ; Thu, 16 Nov 2000 08:13:38 -0500 (EST) Received: (cpmta 27391 invoked from network); 16 Nov 2000 05:13:07 -0800 Date: 16 Nov 2000 05:13:07 -0800 Message-ID: <20001116131307.27390.cpmta@c012.sfo.cp.net> X-Sent: 16 Nov 2000 13:13:07 GMT Received: from [206.38.114.99] by mail.emailcenter.net with HTTP; 16 Nov 2000 05:13:07 PST Content-Disposition: inline Mime-Version: 1.0 To: DrEcco@ddj.com From: Matt Lasley X-Mailer: Web Mail 3.8.1.1 X-Sent-From: mlstadc.erols.com@emailcenter.net Subject: More on Mint Content-Type: text/plain Content-Length: 4013 Status: RO Dear Dennis Shasha, Hello! Thanks for these wonderful puzzles. It's my favorite part of the DDJ and a great excercise for the brain. In the November issue, there was a puzzle abount minting coins. I developed part of a solution, and am now kicking myself because I forgot to send it in. The full solution I came up with is way down below, but I wanted to comment on a couple things about the solutions posted in December's DDJ. In addition to the solutions provided, there are other sets that yield the exact same average: for 3: 22,5,1 for 4: 37,11,3,1 And for 5, I found several sets that outperform the published solution of 44,17,8,3,1 @ 3,53534: 5, 3.494949: 40,16,7,3,1 41,16,7,3,1 44,18,7,3,1 45,18,7,3,1 45,20,8,3,1 44,20,8,3,1 For part 3 of the solution, there's an additional combination for 4 denominations at the same average of 2.1616: 60,25,10,5 For 5 denominations, there are a bunch of combinations for the same average of 1.9494, listed way below in the detail. The interesting part is that if we consider the non-intuitive combinations, we can actually save a coin, which lowers our average. Taking advantage of that, these combinations yield and average of 1.89 coins per transaction. 1.89 65,30,20,15,5 @40 65,30,25,15,5 @50 75,45,20,10,5 @90 75,45,20,15,5 @30 75,50,20,15,5 @30 ("@ 40" just means at any price with $.40 remaining, there is a non-intutitive combinaion of coins that is a coin less than the intuitive. Ithe first case, intuitive is 30,5,5 but nonintuitive is 20,20). Did anyone get the last part about least change in transactions? I never got to it, but it seemed interesting. Thanks again so much for the wonderful puzzles. I'm deep in thought on "Causality" already, and this time I'll actually send it in! Matt Lasley Woodbridge VA 703-325-0778 mlstadc@erols.com =========original draft solution======== I can't claim any better for 3 or 4 coin sets, but I think I can claim better on 5 and 6. There were several combinations that reach the same best average all listed below. Denominations, Average coins required: Sets 3, 5.31: 22,5,1 23,5,1 * 4, 4.14: 37,11,3,1 38,11,3,1 *? 5, 3.49: 40,16,7,3,1 41,16,7,3,1 44,18,7,3,1 45,18,7,3,1 45,20,8,3,1 * 44,20,8,3,1 6, 3.16: 62,25,11,5,2,1 63,25,11,5,2,1 64,29,13,5,2,1 65,29,13,5,2,1 * ================ These sets were generated intuitively, but I would agree that smaller averages are possibly nonintuitively, with these same numbers. The more nonintuitive options there are, the better that set, since the fewer coins required lower that set's average ("better" assumes fewest coins required outweighs the desire for pure intuitive sets). It would be interesting to investigate the nonintuitive combinations and get the true averages for each set to choose a more accurately optimal set...but I'm tired. With the tinkering I did do, it seems odd and bigger are better, so I would recommend the sets with the "*". hopefully someone more rigorous found something interesting. For the sets with 5-cent as smallest, it is easier to investigate non-intuitive stuff. Because there are so many fewer coins in any transaction, it's much harder for non-intuitive combinations to actually better than the intuitive (2 coins can't be beat!). I've put the sets a better nonintuitive combination at the bottom with their average accounting for the non-intuitive 'savings', and the price at which it occurs. 3, 2.53: 40,15,5 4, 2.16: 65,25,10,5 60,25,10,5 5, 1.94: 55,35,15,10,5 55,40,20,10,5 60,35,15,10,5 60,35,20,10,5 65,30,15,10,5 65,30,20,10,5 65,30,25,10,5 70,40,25,10,5 70,45,20,10,5 70,45,20,15,5 70,55,25,10,5 75,35,15,10,5 75,35,20,10,5 75,50,20,10,5 80,35,15,10,5 85,40,25,10,5 85,55,25,10,5 each with 1 non-intuitive price for an average of 1.89 65,30,20,15,5 @40 65,30,25,15,5 @50 75,45,20,10,5 @90 75,45,20,15,5 @30 75,50,20,15,5 @30 6, 1.74: (i) 70,45,20,15,10,5 75,45,20,15,10,5 75,50,20,15,10,5 75,55,35,15,10,5 80,55,35,15,10,5 80,60,35,15,10,5 80,60,40,15,10,5 ====end=========== Wildfire corrections 2.34: responded with a straight face --> suppressed a grin. He then turned to Laney. 2.87: through 4. --> through 4, though the first day's wind goes towards the north in those figures. 2.112: Move: "You have 500 cisterns that you may place anywhere." to the beginning of the next paragraph. 3.36: response came from Mark Murphy --> responses came from Mark Murphy and Andrew Palfreyman 2.128: delete "and see how well you can do for 50 letters" 2.131: your language --> your natural language 3.45: purity --> healthfulness 3.51: and Greg Smith --> Greg Smith, Ted Alper, and Stanislav Dvorak. 3.123: the first optimal --> a clever