Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Pearls before swine

  1. Mar 24, 2005 #1
  2. jcsd
  3. Mar 24, 2005 #2


    User Avatar

    there is a strategy. if there are 2 piles (rows whatever) then if you go first you must take out of the larger pile to make them the same size. then whatever you opponent does, just copy him. that way you win. im not sure about 3 piles, but i imagine its similar.
  4. Mar 24, 2005 #3


    User Avatar

    in three piles i havent come up with a strategy yet but the idea i think is to make sure you dont end up with two rows with equal size... in fact you want him to end the third row while the other two have different sizes.
  5. Mar 24, 2005 #4
    That's not a simple strategy. For Nim there is a simple way to win no matter how many rows there are. There must be some way to speed the computation because I just wrote a Java program to find the right move and although it works, it's taking forever on this problem (rows with 5, 7, and 11). Whereas Juan in the game can move very quickly. Of course my algorithm is very inefficient and recursive, needlessly re-calculating positions many (probably millions, in this case) of times.
    Last edited: Mar 24, 2005
  6. Mar 25, 2005 #5
    Confim: There Is a simple strategy and it's a lot like the strategy for Nim. I just got to level 11, 10-2 my favor since I made a couple mistakes at the beginning. Now this is a real brain teaser. (fair to use Google to find the strategy for normal nim)

    Further brain teaser (that I haven't solved): How do you prove that the strategy works?
  7. Mar 27, 2005 #6
    You can beat it realy easy... just open 2 games up... have one start first, then after he has started, you follow behind doing the exact same thing on the other one... and at the end, you will win... Oh, wait... that don't work for the 3ed version... anyway... on 1 and 2 it does... oh, too bad....
    Last edited: Mar 27, 2005
  8. Mar 28, 2005 #7


    User Avatar
    Science Advisor
    Homework Helper

    The strategy for Nim where you have win if you take the last pearl is very similar.
    In fact, you can use the exact same strategy and only change your moves at the end when you can clearly see what the right move is. I got me to level 23, then made a stupid mistake by trying to take back a move by rewinding the flash applet. Then it crashed.
  9. Mar 28, 2005 #8
    Yup! That's the strategy.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook