This action might not be possible to undo. Are you sure you want to continue?

/part5/>

**rec.puzzles Archive (logic), part 22 of 35
**

Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by bloom-picayune.MIT.EDU (8.6.13/2.3JIK) with SMTP id AAA22841; Sat, 27 Apr 1996 00:40:26 -0400 Received: from [199.164.164.1] by MIT.EDU with SMTP id AA14101; Sat, 27 Apr 96 00:38:23 EDT Received: by questrel.questrel.com (940816.SGI.8.6.9/940406.SGI) for news-answers-request@mit.edu id VAA20259; Fri, 26 Apr 1996 21:39:29 -0700 Date: Fri, 26 Apr 1996 21:39:29 -0700 X-Mail-Submission-From: chris@questrel.questrel.com (Chris Cole) Message-Id: <199604270439.VAA20259@questrel.questrel.com> To: news-answers-request@MIT.EDU Reply-To: chris@questrel.questrel.com <mailto:chris@questrel.questrel.com> Newsgroups: rec.puzzles <news:rec.puzzles>,news.answers <news:news.answers>,rec.answers <news:rec.answers> From: chris@questrel.com (Chris Cole) Subject: rec.puzzles <news:rec.puzzles> Archive (logic), part 22 of 35 Message-ID: <puzzles/archive/logic/part1_745653851@questrel.com> Followup-To: rec.puzzles <news:rec.puzzles> Summary: This is part of an archive of questions and answers that may be of interest to puzzle enthusiasts. Part 1 contains the index to the archive. Read the rec.puzzles FAQ for more information. Sender: chris@questrel.com (Chris Cole) Reply-To: archive-comment@questrel.com <mailto:archivecomment@questrel.com> Organization: Questrel, Inc. References: <puzzles/archive/Instructions_745653851@questrel.com> Date: Wed, 18 Aug 1993 06:06:09 GMT Expires: Thu, 1 Sep 1994 06:04:11 GMT Archive-name: puzzles/archive/logic/part1 Last-modified: 17 Aug 1993 Version: 4 ==> logic/29.p <== Three people check into a hotel. They pay $30 to the manager and go to their room. The manager finds out that the room rate is $25 and gives $5 to the bellboy to return. On the way to the room the bellboy reasons that $5 would be difficult to share among three people so he pockets $2 and gives $1 to each person. Now each person paid $10 and got back $1. So they paid $9 each, totalling $27. The bellboy has $2, totalling $29. Where is the remaining dollar? ==> logic/29.s <== Each person paid $9, totalling $27. $2. The manager has $25 and the bellboy

PDF Creator: PDF4U Pro DEMO Version. If you want to remove this line, please purchase the full version

The bellboy's $2 should be added to the manager's $25 or subtracted from the tenants' $27, not added to the tenants' $27. ==> logic/ages.p <== 1) Ten years from now Tim will be twice as old as Jane was when Mary was nine times as old as Tim. 2) Eight years ago, Mary was half as old as Jane will be when Jane is one year older than Tim will be at the time when Mary will be five times as old as Tim will be two years from now. 3) When Tim was one year old, Mary was three years older than Tim will be when Jane is three times as old as Mary was six years before the time when Jane was half as old as Tim will be when Mary will be ten years older than Mary was when Jane was one-third as old as Tim will be when Mary will be three times as old as she was when Jane was born. HOW OLD ARE THEY NOW? ==> logic/ages.s <== The solution: Tim is 3, Jane is 8, and Mary is 15. A little grumbling is in order here, as clue number 1 leads to the situation a year and a half ago, when Tim was 1 1/2, Jane was 6 1/2, and Mary was 13 1/2. This sort of problem is easy if you write down a set of equations. Let t be the year that Tim was born, j be the year that Jane was born, m be the year that Mary was born, and y be the current year. As indefinite years come up, let y1, y2, ... be the indefinite years. Then the equations are y + 10 - t = 2 (y1 - j) y1 - m = 9 (y1 - t) y - 8 - m = 1/2 (y2 - j) y2 - j = 1 + y3 - t y3 - m = 5 (y + 2 - t) t + 1 - m = 3 + y4 y4 - j = 3 (y5 - 6 y5 - j = 1/2 (y6 y6 - m = 10 + y7 y7 - j = 1/3 (y8 y8 - m = 3 (j - m) t = y - 3 j = y - 8 m = y - 15 ==> logic/attribute.p <== All the items in the first list share a particular attribute. second list is of some items lacking the attribute. The - t - m) t) m t)

PDF Creator: PDF4U Pro DEMO Version. If you want to remove this line, please purchase the full version

soccer ball. how many pages does the bookworm eat through? PDF Creator: PDF4U Pro DEMO Version. The 'without' list is only present to eliminate various 'stupid' answers. Christmas Tree w/out: toothbrush. key. yeast. ==> logic/attribute. bookmark w/out: stapler. icicle Points to realize: 1. pill bottle Needs to be placed inside something else when used for its usual purpose. All the properties apply the vast majority of the the items mentioned. Example: these are gloops: A B C D E these are not gloops: F G J L N which of these are gloops? O P Q R S Set#1 with: battery. Pay the most attention to the 'with' list. pill bottle Set#2 with: Rubik's cube. chess set. small intestine. Set#3: with: koosh. There may be exceptions to any item on the list.s <== The attribute puzzle format is a traditional format in math education. pencil sharpener Set#3: with: koosh. icicle Villiform. Not counting covers. Rubik's cube.Set#1 with: battery. ==> logic/bookworm. match. BUT MOST ORDINARY clocks do not. etc. Set#2 with: Rubik's cube. key. Rubik's cube. with visual objects. Yorkshire Terrier. Extraordinary exceptions should be ignored. compass needle w/out: clock. It occurs in logic materials developed in the sixties by EDC in Boston. chess set. tic-tac-toe. yeast. oak chair. If you want to remove this line. electrical wiring. title pages. for instance a particular clock may share the properties of the 'with' list of problem two. bookmark w/out: stapler. pencil sharpener Uses color to distinguish between otherwise identical parts. electrical wiring. small intestine. Christmas Tree w/out: toothbrush. soccer ball. tic-tac-toe.p <== A bookworm eats from the first page of an encyclopedia to the last page. rope. rope. compass needle w/out: clock. Yorkshire Terrier. The encyclopedia consists of ten 1000-page volumes and is sitting on a bookshelf in the usual order.. The bookworm eats in a straight line. please purchase the full version . 2. match. oak chair.

