Slashdot Mirror


Your Favorite Math/Logic Riddles?

shma asks: "Whether you're involved in the Sciences, Mathematics, or Engineering, you undoubtedly enjoy finding simple solutions to seemingly difficult problems. I'm sure you all have a favorite mind-bender, and who better to share it with than the Slashdot community? Post your own problems and try to solve others. Just one request: If you have figured out the solution, link to it in a post, rather than write it out where anyone can see it." What brain benders tickle your fancy? "Here's a sample to consider: You're in a dark room with 50 quarters, 18 of which are heads up. You are allowed to move around the coins or flip some or all of them, if you wish. Problem is, it's too dark to tell what you're moving or flipping (no, you can't figure it out by touch either). Your job is to split the coins into two groups, each of which has the same number of heads up coins. How do you accomplish this?"

39 of 1,965 comments (clear)

  1. Soduku by beacher · · Score: 3, Interesting

    They drive me nuts. Array and vecor logic. Fun

    -B

  2. Keeping my skills fresh by Paladine97 · · Score: 3, Interesting

    I wouldn't say I have a favorite problem but often when I'm bored I'll pen down the Pythagorean theorem and solve it manually. 0 = ax*x + bx + c. I'll work it out until I get the solution that (I hope) everybody knows and loves! It helps to keep my math skills alive during boring meetings.

    1. Re:Keeping my skills fresh by sunwolf · · Score: 3, Funny

      I keep my skills fresh by taking two points and then finding the answer we all know and love with the point-slope form!

      a^2 + b^2 = c^2!

  3. The Answer.... by Omnieiunium · · Score: 5, Funny

    Is obviously 42

  4. easy one by zanderredux · · Score: 5, Funny

    prove that a^n=b^n+c^n for any n.

    1. Re:easy one by calvin1981 · · Score: 5, Interesting

      That one's really easy. Set a=42, b=0 and c=42, for any n :)

    2. Re:easy one by NitsujTPU · · Score: 4, Informative

      Uhmm, if n = 0, that is not true.

      a^0 = 1
      b^0 = 1
      c^0 = 1

      1 != 2

      So, I would submit that that might be true for all nonzero values of n.

    3. Re:easy one by calvin1981 · · Score: 5, Informative

      Well, If b=0, b^0 is not even defined ! For n=0, it is easy to see that there is no solution. For n smaller than 3, it is elementary to show that there are solutions (even infinitely many of them), and for n > 3, you have to be Andrew Wiles to show that :)

  5. One possible solution: by heinousjay · · Score: 5, Funny

    Turn a light on.

    --
    Slashdot - where whining about luck is the new way to make the world you want.
    1. Re:One possible solution: by radtea · · Score: 5, Interesting

      Turn a light on.

      I was once a judge at a "Phyics Olympics" where there was one puzzle in which students had to figure out the wiring if a circuit consisting of a couple of light bulbs and a couple of switches. They were "supposed" to solve the puzzle by flipping the switches, noting what lights were on and off, and inferring the circuit.

      One team took the apparatus apart and inspected the wiring.

      I gave 'em full marks.

      The head judge went spare.

      Science is not a game, and there aren't any rules according to which you are "supposed" to solve the problem. Alexander the Great was demonstrating the practice of experimental science when he unravelled the Gordian knot, and Feyrabend was onto something when he said, "Anything goes."

      Puzzles set by humans have more to do with communication between the puzzle-setter and the puzzle-solver than anything else. Some people even decry computer-generated puzzles because of this--they say that the pleasure they get from solving puzzles comes from the feeling of interaction with another mind.

      --
      Blasphemy is a human right. Blasphemophobia kills.
  6. Petals of the Rose by Alien54 · · Score: 4, Interesting
    I personally like the petals of the rose

    Bill Gates is said to have solved the problem by memorizing the combinations first, the brute force approach.

    It ones of those that requires a knack for seeing the simple things

    --
    "It is a greater offense to steal men's labor, than their clothes"
    1. Re:Petals of the Rose by Tim+Browse · · Score: 4, Funny
      Unfotunately, one rumor says that the smarter you are, the longer it takes to figure out.

      Max: My teacher tells me beauty is on the inside.
      Fletcher: That's just something ugly people say.

      -- "Liar Liar"

  7. Re:Riddle by Tuxedo+Jack · · Score: 3, Funny

    None.

    You haul your ass to a bakery, shell out twenty bucks, and get a box or two full of cupcakes, then you go Cid Highwind on everyone.

    "Siddown and eat your goddanm cupcakes!"

    --

    Striking fear in the authors of godawful fanfiction, I am here, appearing in darkness, Tuxedo Jack!
  8. Re:Infinity by Frequency+Domain · · Score: 4, Interesting

    Then you may like this one: X to the X to the X to the... = 2. What is X if the left hand side is an infinite sequence of powers?

  9. Solution by Frequency+Domain · · Score: 3, Interesting

    Since it's an infinite sequence, you can separate the left-most X and rest still equals 2. Thus X^2 = 2, so X = sqrt(2).

    1. Re:Solution by wildsurf · · Score: 4, Interesting

      Since it's an infinite sequence, you can separate the left-most X and rest still equals 2. Thus X^2 = 2, so X = sqrt(2).

      Disprufe(TM) by contradiction:

      1. Suppose sqrt(2) ^ sqrt(2) ^ sqrt(2) ^ ... = n.
      2. Then, sqrt(2) ^ (sqrt(2) ^ sqrt(2) ^ ...) = n.
      3. Hence, sqrt(2) ^ n = n.
      4. Therefore, n obviously equals 4, because sqrt(2) ^ 4 = 4.
      5. Hence, sqrt(2) ^ sqrt(2) ^ sqrt(2) ^ ... equals 4, not 2, so it can't be the solution to the original problem.

      What's wrong with this logic? ;-)

      --
      Weeks of coding saves hours of planning.
  10. Look and Say by Noksagt · · Score: 5, Informative

    There's a good write up of this on MathWorld.

  11. As I was walking to St. Ives... by LeonGeeste · · Score: 3, Funny

    I met a man with seven wives. Every wife had seven sacks, and every sack had seven cats, and ever cat had seven kits. Kits, cats, sacks, and wives, how many were going to St. Ives?

    --
    Rank my idea: http://www.sinceslicedbread.com/node/531
  12. Re:What do you get if you multiply 6 by 9? by Anonymous Coward · · Score: 3, Funny

    Nobody writes jokes in base 13.

  13. Another online version by Enti · · Score: 5, Interesting

    http://www.websudoku.com/ is my sudoku fix of choice

    --
    In these days, bleeps and bloops mean something more
  14. Truth vs. Lies by sheetsda · · Score: 3, Insightful

    You find yourself before indistinguishable two doors, each with a statue. One door will lead to salvation, the other to death. The statue that guards the door to salvation always tells the truth, the statue to the door to death always lies. You may pose only one question to only one statue. What do you ask to determine which door is which?

    Answer(ROT13): Nfx nal dhrfgvba gb juvpu lbh nyernql xabj gur nafjre. Gb qrgrezvar juvpu qbbe vf juvpu lbh arrq gb xabj gur eryngvbafuvc bs gur nafjre lbh ner tvira gb gur gehgu. Gur guvat V yvxr nobhg guvf evqqyr vf vg sbeprf lbh gb pbafvqre gur bcrengbe va gur ybtvpny fgngrzrag gb or gur inevnoyr. Nqqvgvbanyyl crbcyr nera'g hfrq gb nfxvat dhrfgvbaf jura gurl nyernql xabj gur nafjre fb gurl graq abg gb or noyr gb guvax bs n fbyhgvba evtug njnl. Gur jubyr guvat orpbzrf boivbhf jura lbh cbfr n dhrfgvba fhpu nf "Ner gurer gjb fgnghrf urer?"

    1. Re:Truth vs. Lies by Hektor_Troy · · Score: 3, Funny

      Can I switch the statue for one talking bull frog? Cause I know the answer to that one. Pick it up, open one door, throw it down that hall, close door and wait a bit.

      Curtesey of The 10th Kingdom

      --
      We do not live in the 21st century. We live in the 20 second century.
  15. Lightbulb problem by Ellen+Spertus · · Score: 4, Interesting
    Given:
    • One room has three switches, labeled A, B, and C.
    • Another room has three light bulbs, labeled 1, 2, and 3.
    • Each switch is connected to one bulb, but you do not know which is connected to which.
    • When inside either room, you cannot see the other room.
    • You begin in the room with the switches and may turn the switches on and off in any way you choose.
    • Once you leave the room with the switches, you may not reenter it. You may, however, go to the room with the light bulbs.
    How can you determine which switch is connected to which light? Here is a hint and solution.

    I like this problem because people are ordinarily good at logic have so much trouble with it. I once had the pleasure of meeting Donald Knuth and stumped him with this puzzle.

    1. Re:Lightbulb problem by kisielk · · Score: 4, Insightful

      I know lots of people have commented on using the hot/cold method to determine which bulb is which, there's another problem with that as well: You don't know the initial state of the bulbs.

      Say for example all the bulbs are initially ON, and you flip two of the switches to what you think is on. Then when you flip one of them to what you think is "off" and wait a while, and go in to the room, you'll find two bulbs on, but you'll misidentify them because the one you thought you switched to "off" you actually turned "on". Not to mention they could be in mixed states initially..

  16. Re:Phone Numbers by MickLinux · · Score: 5, Funny

    Wow! It's my age! How did you do that?!?

    --
    Correct Horse Battery Staple: 72 bits of entropy. Enter "Correct H" into google. When it generates the phrase, that's
  17. Sticky Triangles by Doc+Ruby · · Score: 4, Interesting

    Let's say I have a stack of sticks: all identical, inflexible, unbreakable. Sticks can touch only at their ends, not in between.

    If I give you 3 sticks, you can make one triangle. If I give you 2 more sticks (5), you can make 2 triangles. If I give you another stick (6), how can you make 4 triangles?

    --

    --
    make install -not war

  18. Re:Answer to the Sample Question by Stalus · · Score: 4, Insightful

    Simply place any 18 coins into the second group and flip those over.

    If you flip a coin over that was heads, it is now tails and is eliminated from consideration. If you flip a coin over that was tails, it marks with heads a coin selected that was not heads. Therefore after 18 coins are flipped, the number of heads in the second pile is equal to the number of heads that are left in the first pile.

  19. The best riddle site on the net by nyri · · Score: 3, Informative

    Is ..:: Riddles ::... In has (amogst others) the famous "prison with a lamp" problem:

    100 prisoners are imprisoned in solitary cells. Each cell is windowless and soundproof. There's a central living room with one light bulb; the bulb is initially off. No prisoner can see the light bulb from his or her own cell. Each day, the warden picks a prisoner equally at random, and that prisoner visits the central living room; at the end of the day the prisoner is returned to his cell. While in the living room, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room. If this assertion is false (that is, some prisoners still haven't been to the living room), all 100 prisoners will be shot for their stupidity. However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world can always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.

    Before this whole procedure begins, the prisoners are allowed to get together in the courtyard to discuss a plan. What is the optimal plan they can agree on, so that eventually, someone will make a correct assertion?

  20. The King and the Chalice (only for Experts!) by brian0918 · · Score: 3, Interesting

    There is a king and there are his n prisoners. The king has a dungeon in his castle that is shaped like a circle, and has n cell doors around the perimeter, each leading to a separate, utterly sound proof room. When within the cells, the prisoners have absolutely no means of communicating with each other.

    The king sits in his central room and the n prisoners are all locked in their sound proof cells. In the king's central chamber is a table with a single chalice sitting atop it. Now, the king opens up a door to one of the prisoners' rooms and lets him into the room, but always only one prisoner at a time! So he lets in just one of the prisoners, any one he chooses, and then asks him a question, "Since I first locked you and the other prisoners into your rooms, have all of you been in this room yet?" The prisoner only has two possible answers. "Yes," or, "I'm not sure." If any prisoner answers "yes" but is wrong, they all will be beheaded. If a prisoner answers "yes," however, and is correct, all prisoners are granted full pardons and freed. After being asked that question and answering, the prisoner is then given an opportunity to turn the chalice upside down or right side up. If when he enters the room it is right side up, he can choose to leave it right side up or to turn it upside down, it's his choice. The same thing goes for if it is upside down when he enters the room. He can either choose to turn it upright or to leave it upside down. After the prisoner manipulates the chalice (or not, by his choice), he is sent back to his own cell and securely locked in.

    The king will call the prisoners in any order he pleases, and he can call and recall each prisoner as many times as he wants, as many times in a row as he wants. The only rule the king has to obey is that eventually he has to call every prisoner in an arbitrary number of times. So maybe he will call the first prisoner in a million times before ever calling in the second prisoner twice, we just don't know. But eventually we may be certain that each prisoner will be called in ten times, or twenty times, or any number you choose.

    Here's one last monkey wrench to toss in the gears, though. The king is allowed to manipulate the cup himself, k times, out of the view of any of the prisoners. That means the king may turn an upright cup upside down or vice versa up to k times, as he chooses, without the prisoners knowing about it. This does not mean the king must manipulate the cup any number of times at all, only that he may.

    Assume that both the king and the prisoners have a complete understanding of the game as I have just explained it to you, and that the prisoners were given time beforehand to come up with a strategy. The king was able to hear the prisoners discuss, however, so also assume that if there is a way to foil a strategy, the king will know it and exploit the weakness. The prisoners must utilize a strategy that works in absolutely every single possible case.

    Now you must figure out not only how to keep the prisoners alive, but how to also ensure their eventual freedom. When can any one of them be certain they've all been in the central chamber of the dungeon at least once? And how? Don't try to imagine any trickery like scratching messages in the soft gold of the chalice. The problem is as simple as it sounds. The prisoners have absolutely no way of communicating with each other except through the two orientations of the chalice. If any of them attempts any trickery at all they will all be beheaded. All the prisoners can do is turn the chalice upside down or right side up, as they choose, whenever they are called into the chamber.



    (written by a former roomate)

    1. Re:The King and the Chalice (only for Experts!) by psst · · Score: 3, Insightful

      I came up with this solution in the shower. It has no pretense of being the optimal solution. Don't just say it's wrong; please reply with disproofs (especially the poster of the problem).

      This solution requires that each prisoner is guaranteed to be called to the room infinite number of times. Otherwise, if there's a maximum number of times t that a prisoner can be called to the room, then the king could select k = number of prisoners, call each one t times in a row, resetting the chalice to original position every t-th time (the last time he calls in any given prisoner). This would guarantee that every prisoner wouldn't be able to see any changes to the chalice made by any other prisoner. Thus they wouldn't be able to know if anybody has been to the room but then.

      1. Chalice has two states: 0 and 1.
      2. Without loss of generality, assume 0 as the initial state. (Suppose k = k'. Assume initial state = 0 and k = k' + 1. If originally the initial state is 1, that's equivalent to the king using the extra flip out of k' + 1).
      3. There is one head prisoner and n other prisoners.
      4. The head prisoner always sets the chalice to 1.
      5. The simple prisoners set the chalice to 0 the first M times they visit the room and see the chalice set to 1; they don't touch it afterwards.
      6. The head prisoner declares that all prisoners have visited the room after he sees the chalice in 0 state N times.
      Let's find out what M, and N are depending on k and n.

      7. When the head prisoner sees the chalice in 0 state for the N-th time, the chalice has been set to 0 by simple prisoners at least N - k times and at most N + k times.
      8. We know that N - k > M*(n - 1), otherwise one simple prisoner might have never visited the room.
      9. We also know that M*n > N + k, otherwise the simple prisoners may stop setting the chalice to 0 before the head prisoner ever gets to see 0 state for the N-th time.

      10. Playing with the above inequalities:

      N + k > M*(n - 1) + 2k (from 8)
      N + k >= M*(n - 1) + 2k - 1
      M*n > M*(n - 1) + 2k - 1 (from 9 and prev. inequality)
      M + M*(n - 1) > M*(n - 1) + 2k - 1
      M > 2k - 1

      Let's choose M = 2k

      11. Then N - k > 2k*(n - 1) (from 8)
      N - k > 2k*n - 2k
      N > 2k*n - k
      N > k*(2n - 1)

      Let's choose N = k*(2n - 1) + 1

      That's it! What do you think? =)

    2. Re:The King and the Chalice (only for Experts!) by G-funk · · Score: 3, Informative

      It's a terribly written version of the "warden and his prisoners" problem, which you can google. The only difference other than confusing language is the original problem has two on/off switches, and each prisoner must flip one, rather than one that can be left alone.

      *Spoiler* Don't read the following if you don't wanna know the answer:

      1) The prisoners elect one of their own to be a counter, the rest we will call non-counters.

      2) When a non-counter comes into the chalice room, if he can he will put the chalice right side up. If it's already right side up, he'll leave it alone. However, each non-counter will only do this once. If he's already flipped it in the past, and it's upside down, he'll leave it upside down.

      3) Every time the counter comes in, he checks the chalice. If it's upside down, he'll do nothing. If it's right side up, he'll flip it, and add one to his count. Once he's flipped it n times (n being the prisoner count), he knows everyone has done it. If the original state of the chalice is known, the problem can be modified so he only needs to flip it n-1 times.

      --
      Send lawyers, guns, and money!
  21. Re:Phone Numbers by SnowZero · · Score: 3, Informative

    a = first 3 digits
    b = last 4 digits

    ((a*80+1)*250 + b+b -250)/2
    (a*20000 + 250 + b*2 - 250)/2
    a*10000 + 125 + b - 125
    a*10000 + b

    It's only amazing if you don't know algebra, and no, a calculator is not required. Then again, if the point is to encourage people to eventually put down their calculator and instead try understanding why something works, then I'm all for it.

  22. Except... by nwbvt · · Score: 4, Informative

    Dividing by zero is not "perfectly valid algebra". Division is not closed on the set of real numbers. Its not really a riddle if you lie in the problem description. Otherwise the solution to the sample problem could be "Pull out 9 of the quarters into a seperate group. I was lying when I said you couldn't see any of them."

    --
    Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
  23. Re:Phone Numbers by arodland · · Score: 3, Informative

    Weak ;)

    (20000a + 250 + 2b - 250) / 2
    10000a + b

  24. Re:0^0 by Fnkmaster · · Score: 4, Funny

    I guess you could say 0^0 = 1, for sufficiently large values of 0. :)

  25. Re:Ok, here's mine by radtea · · Score: 3, Insightful


    what's the next line?

    5.

    No finite sequence determines the subsequent.

    As such, "math puzzles" of the "what is the next number?" kind are not math puzzles at all--they are psychology and common-knowledge puzzles. They should be stated, "I'm thinking of a number. To me, the number is the next in the following sequence: (...). Your job is to guess, based on what you know of me (or people like me), of mathematics, and of common knowledge, which of the infinite number of mathematical relationships betweeen the numbers in that sequence is the one that is important to me."

    People who work in numerical methods are only too aware of how little information finite sequences contain beyond their own bounds. Interpolation is hard enough. Extrapolation is virtually impossible. Even simple sequences like "1,2,3,4..." can have literally anything as the next value--it is trivial to come up with generating functions that give integers for the first few integer arguments and wildly varying irrational values after that. Unless you know what the generating function is, the finite sequence tells you nothing. Guessing the generating function from a finite sequence is all about guessing what the questioner knows and what kind of generating function a person with their knowlege (or common knowledge) is likely to choose that would produce the given sequence.

    A modicum of mathematical knowledge is still required, but far more psychology is necessary.

    --
    Blasphemy is a human right. Blasphemophobia kills.
  26. My all-time favorite logic puzzle by Council · · Score: 4, Interesting

    Oh, woe is me. I have a perfect logic puzzle, but was unlucky enough to be otherwise engaged when this story was posted. (By the way: a soft couch, a carefully selected DVD, half a bottle of rum, and a girl. Guess which element to this excellent scenario was fucking ruined by copy protection? I'll give you a hint: I may have just switched sides in this movie piracy debate. Fuck the RIAA. It was a perfectly legal store-bought DVD. Fuck them all.)

    But anyway, logic puzzles. This logic puzzle is excellent. I've had it up on my site (http://www.xkcd.com/blue_eyes.html), and after I got boingboing'ed I got a lot of email about it, so I've been able to tweak the wording to get rid of most of the confusing stuff, leaving only the logic. It's extremely subtle; I've never seen anything like it.

    Here's the puzzle:

    A group of people live on an island. They are all perfect logicians -- if a conclusion can be logically deduced, they will do it instantly. No one knows the color of their eyes. Every night at midnight, a ferry stops at the island. If anyone has figured out the color of their own eyes, they [must] leave the island that midnight.

    On this island live 100 blue-eyed people, 100 brown-eyed people, and the Guru. The Guru has green eyes, and does not know her own eye color either. Everyone on the island knows the rules and is constantly aware of everyone else's eye color, and keeps a constant count of the total number of each (excluding themselves). However, they cannot otherwise communicate. So any given blue-eyed person can see 100 people with brown eyes and 99 people with blue eyes, but that does not tell them their own eye color; it could be 101 brown and 99 blue. Or 100 brown, 99 blue, and the one could have red eyes.

    The Guru speaks only once (let's say at noon), on one day in all their endless years on the island. Standing before the islanders, she says the following:

    "I can see someone with blue eyes."

    Who leaves the island, and on what night?

    There are no mirrors or reflecting surfaces, nothing dumb, It is not a trick question, and the answer is logical. It doesn't depend on tricky wording, and it doesn't involve people doing something silly like creating a sign language or doing genetics. The Guru is not making eye contact with anyone in particular; she's simply saying "I count at least one blue-eyed person on this island who isn't me."

    And lastly, the answer is not "no one leaves."

    --
    xkcd.com - a webcomic of mathematics, love, and language.
  27. Take a Break - 8 Ways to 15 by BoRegardless · · Score: 3, Interesting

    If you really get one of 'those' meetings or classes, you can try this. It is so boring, you have already made another Tic Tac Toe crossed set of lines. Take all 10 numeral digits and put them in the Tic Tac Toe so that all horizontal, all vertical and all diagonal sums each add up to ... 15 I give no hints.

  28. MOD PARENT TROLL by LeonGeeste · · Score: 4, Informative

    I had a conversation with Brian0918 on AIM this morning, in which he revealed he's really trolling when I pointed out to him there is no solution (see my other posts) on this topic. Here's a little tidbit: ". i usually just post the problem to get people into big disputes, which so far has worked 2 out of 2 times". If you want the full conversation, email me at sbartaNOSPAM_at_MAPSONgmail.com.

    --
    Rank my idea: http://www.sinceslicedbread.com/node/531