Both of the statements on the boxes are therefore meaningless and nothing can be concluded from them.000 pages. then 8 times 1000 pages of Volumes 2 .s <== On a book shelf the first page of the first volume is on the "inside" __ __ B| | | |F A|1 |.. since that is what the statement on box A says.... which box contains the gold? ==> logic/boxes.. it is false. then either the statement on box A is true (which it cannot be) or the gold is in box B.. This assumption leads to paradoxes.s <== The problem cannot be solved with the information given... if it is false. In general. But the statement on box B states that the statement on box A is false. The following argument can be made: If the statement on box A is true.. However... for example.. statements about the truth of other statements lead to PDF Creator: PDF4U Pro DEMO Version. A sign on box B says "The sign on box A is false and the gold is in box A". then through the cover to the 1st page of Vol 10. there is a hidden assumption in this argument: namely. If the statement on box B is false. The sign on box A says "The sign on box B is true and the gold is in box A". If you want to remove this line.. the statement on box A must be false. Assuming there is gold in one of the boxes. He eats 8..p <== Which Box Contains the Gold? Two boxes are labeled "A" and "B"...|10|R C| | | |O K| | | |N | | | |T ---------------------------------so the bookworm eats only through the cover of the first volume. The only way out of the paradox is to deny that the statement is either true or false and label it meaningless instead.==> logic/bookworm. A sign on box A says "The sign on box B is true and the gold is in box A". consider the statement: "This statement is false.004 pages. which contradicts the original assumption. Either way.... the gold is in box B. then the statement on box B is true. This implies that either the statement on box B is false or that the gold is in box B... Therefore. The sign on box B says "The sign on box A is false and the gold is in box A". ==> logic/boxes. If the bookworm ate the first page and the last page. it ate 8.9.. please purchase the full version .. that each statement must be either true or false. it is true...." If it is true.

3. Problem: Can you use the centrifuge to mix 5 samples? ==> logic/centrifuge. 6. 12-X has also one (obtained by swapping tubes and holes).s <== The superposition of any two solutions is yet another solution. a statement about the truth of a statement in a language must be made in the metalanguage of the language. What is to stop us from simply putting the gold in box A. To ensure that the samples are evenly mixed. The one whose camel is slower will win.5. If you want to remove this line. 3. regardless of what we deduced? (cf. After all.contradictions. for example. 12) are all solutions. ask a wise man for advise. 4. What does the wise man say? ==> logic/camel. The brothers.p <== An Arab sheikh tells his two sons to race their camels to a distant city to see who will inherit his fortune.4. then place the 4th and 5th diametrically opposed (each will end up in a slot adjacent to one of the first 3 tubes). This is a gadget that has 12 equally spaced slots around a central axis. For the case 2+3. 6 and 9 (assuming the slots are numbered from 1 to 12 like a clock). what are the numbers of tubes that cannot be balanced? Observing that there are solutions for 2. if you wanted to mix 4 samples. the only thing to check about. one in every 4th position. Tarski invented metalanguages to avoid this problem. the samples whirl around the central axis and do their thing.6 tubes and that if X has a solution. After hearing the advice they jump on the camels and race as fast as they can to the city. Prentice-Hall. 1978. When the machine is turned on. there is no problem: Place 3 tubes. To avoid paradox. so given that the factors > 1 of 12 (2. you could place them in slots 12. Common sense dictates that this problem cannot be solved with the information given. the proposed solution 2+3 is that not all ways of combining 2 & 3 would have centrifuge tubes from one subsolution occupying the slot for one of the tubes in another solution. PDF Creator: PDF4U Pro DEMO Version. in which you can place chemical samples you want centrifuged. it is obvious that 1 and 11 are the only cases without solutions. For example. The obvious generalization is. working with a 12-slot centrifuge.3. how can we deduce which box contains the gold simply by reading statements written on the outside of the box? Suppose we deduce that the gold is in box B by whatever line of reasoning we choose. Smullyan. #70) ==> logic/camel.s <== The wiseman tells them to switch camels. after wandering aimlessly for days. they must be distributed in the 12 slots such that the centrifuge is balanced evenly. please purchase the full version . ==> logic/centrifuge.p <== You are a biochemist. "What Is the Name of This Book?".

"the product of their ages is 72. you'd add a second tube opposite it for balance. and the Cs are the unchained broken links) And equivalently: OOO C OOOOOO C OOOOOOOOOO ==> logic/children. Then how old are they? ==> logic/children. "Well." "All right. OOO C OOOOO C OOOOOOOOOOO (where Os are chained unbroken links. If you want to remove this line." The man thinks for a moment and then says.s <== Two. and starts chatting with the bartender.p <== A man walks into a bar.p <== What is the least number of links you can cut in a chain of 21 links to be able to give someone all possible number of links up to 21? ==> logic/chain. "My youngest just loves strawberry ice cream." replies the bartender. determine all the ways that three ages can multiply together to get 72: 72 36 24 18 18 12 12 9 9 8 6 6 1 2 3 4 2 6 3 4 8 3 6 4 2 1 3 2 3 1 1 1 1 2 1 2 (quite a feat for the bartender) PDF Creator: PDF4U Pro DEMO Version. For example. he learns that the bartender has three children. "Still not enough!" The bartender smiles and says." How old are the children? A variant of the problem is for the sum of the ages to be 13 and the product of the ages to be the number posted over the door. please purchase the full version . "How old are your children?" he asks. "if you go outside and look at the building number posted over the door to the bar." The man steps outside. "that's not enough information." continues the bartender. In this case. ==> logic/chain. After a while.Here is how this problem is often solved in practice: A dummy tube is added to produce a total number of tubes that is easy to balance. if you had to centrifuge just one sample.s <== First. and after a few moments he reenters and declares. it is the oldest that loves ice cream. orders a drink. you'll see the sum of the ages.

Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. The only pair of permutations with the same sum are 8 3 3 and 6 6 2. ==> logic/condoms. Pedants have objected that the problem is insoluble because there could be a youngest between two three year olds (even twins are not born exactly at the same time). The final bit of info (oldest child) indicates that there is only one child with the highest age. So I think the solution is fine as stated. For example. and 2.p <== How can a man have mutually safe sex with three women with only two condoms? How can three men have mutually safe sex with one woman with two condoms? ==> logic/condoms. Yet he still insists that there isn't enough info. And using the word "youngest" to mean "of lesser age" is also in keeping with common parlance. which both add up to 14 (the bar's address). Therefore the ages of the children are 6. the word "age" is frequently used to denote the number of years since birth. please purchase the full version . the possibilities are: 11 10 9 9 8 8 7 7 7 6 6 6 1 2 3 2 4 3 5 4 3 6 5 4 1 2 1 2 1 2 3 1 2 3 1 1 The two that remain are 9 2 2 and 6 6 1 (both products equal 36). In the sum-13 variant.As the man says. otherwise the man could have easily deduced the ages. However. that's not enough information. 6. leaving the childern with ages of 9. 2. So the bartender tells him where to find the sum of the ages--the man now knows the sum even though we don't. This must mean that there are two permutations with the same sum. I am the same age as my wife. even though technically she is a few months older than I am. If you want to remove this line. there are many possibilities. This cancels out the 6 6 1 combination. This is impossible with 8 3 3--there are two 3 year olds.s <== PDF Creator: PDF4U Pro DEMO Version. and 2.

/* values in tmat: */ #define T_UNK 0 #define T_YES 1 #define T_NO 2 #define Val(t1. as published by Dell) automatically? ==> logic/dell. token). x < TOT_TOKEN. x < CLASS(class) + NUM_ITEM. EITHER /* Here #define #define #define #define #define #define #define is the problem-specific data */ NUM_ITEM 5 NUM_CLASS 6 TOT_TOKEN (NUM_ITEM * NUM_CLASS) HOUSE_0 HOUSE_1 HOUSE_2 HOUSE_3 0 1 2 3 \ \ \ \ \ \ \ \ \ \ \ \ PDF Creator: PDF4U Pro DEMO Version.g.p <== How can I solve logic puzzles (e. } States[100]. Put the outer condom back on. Third man puts on this condom.. Use the inner condom alone on the second woman.t2) (S->tmat[t1][t2]) #define CLASS(x) \ (((x) / NUM_ITEM) * NUM_ITEM) #define EVERY_TOKEN(x) \ (x = 0. 1) } else REJECT. x++) #define EVERY_ITEM(x. ==> logic/dell. x++) #define BEGIN struct state { char tmat[TOT_TOKEN][TOT_TOKEN]. please purchase the full version . If you want to remove this line. Take off the outer condom (turning it inside-out in the process) and set it aside. Take off the outer condom (do NOT reverse it) and have second man use it. Use it on the third woman. followed by second man's condom. class) \ (x = CLASS(class).s <== #include <setjmp. *S = States. ! setjmp((S++)->jb)) { } else EITHER longjmp((--S)->jb. jmp_buf jb.Use both condoms on the first woman.h> #define #define #define #define EITHER OR REJECT END_EITHER if (S[1] = S[0]. for EVERY_TOKEN(token) yes(token. First man uses both condoms. main() { int token. First man takes off the inner condom (turning it inside-out).

RED). "HOUSE_2". yes(COFFEE. "DOG". "TEA". If you want to remove this line. "ENGLISH". yes(SPANISH. "HOUSE_1". HOUSE_2). "SPANISH". "MILK". OR yes(IVORY. "HOUSE_4". "PARLIA". BEGIN yes(ENGLISH. HOUSE_3). HOUSE_2). "YELLOW". yes(GREEN. EITHER OR yes(IVORY. yes(UKRAIN. "IVORY". PDF Creator: PDF4U Pro DEMO Version. "UKRAIN". HOUSE_3). "CHESTER". /* /* /* /* Clue Clue Clue Clue 1 2 3 4 */ */ */ */ /* Clue 5 */ yes(IVORY. "COFFEE". HOUSE_1). "BLUE". "PLAYER". "NORWEG". "JAPAN". yes(GREEN. "HORSE". yes(GREEN. "OJUICE". HOUSE_4). "ZEBRA".#define HOUSE_4 #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define ENGLISH SPANISH NORWEG UKRAIN JAPAN GREEN RED IVORY YELLOW BLUE COFFEE TEA MILK OJUICE WATER DOG SNAIL FOX HORSE ZEBRA OGOLD PLAYER CHESTER LSTRIKE PARLIA 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 char *names[] = { "HOUSE_0". please purchase the full version . TEA). "HOUSE_3". HOUSE_0). "SNAIL". }. "GREEN". OR yes(IVORY. yes(GREEN. HOUSE_1). "FOX". GREEN). DOG). "OGOLD". "RED". "LSTRIKE". "WATER".

EITHER yes(FOX. SNAIL). EITHER yes(HORSE. yes(FOX. HOUSE_1). HOUSE_4). OR yes(PLAYER. yes(JAPAN. yes(NORWEG. HOUSE_0). HOUSE_1). END_EITHER OR yes(CHESTER. END_EITHER END_EITHER EITHER OR yes(PLAYER. HOUSE_0). yes(PLAYER. HOUSE_3). please purchase the full version . HOUSE_4). END_EITHER OR yes(CHESTER. HOUSE_1). HOUSE_1). OR yes(HORSE. OR yes(HORSE. OR yes(FOX. /* Clue 14 */ yes(NORWEG. HOUSE_2). HOUSE_4). END_EITHER END_EITHER yes(LSTRIKE. HOUSE_4). EITHER yes(FOX. EITHER yes(FOX. END_EITHER OR yes(PLAYER. HOUSE_0). HOUSE_2). yes(MILK. HOUSE_2). HOUSE_3). yes(FOX.END_EITHER yes(OGOLD. EITHER yes(HORSE. HOUSE_2). EITHER yes(HORSE. HOUSE_2). EITHER OR yes(CHESTER. HOUSE_3). HOUSE_3). yes(BLUE. HOUSE_0). YELLOW). EITHER OR /* Clue 12 */ /* Clue 13 */ /* Clue 11 */ yes(PLAYER. HOUSE_2). HOUSE_0). yes(HORSE. PARLIA). HOUSE_1). HOUSE_1). HOUSE_1). HOUSE_0). HOUSE_2). yes(HORSE. HOUSE_3). If you want to remove this line. END_EITHER OR yes(PLAYER. OR yes(HORSE. HOUSE_3). /* /* /* /* Clue Clue Clue Clue 6 7 8 9 */ */ */ */ /* Clue 10 */ yes(CHESTER. OR yes(CHESTER. OR yes(FOX. OR yes(FOX. PDF Creator: PDF4U Pro DEMO Version. OJUICE).

} } yes(a1. HOUSE_2). else break. HOUSE_2). EITHER yes(BLUE. HOUSE_2). no(a2. a2) = T_NO. a1) if (Val(token. else if (token == CLASS(a1) + NUM_ITEM) yes(non1. HOUSE_1). if (Val(a1. for EVERY_TOKEN(token) if (Val(token. for EVERY_ITEM(token. OR yes(BLUE.yes(NORWEG. OR printf("All solutions found\n"). END_EITHER OR yes(NORWEG. a1) == T_YES) no(a2. END_EITHER OR yes(NORWEG. PDF Creator: PDF4U Pro DEMO Version. HOUSE_4). a2) == T_YES) REJECT. if (non1 == -1) REJECT. a2) { int non1. non2. yes(BLUE. a2). OR yes(BLUE. exit(0). token). HOUSE_3). HOUSE_3). a2) != T_NO) if (non1 == -1) non1 = token. HOUSE_0). a2) { int token. else if (Val(a1. END_EITHER END_EITHER /* End of problem-specific data */ solveit(). OR yes(BLUE. If you want to remove this line. please purchase the full version . EITHER yes(BLUE. HOUSE_1). HOUSE_4). END_EITHER } no(a1. HOUSE_3). a1). token. a2) == T_UNK) { Val(a1. EITHER yes(BLUE. non1 = non2 = -1. OR yes(NORWEG.

a2) = T_YES.if (Val(a1. tok2 < TOT_TOKEN.names[token]. for EVERY_ITEM(token. tok2). a2) == T_NO) REJECT. and the two teams of each pair play against each other. How many games must be played to determine a champion? ==> logic/elimination. a2) == T_UNK) { Val(a1. token). a1) if (token != a1) no(token. a2). tok2). yes(a2. } REJECT. else if (Val(token. for EVERY_TOKEN(token) if (Val(token. Therefore there must be at least 96 games. } } solveit() { int token. ==> logic/flip. tok2++) if (Val(token. } printf("Solution:\n"). tok2.p <== How can a toss be called over the phone (without requiring trust)? PDF Creator: PDF4U Pro DEMO Version. } --james@crc. 0) { for (tok2 = NUM_ITEM. else if (Val(a1. for EVERY_TOKEN(token) for (tok2 = token. END_EITHER. the winners would be again divided into pairs. etc. please purchase the full version .p <== 97 baseball teams participate in an annual state tournament. tok2) == T_YES) printf("\t%s %s\n". token). for EVERY_ITEM(token. OR no(token.com> (James Allen) ==> logic/elimination. printf("\n").names[tok2]). After a team is eliminated from each pair.s <== In order to determine a winner all but one team must lose. tok2) == T_UNK) { EITHER yes(token. tok2 < TOT_TOKEN.com <mailto:james@crc.ricoh. The way the champion is chosen for this tournament is by the same old elimination schedule. a1) == T_NO) no(a2. If you want to remove this line. the 97 teams are to be divided into pairs. return solveit(). tok2++) if (Val(token.ricoh. That is. a1) == T_YES) yes(a2. a1).

that's not to hard to come by. In fact.000. B now calls either heads or tails and tells A. That's no problem for a computer to deal with.and 90. then how are you going to know if the number you randomly choose is prime?" A good question. A multiplies 2 prime numbers containing about 90 digits. (Is the last digit even? Is the sum of all the digits divisible by 9? And so on.000. if the result is tails.000. you have maybe 90 or so strings of 90 characters (or "digits") each. and check to see if it is prime. The magnitude of the number represented isn't much of a factor. This is very hard to do.000. We means we could be checking some 100.000. and there just isn't enough time in the world to do this properly.000. A then supplies B with the original numbers to verify the flip. If the result is heads. Consider what is involved in multiplying 90 digit numbers. please purchase the full version . Consider what is involved in factoring 90 digit numbers. as the case warrants) randomly. If that's the case.s <== A flips a coin.000. Here we enter into the strange an wacky world of number theory. It is the magnitude of the number that we have to worry about. You won't have to wait too long before you stumble across a prime number. A multiplies 3 prime numbers containing about 60 digits. we're only manipulating the string of digits. Using the method of long multiplication that we all learned in grade school. "I thought you just said it was incredibly difficult to factor large numbers.000. even for a supercomputer. there is no essentially better method than checking every number smaller that the number to be factored and seeing if it one divides the other evenly. If you want to remove this line. There are of course.000.digit prime numbers? Well.000. will quickly tell us that it is PDF Creator: PDF4U Pro DEMO Version. "But wait!" you cry. Where does A find a list of 60. 000.) But these are of little use in factoring large numbers with large factors.000. which depend on us choosing numbers at random.000.000. little tricks for determining factorability by small integers which we all learned in grade school. A tells B the result of the multiplication.000.==> logic/flip.000. There are probablistic algorithms that when given a prime number. The simplest method to find a few prime numbers is simply to choose a 90-digit number (or 60-digit number.000. the number of digits this number has is of little consequence.000 nummbers. Here.000. It turns out (and I won't explain how unless someone asks) there are "probabalistic" algorithms.

==> logic/friends. I decided to tackle the problem.s <== There are two solutions: Three flowers: rose. but it would not be difficult to put it back together into one vast formula: {e is prime:} PRIME(e) := ~Eb:Ec:((b+2)*(c+2) = e) PDF Creator: PDF4U Pro DEMO Version. I used a more brute force approach. Prove it. all of them are tulips except two. we can make this probability as high as we want. tulip. they must include a pair of strangers.s <== Well. will either tell us that it is a composite number (with very.A. Note that for greater comprehensibility. please purchase the full version . Not having any great knowledge of number theory. there must either be at least three acquaintances of X or at least three strangers of X.B." ==> logic/flowers. Assume wlog that X has three strangers A. Then X. very low probability. Unless A.p <== How many flowers do I have if all of them are roses except two. In fact.C.s <== Take a person X.B. ==> logic/hofstadter.C is the required triad of acquaintances. QED.B. If you want to remove this line.B is the required triad of strangers.p <== Any group of 6 or more contains either 3 mutual friends or 3 mutual strangers. That's what I mean by "very. and all of them are daisies except two? ==> logic/flowers. just by running the algorithm longer. one summer. I have broken the resulting formula up into several stages. very high probability?" Well.) What's the use of an algorithm that only returns the right answer "with very. geranium ==> logic/friends. and when given a composite number. very high. daisy Two flowers: carnation. it is within our technological abilities to quickly run this algorithm for 90-digit numbers so that the probability of it giving a wrong answer is less than the probability of a cosmic ray striking a vital part of the computer at some vital time and causing the computer to spit out the wrong answer anyway. very high probability) or will tell us that it is a prime number (with very. Of the five other people.p <== In first-order logic. wlog A.a prime number." ==> logic/hofstadter. find a predicate P(x) which means "x is a power of 10.

Statement n says "exactly n of the statements on this sheet are false.harvard." Which statements are true and which are false? What if we replace "exactly" by "at least"? ==> logic/hundred.e.i.1.n) := (d < e) & Eb:Ec:((c < a) & (n = (b*e*a) + (d*a) + c)) {if e is prime. of course.a. starting with 0) in the base-e expansion of n:} DIG(a. and substitute in for our capitalized formula abbreviations. we must use horseshoes instead of ->'s. please purchase the full version . PDF Creator: PDF4U Pro DEMO Version. statement 100 would be true.a. If they are all false. 10 in its e's place.e. we can find a number n which.n) & Ai:Aj:Au:( (PPOWER(u.n) & DIG(e*u. and so forth.harvard.n):= (n < a) & Ab:((PPOWER(b.s <== From _Litton's Problematical Recreations_ It is tempting to argue as follows: At most one statement can be true (they are mutually contradictory). To translate into Hofstadter's notation. Kevin Wald wald2@husc.edu <mailto:wald2@husc. will have 1 in its units place.n)) ) ) The basic idea is that you are asserting that for some prime e greater than x. true iff a is a power of e:} PPOWER(a.e.e.n)) -> j = (10 * i) ) & Eu:(PPOWER(u. when expressed in base-e notation. true iff d is the (log_e a)th digit (counting from the right. 100 in its (e^2)'s place.j.edu> ==> logic/hundred.e) & (e*u = a) & DIG(u. which is no good. and a is a power of e. true iff n has exactly (log_e a) digits in its base-e expansion (0 is counted as having 0 digits:} LENGTH(e.x.e.e) & ((e*u) < a) & DIG(u.n) & DIG(1. (We must also replace <'s and <= with appropriate expansions. If you want to remove this line. and a is a power of e. letters a through e (followed by however many ''s) exclusively.{if e is a prime. such that the leftmost digit is our x. big carets instead of &'s.p <== A sheet of paper has statements numbered from 1 to 100.) This is left as an exercise to the reader. and in general have the "digit" in each place be 10 times greater than the one to its right.e) & (b < a)) -> (b <= n)) POWER_OF_TEN(x):= Ee:(PRIME(e) & (e > x) & En:Ea:(LENGTH(e.e) := Ab:Ac:((b*c = a) -> ((b = 1) or (Ed: (e*d) = b))) {if e is a prime.d.

The first 50 statements are true. However.e. By changing the numbers in some statements and changing "true" to "false. and statement 99 is true. 4) The difference beween the numbers of the last true statement and the first true statement is a factor of the unknown number. and then so must both 9 and 10. 6) This is not the last true statement. and statements 51 to 100 are false.. We have learned that this paradox arises because of the false assumption that all statements are either true or false. 7) Each true statement's number is a factor of the unknown number. 100-x are false. either way 1 must be false. 5) The sum of the numbers of the true statements is the unknown number.So 99 are false. there is a hidden and incorrect assumption in this argument. so x=50. meaningless). then statements x+1 to 100 will be false (since they falsely claim that there are more false statements than there actually are). PDF Creator: PDF4U Pro DEMO Version. If you want to remove this line. This problem has been carefully contrived to appear to be solvable (like the vacuous statement "this statement is true"). 3) There exist three consecutive false statements." either way it implies "this statement is false. then nothing whatsoever can be concluded about which statements are true or false. This is the hidden assumption in the above reasoning. 8) The unknown number equals the percentage of these statements which are true. 10) There are no three cosecutive true statements. What is the number? The incorrect but plausible solution is: By 2. suppose that there is one statement on the sheet and it says "One statement is false" or "At least one statement is false." which is a familiar paradoxical statement. A much more complicated version of the same problem is: 1) At least one of the last two statements in this list is true. If it is acknowledged that some of the statements on the page may be neither true nor false (i. If replaced by "at least". 9) The number of different factors which the unknown number has (excluding 1 and itself) is more than the sum of the numbers of the true statements. and the "real" number of false statements is x." various circular forms of the liar's paradox can be constructed. x=100-x. please purchase the full version . So. 2) This is either the first true or the first false statement in the list. ie. To see this.

This is solved by: n1 = not(i1 and i2 or n2 = not((i1 or i2 or o1 = (i2 or i3 or n2) o2 = (i1 or i3 or n2) o3 = (i1 or i2 or n2) i1 and i3 or i2 and i3). i2.30. and o1. 5 must be false. OR gates. it appears that this system settles after a maximum of PDF Creator: PDF4U Pro DEMO Version. 2 and 4 must be true.3. 7 and 8 cannot both be true. says "This is the last true statement".8 . thus 6 must be true. Replace 3 of them with 2.9.21.20. start with N inverters. So by 5 the number shall be either 27 (2+3+4+5+6+7) or 25 (3+4+5+6+7).14.6. though.5.60. ==> logic/inverter. and 2 may be true or false. I was skeptical at first. (by 7) 3. Now the number must be a multiple of 2. and i3 are the inputs. then 3 is false (3 cannot be true when both 6 and 8 are true.140.35. None of these can fullfill 8. if false. By false 10. 4 and 5 must be true (by false 10). and only 2 inverters.s <== It can be shown that N inverters can invert 2^N-1 independent inputs.210) and the sum 2+3+4+6+7 = 22.42. If you want to remove this line.p <== Can a digital logic circuit with two inverters invert N independent inputs? The circuit may contain any number of AND or OR gates.3. n2. that is a multiple of 3*4*5*7=420. So. that is 5 shall be a multiple of the number. o2. as the number had to be a multiple of 6.6 and 7 are factors. that is a multiple of 168 (by 7).4. the number must be a multiple of 42. so the only multiple of 420 that fulfills false 9 is 420.5.4.6 and 7. then there are no three consecutive statements left).105. then 3 is true (8.7. given an unlimited supply of AND and OR gates.10 is false). n2. which gives a paradox.7. "and" has higher precedence than "or". i3) and n1 or i1 and i2 and n1 or i2 and i3 and and n1 or i1 and i3 and and n1 or i1 and i2 and and i3).15.28. The classic version of this puzzle is to invert 3 independent inputs using AND gates.70.84. But after writing a program to test every possible state change (32^2). and o3 are the outputs. if 8 is true. as 2+3+4+5+6+7=27. n2. and less than 100 (by 8) If 8 is false. 420 has 22 different factors (2. because such a design requires so much feedback that I was sure the system would oscillate when switching between two particular states. and so must 7 and/or 8. please purchase the full version . Keep doing that until you're down to 2 inverters.10.12. i1.6. So we have either A) F X F X X T F T F F or B) F X T X X T T F F F In A). ==> logic/inverter. so A) is out leaving us with B) Now. n1 and n2 are the inverted signals.

SHOTS WERE HEARD. AFTER A WHILE HENRIETTA LIKE HER FAMOUS MOTHER BECAME WORRIED ABOUT THE INFIDELITY PROBLEM.p <== The recent expedition to the lost city of Atlantis discovered scrolls attributted to the great poet. If you want to remove this line. ALL THE WOMEN IN MAMAJORCA ARE LOYAL TO THEIR QUEEN AND DO WHATEVER SHE TELLS THEM TO. BUT HAVE NO KNOWLEDGE ABOUT THE FIDELITY OF THEIR OWN HUSBAND. They number eight in all. ALL SHOTS FIRED IN MAMAJORCA CAN BE HEARD IN EVERY HOUSE. scholar. SHE ADDED THAT THE LETTERS WERE GUARENTEED TO REACH ALL WIVES EVENTUALLY. I did not include gate delays in the simulation. QUEENS DO NOT HAVE TO TAKE THIS EXAM. ALL ABOVE FACTS ARE KNOWN TO BE COMMON KNOWLEDGE. Why is Queen Henrietta I revered in Mamajorca? The answers are: PDF Creator: PDF4U Pro DEMO Version.s <== The two questions for scroll #1 were: 1. Here is Josephine's second scroll. however.3 feedback logic iterations. QUEEN HENRIETTA I WAS SUCCEEDED BY DAUGHTER QUEEN HENRIETTA II. So figure out the questions . As with all philosophers Josephine doesn't provide the question. QUEEN HENRIETTA I IS REVERED IN MAMAJORCAN HISTORY. YOU MUST SHOOT HIM AT PRECISELY MIDNIGHT OF THE DAY YOU FIND THAT OUT. YOU ARE FORBIDDEN TO DISCUSS YOUR HUSBAND'S FAITHFULNESS WITH ANY OTHER WOMAN. ALL WIVES KNOW WHICH HUSBANDS ARE UNFAITHFUL. How many husbands were shot on that fateful night? 2. HENRIETTA WAS WORRIED ABOUT THE INFIDELITY OF THE MARRIED MEN IN MAMAJORCA. SHE DECIDED TO ACT. ON THE FORTIETH NIGHT." THIRTY-NINE SILENT NIGHTS FOLLOWED THE QUEEN'S ANNOUNCEMENT. but leaves it implicit in his document. AND SENT A LETTER TO HER SUBJECTS (WIVES) THAT CONTAINED THE EXACT WORDS OF HENRIETTA I'S FAMOUS SPEECH. philosopher Josephine.there are two and answer them. "THERE IS AT LEAST ONE UNFAITHFUL HUSBAND IN MAMAJORCA. and here is the first. which could increase the number of iterations before the system settles. THE QUEENS OF MAMAJORCA ARE TRUTHFUL. WAS RULED BY QUEEN HENRIETTA I. What is the question and answer implied by this scroll? ==> logic/josephine. please purchase the full version . it appears that the world needs only 2 inverters! :-) ==> logic/josephine. IN MAMAJORCA WOMEN HAVE TO PASS AN EXTENSIVE LOGIC EXAM BEFORE THEY ARE ALLOWED TO GET MARRIED. QUEEN HENRIETTA II IS REMEMBERED AS A FOOLISH AND UNJUST QUEEN. SHE SUMMONED ALL THE WIVES TO THE TOWN SQUARE. THE KINGDOM OF MAMAJORCA. IF YOU DISCOVER THAT YOUR HUSBAND IS UNFAITHFUL. AND MADE THE FOLLOWING ANNOUNCEMENT. In any case.

too). So they both figure it out after the first night. all of the wives that got the notice the first day know that there is just one UH in the country. I guess you could call this case "unjust". and since there wasn't there must have been an additional UH. and it can only have been _her_ husband. The wife of the second UH makes the same deduction when no shot is fired the first night (she was waiting. Upon hearing that "there is at least one UH". wouldn't you know it.. PDF Creator: PDF4U Pro DEMO Version. When no one is shot. Let us imagine the situation with just a SINGLE UH in the whole country. Now. honed and crack logicians all. the wife of the UH doesn't know that anything is going on and so (of course) doesn't do anything the first night. Each wife of an UH assumes that the situation is "only one UH in town" and so waits to hear the other wife (she knows who it is. Things are much more complicated if the mix of who gets the notice when is less simple than the one I mentioned above. BUT. and shoot their husbands the second night. and so shoots him. please purchase the full version . but it is always wrong and/or tragic. NOTE: if the wives *know* that the country courier service (or however these things get delivered) is flaky. despite the perfect logic of the wives. since the UH's evade punishment. every wife of an UH knows of n-1 UH's while every wife of a faithful husband knows of n UHs. figures it all out. imagine that there are just two UH's. and so they'll expect her to figure it out and shoot her husband the first night. BUT THE OTHER WIVES HAVE NO WAY OF KNOWING THAT.. and her husband will be history come that midnight. will *incorrectly* shoot faithful husbands. that can only be because her OWN husband was a second UH. If you want to remove this line. And they know that the wife of that UH will think that everyone is faithful. It is easy to tidy up the induction to show that the n UHs will all be shot just on the n'th midnight. you could reason that it might be that the wife of one of the UH's that you know about just hasn't gotten her copy of the scroll yet). to *BEGIN*AT*THE*SAME*MOMENT*. So on the second night **ALL** of the husbands are shot.. That's why she's foolish. Why is Queen Henrietta II not? The answer is: The problem now is that QHII didn't realize that it is *critical* that all of the wives. *every* other wife thought that there should have been a shooting the first night. Now we do a simple induction: Assume that there is only one UH. the notice to the wife of the UH just happens to be held up a day. but the wife of the UH thinks that everyone is faithful. So. of course) shoot her husband on the first night. and expecting the other to shoot.If there are n unfaithful husbands (UHs).. Then all the wives but one know that there is just one UH. The next day she gets the notice. then they can avoid the massacre. too. whereas everyone else's arrived the first day. The uncertainty of having a particular wife's notice come a day or two late makes the whole logic path fall apart. She is unjust. And. BUT SHE DIDN"T GET THE NOTICE THE FIRST NIGHT. The question for scroll #2 is: 3. of faithful and UH's alike. Now. remember. but unless the wives exchange notes no one will ever be shot (since there is always a chance that rather than _your_ husband being an UH. [this because everyone has perfect information about everything except the fidelity of their own husband]. the wife realizes that the only husband it can be is her own.. because some wives.

She removes her lock.p <== Start with a half cup of tea and a half cup of coffee. ==> logic/mixing. please purchase the full version .52.s <== Attach a lock to the ring. the tallest of the shortest people in each column. You have several locks with keys.s <== Mixing Liquids The two cups end up with the same volume of liquid they started with.==> logic/locks. Take one tablespoon of this mixture and mix it back in with the tea.p <== You want to send a valuable object to a friend. since it might be copied. The same amount of tea was moved to the coffee cup as coffee to the teacup. Send it to her.max. Take one tablespoon of the tea and mix it in with the coffee.s <== Let T denote shortest of tall Let S denote tallest of short ------------------------------| | | | | S | | | | | | T X | | | | | | | | | ------------------------------So T >= X >= S. Which of the two cups contains more of its original contents? ==> logic/mixing.p <== In a rectangular array of people. How do you do it? Note that you cannot send a key in an unlocked box. But your friend does not have the key to any lock that you have.p <== PDF Creator: PDF4U Pro DEMO Version.boxes. If you want to remove this line.and. She attaches her own lock and sends it back. You have a box which is more than large enough to contain the object. You remove your lock and send it back to her. ==> logic/locks. or the shortest of the tallest people in each row? ==> logic/min. Therefore each cup contains the same amount of its original contents. The box has a locking ring which is more than large enough to have a lock attached.and. which will be taller.max. ==> logic/monty.boxes. ==> logic/min.

Depending on the strategies each of the M boxes will have a probability p_i of containing the dollar. + p_M = 1 When p_2 = p_3 = p_4 = . p_3) = max (p_1 + p_2.. p_2) = max (p_1... p_2.b The proof of Theorem 1 is based on the probability p_i that box #i contains the dollar. Induction is used for one of the theorems... so we'd better solve G_2 and G_3 for our basis. After (N-M) rounds of play. When there are only two boxes left Waldo opens either box. box #2 will have probability (p_1 + p_2) and vice versa.. G_2(p_1.s <== The fair price for large N is $0.Monty and Waldo play a game with N closed boxes. Or Monty may have some higher level "plan" which mightn't seem to translate directly into probabilities. Denote the game as G_N(). p_3) since after Monty opens box #1. . the others are empty. Monty opens the empty boxes one by one..) It may seem wrong for Waldo to "forget" the game history and remember only the computed p_i. If you want to remove this line.. Denote the game and Waldo's expected winnings in the game by G_M(p_1. or 0 <= b <= 1 / (M-1) Various G_M(p_1. the game will have the same form as G_M().52.. Prior to each of the N-2 box openings Waldo chooses one box and locks it. b) = 1 . b. he wins if it contains the dollar. But probability algebra obeys some simplifying PDF Creator: PDF4U Pro DEMO Version. p_M) where p_1 + p_2 + . b) and note that since probabilities are never negative: 1 + b . . Let Waldo lock the M'th box (renumbering the boxes if necessary). p_2) G_3(p_1. preventing Monty from opening it next.Mb. b. Monty hides a dollar in one box. p_2. p_M) have difficult solutions but we are asked only to solve G_M(1/M) and it turns out we can accomplish this by considering only the games G_M(b) where 1/M <= b <= 1/(M-1) [1] Games of this form will be said to satisfy constraint [1]. = p_M we adopt the abbreviation G_M(b) = G_M(1 + b . What are the optimal strategies for Monty and Waldo and what is the fair price for Waldo to pay to play the game? ==> logic/monty.Mb >= 0. b.. I will offer a proof along with optimal strategies. please purchase the full version .. For example he may have previously locked some but not all of the boxes and this fact is ignored except in the calculation of p_i. When the probabilities satisfy constraint [1]: G_2(b) = G_2(1-b. That box is then unlocked and cannot be so locked twice in a row.. b) = b G_3(b) = G_3(1-2b.6321205588285576784. b. p_2. (Of course this is Waldo's perceived probability: Monty's probability would be 0 or 1.. . b.

.. 1)/R(2. . i) = 0 R(i. = q_[M-1] in G_[M-1]. q) it won't matter which box Waldo locks (Box #1 has the only non-equal probability but Waldo cannot lock the same box twice in a row). 1) = R(k..2) . q) where q = (1-b) / (M-2) and where the boxes have been renumbered so that box #1 was box #M (the one Waldo locked) from the prior round and the new box #(M1) is the one Waldo locks next.p_j * p_M / (1 . j) = R(M.j) = p_i and to achieve q_2 = q_3 = . 2) for 2 < j < M R(M. j) = p_M . p_2.p_M) for j < M p_j * (M-2) + p_M <= 1 [1] [2] [3] [4] For the theorem we are given that G_M(b) satisfies constraint PDF Creator: PDF4U Pro DEMO Version.. q).. i < M sum_over_j R(i. R(1. j)/R(1. 1) The above have a simple unique solution: R(i.j) be the joint probability that Box #i contains the dollar and Box #j is opened by Monty in G_M().p_M) / (M . 2) = R(M.k < M and j != k R(2. . please purchase the full version . p_3. p_M) to a single game with the form G_[M-1](b. this is a typical property of "saddlepoint" strategy.. the probability model is the only thing Waldo has to act on.. q... Note that if Monty indeed arranges the probability mixture G_[M-1](b. If you want to remove this line. Especially paradoxical is the derivation of Waldo's p_i in his trivial strategy below: he can adopt inferior but "correct" p_i to simplify the analysis.. Theorem 1) If b >= 1/M then G_M(b) = G_[M-1]( (1-b) / (M-2) ) Proof) We will show that Monty and Waldo each have a strategy in G_M(b) to reduce the game to G_[M-1](b.. q.linearity rules and. q. j) >= 0 R(i. q. j) = R(k.j < M and i != j R(M. 2)/R(1. q.. if Monty keeps a "poker face". M) = 0. R(i. q.p_j for i... We will derive the necessary and sufficient condition for Monty to reduce any game G_M(p_1. 2)/R(1. . . Using the numbering of G_M() let R(i. q. 1) for 2 < k < M and to make G_[M-1] be independent of Monty's play R(M. We need consider only M >= 3 Clearly. j) for 1 < j. j) = (1 . q.

(This G_[M-1] also happens to satisfy constraint [1] as needed for the next theorem.. If Waldo locks each of the (M-2) available boxes with probability 1/(M-2) it is easily seen that the average probability that he locks the box with the dollar is (1-b) / (M-2) and the probabilities q_2.sum (-1)^i/i! . M-3 Proof) The proof is by induction. If Waldo knows Monty has a non-optimal strategy he can take advantage of it. ..1) which implies the weaker inequality (M . he can take q_2 = q_3 = . but we want to derive Waldo's best strategy anyway and if it guarantees the same value we know we're at the "saddlepoint". q_3. .(1-b)(-1)^M/(M-2)! where the sum is over i = 1. Monty must transform G_M(b) into some G_[M-1](b.. If Waldo pretends to "forget" which box he picked before.(1-b)(-1)^M/(M-2)! = . 2...1/2! + 1/3! . Thus either player can reduce G_M(b)... 3.2) et cetera If Waldo "knows" more than this. = (1-b)/(M-2) thereby constructing the same game Monty constructed with his saddlepoint strategy! In the above Waldo in effect "degraded" the accuracy of his probability estimates with the substitutions q_2' = (q_2 + q_3 + .1) and since for the constraint-[1] compliant G_M() p_j = b or p_j = (1+b-Mb) for all j the inequality [4] follows directly. Q. Theorem 2) If b >= 1/M then G_M(b) = 1 .Mb) PDF Creator: PDF4U Pro DEMO Version. q_[M-1]) where Waldo has the choice of locking any of boxes #2 through #(M-1). q_[M-2] will also have the average value (1b)/(M-2). Set c = (1-b) / (M-2) We noted earlier that b <= 1/(M-1): otherwise p_1 = (1 + b .) It should be easy to argue that this strategy is optimal for Monty.. .. q_2. please purchase the full version .3M + 1) <= b <= 1 / (M ........ If you want to remove this line..E. he can pretend he doesn't! For example he can ask Monty to secretly shuffle the boxes. b >= 1/M to G_[M-1]((1-b)/(M-2)) so this must be the saddlepoint. We know the theorem holds for M = 3 and we will assume it holds for (M-1). + q_[M-1]) / (M .1 / M <= b <= 1 / (M .. .3) / (M^2 . Hence Monty can transpose G_M(b) into G_[M-1]( (1-b) / (M-2) ) whenever b >= 1/M and M >= 3.2) q_3' = (q_2 + q_3 + .D. + q_[M-1]) / (M . but we will just derive a strategy good enough to achieve the saddle-point value. q_3.

62500000000000000000000000000000000000000000000000000000000000000 Solution for M =5 0. are both perfect logicians.is negative..63212055882855767840447622983853913255418886896823216549216319831 P.com <mailto:james@crc.63194444444444444444444444444444444444444444444444444444444444445 Solution for M =7 0. There are related unsolved problems: (a) what about G_M(p_1. S.63333333333333333333333333333333333333333333333333333333333333333 Solution for M =6 0. and Mr.. ..1/e). being able to correctly deduce PDF Creator: PDF4U Pro DEMO Version. 1/M) = 1 .. S. . G_M(1/M) approaches (1 .. .1/(M-1)) / (M-2) or simply c >= 1/(M-1) Thus the condition of the inductive hypothesis is satisfied and G_[M-1](c) = 1 . + (1-c)(-1)^M/(M-3)! But from Theorem 1 G_M(b) = G_[M-1](c) and from the definition of c.63212053571428571428571428571428571428571428571428571428571428572 .p <== Mr.1/2! + 1/3! .. p_M) that do not fit the pattern used in the above solution? (b) what if two boxes contain dollars? (first.1/M! For large M. I've appended the numeric values below.. P. % dc [[Solution for M =]Plb1+pdsb]sy 65k1sa1sblyx2sc[la1lc/-dsaplclyx*scla1lc/+dsaplclyx*sclzx]dszx Solution for M =2 0. -(-1)^M/M! Proof) This follows directly from Theorem 2 and the observation that (1/M)/(M-2)! = 1/(M-1)! ... If you want to remove this line.james@crc. c/(M-3)! = (1-b)/(M-2)! which establishes the theorem.66666666666666666666666666666666666666666666666666666666666666666 Solution for M =4 0.ricoh.63211805555555555555555555555555555555555555555555555555555555556 Solution for M =9 0. Solution for M =52 0. Theorem 3) G_M(1/M) = G_M(1/M.63214285714285714285714285714285714285714285714285714285714285714 Solution for M =8 0. . hence we obtain c = (1-b)/(M-2) >= (1 .63212081128747795414462081128747795414462081128747795414462081129 Solution for M =10 0.com> (James Allen) ==> logic/number. please purchase the full version . p_2..ricoh.50000000000000000000000000000000000000000000000000000000000000000 Solution for M =3 0.. It will be a little bigger when M is odd and a little smaller when M is even..1/2! + 1/3! . what should the rules be?) -.

A program to compute the possible pairs is included below.: I do not know the two numbers. <<2>> Mr.h> /* BEGINNING OF PROBLEM STATEMENT: Mr.500+] is: SUM 29 PRODUCT 208 X 13 Y 16 There are no unique solutions for the ranges starting with 1. are both perfect logicians. Two integers (not necessarily unique) are somehow chosen such that each is within some specified range. If you want to remove this line. and Mr. After receiving these numbers. S.any truth from any set of axioms. S. Given that the above statements are absolutely truthful. The unique solution for the ranges [2. S. is given the product of these two integers.: Now I know the two numbers. P. Two integers (not necessarily unique) are somehow chosen such that each is within some specified range. being able to correctly deduce any truth from any set of axioms. P. the two logicians do not have any communication at all except the following dialogue: <<1>> Mr. is given the sum of these two integers.94] through [3. P. <<3>> Mr.: Now I know the two numbers. <<3>> Mr.s <== The answer depends upon the ranges from which the numbers are chosen. what are the two numbers? END OF PROBLEM STATEMENT */ PDF Creator: PDF4U Pro DEMO Version. S. is given the product of these two integers.: I knew that you didn't know the two numbers. is given the sum of these two integers. Mr. P. P. S. Given that the above statements are absolutely truthful. S. and there are no solutions for ranges starting with numbers above 3.62] through [2. what are the two numbers? ==> logic/number. S.: Now I know the two numbers. <<4>> Mr.: Now I know the two numbers. Mr. Mr.: I do not know the two numbers. <<4>> Mr. Mr. #include <stdio. P.: I knew that you didn't know the two numbers. P. After receiving these numbers. the two logicians do not have any communication at all except the following dialogue: <<1>> Mr. <<2>> Mr.500+] is: SUM 17 PRODUCT 52 X 4 Y 13 The unique solution for the ranges [3. please purchase the full version .

++i) if(S[i] == min . j >= min. please purchase the full version . All (P[n] / 1000 == 1) satisfy <<3>>. */ for(i = min + min. long S[(LARGEST_MAX + 1) + (LARGEST_MAX + 1)]. /* * find the answer(s) and print them */ printf("[%d.j)] += 1000. */ for(i = min + min. i <= max * max. */ for(i = 0.#define #define #define #define SMALLEST_MIN LARGEST_MIN SMALLEST_MAX LARGEST_MAX 1 10 50 500 /* products */ /* sums */ long P[(LARGEST_MAX + 1) * (LARGEST_MAX + 1)]. PDF Creator: PDF4U Pro DEMO Version. ++i) { for(j = i / 2. ++j) ++P[i * j]. i <= max + max.j)] < 2) break. i <= max. long max) { long i. ++i) P[i] = 0.j)] / 1000 == 1) S[i] += 1000. --j) if(P[j * (i . j >= min. --j) if(P[j * (i . --j) if(P[j * (i .min. i <= max + max. /* * count factorizations in P[] * all P[n] > 1 satisfy <<1>>. j. j <= max.%d]\n".1) for(j = i / 2. j >= min.1 satisfy <<2>>. If you want to remove this line. S[i] = j.j)] > 1) P[j * (i . Any (S[n] == 999 + min) satisfies <<4>> */ for(i = min + min. /* * decompose SUMs which satisfy <<2>> again and see which products * satisfy <<3>>. } /* * decompose SUMs which satisfy <<2>> and see which products * they produce.max). ++i) for(j = i. for(i = min. find(long min. i <= max + max. /* * decompose possible SUMs and check factorizations * all S[n] == min . ++i) if(S[i] == min .1) for(j = i / 2.

P = %d\n".j) j).faqs.html> | Search <http://www.j)] / 1000 == 1) printf("{ %d %d }: S = %d.faqs. min <= LARGEST_MIN.. max. max <= LARGEST_MAX.html> | By Newsgroup <http://www.html> | By Author <http://www.Part2 <./part3/> .org/faqs/WWW-FAQArchive-Tech-Info..org/faqs/by-newsgroup/> ] [ Home <http://www.for(i = min + min.Part4 <. j >= min.com <mailto:jkenton@world.org/faqs/> | Latest Updates <http://www.com <mailto:archive-comment@questrel.org/faqs/changed. --j) if(P[j * (i ./part2/> .org/faqs/stats.org/faqs/by-author/> | By Category <http://www. j.html> | Usenet References <http://www..org/faqs/by-archive-name.html> | Archive Stats <http://www. please purchase the full version .std. max++) find(min./part4/> .org/usenet/> | Help <http://www. min ++) for (max = SMALLEST_MAX. i.org/faqs/bycategory.faqs.faqs.Part3 <.faqs. for (min = SMALLEST_MIN. i .com> = -----------------------------------------------------------------------* Part1 .faqs.faqs.html> ] Send corrections/additions to the FAQ Maintainer: archive-comment@questrel.max). (i . } main() { long min.faqs. If you want to remove this line.com> Last Update February 24 2001 @ 02:49 AM PDF Creator: PDF4U Pro DEMO Version.faqs. } -----------------------------------------------------------------------= Jeff Kenton (617) 894-4508 = = jkenton@world.org/faqs/faqsearch./part5/> [ By Archive-name <http://www. ++i) if(S[i] == 999 + min) for(j = i / 2.j.std.faqs. i <= max + max..Part5 <.

Logic Puzzles

Logic Puzzles

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.

scribd