Showing posts with label nim. Show all posts
Showing posts with label nim. Show all posts
0

Yet Again Still More Quick Snippets

Published on Sunday, August 27, 2017 in , , , , , , , , ,

Luc Viatour's plasma lamp pictureI apologize for the irregular posting over the past few months. I've had to deal with some personal issues (don't worry, everything is fine!). The good news is that, with this entry, everything should start returning to normal.

Having said that, let's dive into August's snippets!

James Grime and Katie Steckles made a video about a seemingly simple game:



First, if it's on Grey Matters, you know all is not always what it seems. Long-time fans of Grey Matters may remember this when I described it under the name Wythoff's Nim. It winds up having some very interesting math behind it. James went on to make a solo video explaining the mathematics behind it in more detail:



• We can't ignore Katie Steckles' game video after all that! Katie teaches 2 games (or does she?). The first one involves numbered fishes, and the second one involves cards with stars and moons on them:



It's a little bit surprising that these are actually the same game! Back in June's snippets, there was a multiplication version of this. Like this and Scam School's game of 15, they all go back to Tic-Tac-Toe. If you want to see some other interesting variations of this same idea, read Martin Gardner's Jam, Hot, and Other Games column.

• There's usually more than one way to use your knowledge. In my tutorial about mental division, I teach a simple method for mentally dividing the numbers 1 through 6 by 7. Presenting it as an exacting feat of mental division is one thing. How else could you present it? Take a look at how Scam School presents the same feat:



If you watch the full explanation, you'll notice another difference between the way I teach it and the way Brian teaches it. He puts emphasis on the last digit, which works well for performing the feat this way. In my version, I teach how to work out the first few digits, as you'll need those first when giving the answer verbally. This is a good lesson in the benefits of changing your point of view!

3

Grey Matters' 10th Blogiversary!

Published on Saturday, March 14, 2015 in , , , , , , , , , , , , ,

Mehran Moghtadaei's Pi Digit GraphicEver since I started this blog, I've been waiting for this day. I started Grey Matters on 3/14/05, specifically with the goal of having its 10th blogiversary on the ultimate Pi Day: 3/14/15!

Yes, it's also Einstein's birthday, but since it's a special blogiversary for me, this post will be all about my favorite posts from over the past 10 years. Quick side note: This also happens to be my 1,000th published post on the Grey Matters blog!

Keep in mind that the web is always changing, so if you go back and find a link that no longer works, you might be able to find it by either searching for a new place, or at least copying the link and finding whether it's archived over at The Wayback Machine.

2005

My most read posts in 2005 were 25 Years of Rubik's Cube (at #2), and Free Software for Memory Training (at #1). It was here I started to get an idea of what people would want from a blog about memory feats.

2006

In the first full January to December year of Grey Matters, reviews seemed to be the big thing. My reviews of Mathematical Wizardry, Secrets of Mental Math, and Mind Performance Hacks all grabbed the top spots.

2007

This year, I began connecting my posts with the interest of the reader, and it worked well. My series of “Visualizing” posts, Visualizing Pi, Visualizing Math, and Visualizing Scale were the biggest collectively-read posts of the year.

Fun and free mental improvement posts also proved popular in 2007. Unusual Lists to Memorize, my introduction to The Prisoner's Dilemma, and my look at Calculators: Past, Present, and Future (consider Wolfram|Alpha was still 2 years away) were well received! 10 Online Memory Tools...For Free! back-to-back with my Memorizing Poetry post also caught plenty of attention.

2008

I gave an extra nod to Pi this year, on the day when Grey Matters turned Pi years old on May 5th. The most popular feature of the year was my regularly update list of How Many Xs Can You Name in Y Minutes? quizzes, which I had to stop updating.

Lists did seem to be the big thing that year, with free flashcard programs, memorizing the elements, and tools for memorizing playing card decks grabbed much of the attention in 2008.

2009

Techniques took precedence over lists this year, although my series on memorizing the amendments of the US Constitution (Part I, Part II, Part III) was still popular. My web app for memorizing poetry, Verbatim, first appeared (it's since been updated). Among other techniques that caught many eyes were memorizing basic blackjack strategy, the Gilbreath Principle, and Mental Division with Decimal Precision.

2010

This year opened with the sad news of the passing of Kim Peek, the original inspiration for the movie Rain Main. On a more positive note, my posts about the game Nim, which developed into a longer running series than even I expected, started its run.

As a matter of fact, magic tricks, such as Bob Hummer's 3-Object Divination, and puzzles, such as the 15 Puzzle and Instant Insanity, were the hot posts this year.

Besides Kim Peek, 2010 also saw the passing of Martin Gardner and Benoît Mandelbrot, both giants in mathematics.

2011

The current design you see didn't make its first appearance until 2011. Not only was the blog itself redesigned, the current structure, with Mental Gym, the Presentation section, the Videos section, and the Grey Matters Store, was added. This seemed to be a smart move, as Grey Matters begin to attract more people than ever before.

The new additions to each section that year drew plenty of attention, but the blog has its own moments, as well. My list of 7 Online Puzzle Sites, my update to the Verbatim web app, and the Wolfram|Alpha Trick and Wolfram|Alpha Factorial Trick proved most popular in 2011.

My own personal favorite series of posts in 2011, however, was the Iteration, Feedback, and Change series of posts: Artificial Life, Real Life, Prisoner's Dilemma, Fractals, and Chaos Theory. These posts really gave me the chance to think about an analyze some of the disparate concepts I'd learned over the years when dealing with various math concepts.

2012

In 2012, I developed somewhat of a fascination with Wolfram|Alpha, as its features and strength really began to develop. I kicked the year off with a devilish 15-style calendar puzzle, which requires knowing both how to solve the 15 puzzle and how to work out the day of the week for any date in your head! Yeah, I'm mean like that. I did, however, release Day One, my own original approach to simplifying the day of the week for any date feat.

Estimating Square Roots, along with the associated tips and tricks was the big feat that year. The bizarre combination of controversy over a claim in a Scam School episode about a 2-card bet and my approach to hiding short messages in an equation and Robert Neale's genius were also widely read.

2013

After we lost Neil Armstrong in 2012, I was inspired to add the new Moon Phase For Any Date tutorial to the Mental Gym. A completely different type of nostalgia, though, drove me to post about how to program mazes. Admittedly, this was a weird way to kick off 2013.

Posts about the Last Digit Trick, John Conway's Rational Tangles, and Mel Stover were the first half of 2013's biggest hits on Grey Matters.

I also took the unusual approach of teaching Grey Matters readers certain math shortcuts without initially revealing WHY I was teaching these shortcuts. First, I taught a weird way of multiplying by 63, then a weird way of multiplying by 72, finally revealing the mystery skill in the 3rd part of the series.

2014

Memory posts were still around, but mental math posts began taking over in 2014. A card trick classically known as Mutus Nomen Dedit Cocis proved to have several fans. The math posts on exponents, the nature of the Mandelbrot set, and the Soma cube were the stars of 2014. Together, the posts Calculate Powers of e In Your Head! and Calculate Powers of π In Your Head! also grabbed plenty of attention.

Wrap-up

With 999 posts before this one, this barely even scratches the surface of what's available at this blog, so if you'd made it this far, I encourage you to explore on your own. If you find some of your own favorites, I'd love to hear what you enjoyed at this blog over the years in the comments below!

0

Quick Snippets

Published on Sunday, June 15, 2014 in , , , , , , , , , , ,

Luc Viatour's plasma lamp pictureJune's snippets are ready!

This month, we're going back to some favorite topics, and provide some updates and new approaches.

• Let's start the snippets with our old friend Nim. The Puzzles.com site features a few Nim-based challenges. The Classic Nim challenge shouldn't pose any difficulty for regular Grey Matters readers.

Square Nim is a bit different. At first glance, it might seem to be identical to Chocolate Nim, but there are important differences to which you need to pay attention.

Circle Nim is a bit of a double challenge. First, you may need to try and figure it out. Second, the solution is images-only. Once you realize that different pairs of images are referring to games involving odd or even number starting points, it shouldn't be too hard to understand.

• Check out the Vanishing Leprechaun trick in the following video:



These are what are known as geometric vanishes, and can be explored further in places such as Archimedes' Laboratory and the Games column in the June 1989 issue of OMNI Magazine.

Mathematician Donald Knuth put his own spin on these by using the format to compose a poem called Disappearances. If you'd like to see just how challenging it is to compose a poem in geometric vanish form, you can try making your own in Mariano Tomatis' Magic Poems Editor.

• Back in July 2011, I wrote a post about hyperthymesia, a condition in which details about every day of one's life are remembered vividly. That post included a 60 Minutes report about several people with hyperthymesia, including Taxi star Marilu Henner. Earlier this year, 60 Minutes returned to the topic with a new story dubbed Memory Wizards. This updated report is definitely worth a look!

• If you're comfortable squaring 2-digit numbers, as taught in the Mental Gym, and you think you're ready to move on to squaring 3-digit numbers, try this startlingly simple technique from Mind Math:



That's all for June's snippets. I hope you have fun exploring them!

0

Free Math Magic Books!

Published on Sunday, May 18, 2014 in , , , , , ,

Stewart Butterfield's bookshelf photoLast week, I gave you some free magazines to peruse.

This week, I have some books I'd like to share with you, and they're filled with a great selection of classic mathematical feats and magic!

The first book I'll share with you is a 1952 book titled Mental Prodigies, by Fred Barlow (embedded below). The first section is concerned purely with arithmetical prodigies, or what we might call lightning calculators or human calculators today. The next section discusses related types of prodigies, such as chess or music. Next, is a section on memory, including chapters on famous memorizers, as well as mnemonics and memory techniques for actors.

The chapter I think will be the most interesting to Grey Matters readers is the section on Mental Magic, starting on page 183. It includes many of the standard feats covered here on Grey Matters, such as day for any date, squaring, cubing, and finding roots.

However, there are some more unusual ones, such as calculating the number of farthings in a given number of guineas, or how many barleycorns there are in a given number of yards. Granted, these might not play too well today, but the same technique, as the author explains, can also be used to give the number of minutes in a given number of weeks!

After the embedded book below, scroll down further for another math magic book.



If you'd prefer more than just a few small chapters about mathematical magic, check out the 1950 classic, Math Miracles, by Wallace Lee.

Among the more unusual tricks here are the Ne Plus Ultra Lightning Multiplier and its variations. The Miscellanies chapter is filled with numerous quick and unusual tricks, including the 100 version of our old friend Nim!

I don't want to rob you of the joy of discovery however. Take a chance to page through these e-books, and you may find some unexpected treasures!

0

Free Math Magazines!

Published on Sunday, May 11, 2014 in , , , , , , , ,

Signe Karin’s newsstand photoMany of you are spending today with your mother in honor of Mother's Day, so I won't strain your brain too much today.

In fact, I'll just leave a few free magazines on the table for your perusal when you have some time later.

I'll start with the brand new Recreational Mathematics Magazine. This magazine is available as a whole PDF, or as PDFs of individual articles. The first article that caught my attention here was “The Secrets of Notakto: Winning at X-only Tic-Tac-Toe”. It caught my attention because I'd written about Notakto strategy 2 years ago, including how to win playing on 1 or 2 boards, and then how to win when playing on 3 or more boards.

Don't let me rob you of the joy of discovery, however. The other articles, including the one about Lewis Carroll's mathematical side, the one about vanishing area puzzles, and others are all waiting to be discovered.

The next math magazine I'd like to draw your attention to is Eureka, published by the Archimedeans, the Mathematical Society of the University of Cambridge, since 1939. New issues are being made available online for free by mathigon.org. This is no minor mathematical publication, either. It was the Archimedeans' Eureka magazine that, back in October 1973, had the honor of being the first to publish John Conway's Doomsday Algorithm for calculating the day of the week for any date.

Generally, The College Mathematics Journal isn't available online for free, but they have generously posted the full contents of their January 2012 Martin Gardner issue online for free! It's full of the kind of recreational mathematics which Martin Gardner loved and Grey Matters readers are sure to appreciate and enjoy. There are too many articles to single any one out for special attention, so I suggest jumping in and seeing what catches your eye first!

The final magazine I'll set out for your perusal isn't a mathematical magazine, but rather a magic magazine called Vanish, which is free to download, or read online as a page-flipping e-magazine. The reason I'm including it here with math magazines is because of Diamond Jim Tyler's article on “The Game of 31”. This is variation of our old friend Nim. For a Nim variation, 31 has a surprising amount of its own variations, including a dice version, a finger dart version, and a version which you can still scam someone after teaching them the secret!

That's all for now, so I'll wish you happy reading!

0

Fibonacci Meets Dr. Benjamin

Published on Thursday, November 14, 2013 in , , , , , , ,

Procsilas Moscas' number grid pictureIf you watched even part of Dr. Arthur Benjamin's lecture in my previous post, you get an idea of the kind of joy and enthusiasm he has for mathematics.

In this post, we feature another new video from Dr. Benjamin, focusing only on Fibonacci numbers. This video is only about 6-7 minutes long, so you can enjoy it even if you couldn't find time to watch the complete video in my previous post.

This video is titled Arthur Benjmain: The Magic of Fibonacci Numbers, and is available on YouTube, as well as TED.com:



The presentation you see behind him in this video was created on Prezi.com, and Dr. Benjamin has made it freely available to view there. If you're viewing this on an Apple mobile device, the presentation can be viewed more effectively via Prezi's free apps.

Here on Grey Matters, we have a healthy respect for the magic and fun Fibonacci numbers make possible. Back in 2010, I posted about the classic Fibonacci addition trick, and other fun with phi. A little less than a year later, Scam School featured the same trick. Playing around with it on my own, I even found a little-used way to expand the routine to a list of any length!

Fibonacci numbers have even found their way into Nim, a favorite game here on Grey Matters. There's Fibonacci Nim, which is the standard take-away game with new rules that let you win with your knowledge of Fibonacci numbers. The Corner The Lady version of Wythoff's Nim is probably the most deceptive use of Fibonacci numbers.

In a post a little over a year ago about the principle behind the classic Age Cards magic trick, there's even a James Grime video showing the Age Cards set up with Fibonacci numbers instead of the standard binary approach!

Take some time to explore and play with these magical numbers, and your time will be well rewarded!

0

Secrets of Nim (Finger Dart Nim)

Published on Thursday, October 31, 2013 in , , , , ,

NIM is WIN upside down!Two of our old friends are back on Grey Matters: Scam School and the game of Nim!

This version uses a dart theme, but you don't even have to be good at the game!

Scam School's 294th episode features an impromptu version of Nim using your fingers as darts, and a napkin as a dartboard:



I'm not going to analyze the play too deeply, as this is simply stanard single-pile Nim, as defined in the first Secrets of Nim post. In addition, it's also essentially the same as Dice Nim, as taught in 250th episode of Scam School, but played to 31 instead of 50.

The Single-Pile Nim tab of the Nim Strategy Calculator can run through the strategy with the following settings:

• Player who makes the last move is the: Winner
• Maximum number of objects (limit): 31
• Nim Game is played: up to limit
• Number of objects used per turn ranges from 1 to: 6

After clicking the Calculate Nim Strategy button, the calculator will return the same strategy in the above video. You can even play around with higher or lower totals, and the numbers you're allowed to use on each turn. What would the strategy be if you allowed the numbers 1 to 7, or 1 to 8? How would it affect the strategy if you play to 32, 35, or 40?

The more interesting aspect of this version of the game, at least to me, is the use of a small dartboard instead of dice. One on hand, this change is merely cosmetic, as it doesn't affect the strategy in any way itself. The psychology on the audience, however, is completely different. Dice aren't as common as dartboards in bars and pubs, so the dart theme makes better sense. In addition, the impromptu nature of drawing on a napkin suggests fairness than someone who brings their own dice, which can suggest that the person suggesting the game has practiced it.

31 also seems to be a favored number for Nim players, most likely because it's high enough to allow you to use your winning strategy, but low enough to keep the game too short for anyone to catch on. In another 31 version using playing cards, the unique nature of playing cards allows you to catch even those who think they know the secret.

As you can see, just examining all the seemingly minor changes in Finger Dart Nim can give you a better understanding of the overall idea behind multiple variations of Nim. If you enjoyed this version, please explore the amazing variety of Nim games taught in other posts here at Grey Matters!

0

Secrets of Nim (Visual Multi-Pile Nim)

Published on Sunday, July 14, 2013 in , , ,

NIM is WIN upside down!It's been a while since we've visited our old friend Nim.

Instead of a new version, we're going to a new look at the classic multi-pile Misère Nim.

If you need a refreshed course, I taught the basics of standard multi-pile Nim here, and the basics of multi-pile Misère Nim here.

The math in those articles did get somewhat technical, so I later taught a better way to visualize the board in order to help you see your best strategy.

Earlier this year, YouTube user Hythloday71 posted the video directly below, which discusses multi-pile Misère Nim. In the video, he plays the game at this site, which requires the Flash plug-in. If you're on a device without the Flash plug-in, you can play the match version here. Try an see if you can figure out how to win, before moving on.



What really drew me to this video in particular, however, was the explanation video. In my earlier visualization post, I tried illustrating the idea in text. In the video below, however, the same visualization concept is presented with straw frames of different colors that really bring the concept to life!



If you enjoyed this game, check out the other Nim posts on Grey Matters. Since Nim is a game you can always win, and has so many variations, it's fun to explore!

0

Even More Quick Snippets

Published on Sunday, May 12, 2013 in , , , , , , , ,

Luc Viatour's plasma lamp pictureThose of you in the US are probably spending Mother's Day honoring your mom, so I'll just sneak a wide variety of snippets in today, and you can check them out later.

• Jan Van Koningsveld, along with Robert Fountain, has released a new book that will be of interest to Grey Matters readers, titled, The Mental Calculator's Handbook (Amazon link). If you're not familiar with Jan Van Koningsveld, he was able to identify the day of the week for 78 dates in 1 minute at the World Memoriad. I haven't had a chance to read this book myself yet, but his reputation does suggest the book is worthwhile.

• Starting back in 2008, I kept track of assorted online timed quizzes, the type of quizzes that ask you how many Xs you can name in Y minutes. I found these so fun, useful, and challenging, I even developed my own timed quiz generator, and even posted several original timed quizzes created with it. However, sporcle.com, home to numerous timed quizzes (despite starting out as a sports forecasting site) has gone and outdone this. Not only can you create your own timed quizzes, you can also embed them on your own site now! Find a quiz you like, for example, this landlocked states quiz, go down to the info box below the quiz, and click on Embed Quiz. A pop-up will ask whether you want a wide or narrow window (minimum width is 580 pixels), and you will be given the proper embed code, which can be used in a manner similar to YouTube embed codes.

• For those of you who do the Fitch-Cheney card trick, as taught on Scam School or YouTube, Larry Franklin has posted a simple tutorial on using Excel to practice this routine. As long as you understand your favorite spreadsheet program well enough, it's also not hard to adapt. It will take a while to create in the first place, but once it's ready, it's fairly easy to use.

• One of the most useful card memory feats to learn is memorizing basic blackjack strategy. Over in reddit's LearnUselessTalents section, user Tommy_TSW posted an interesting approach for memorizing this using your favorite video game, movie, or TV characters. Basically, you create a battle scenario for every possible situation, and when the various cards come up, you simply recall the corresponding battle (and result). Depending on the particular variation of blackjack you're playing, basic strategy can change, so you might want to calculate the right moves using basic strategy calculators at places like Wizard of Odds or Online-Casinos.

Fans of the game Nim will enjoy this online version, playable even on all mobile devices. It's standard Nim, meaning that the last person to remove a card is the winner. It's simple, straightforward, and a good way to practice solo.

0

Scam School Takes on Dice Nim

Published on Thursday, December 27, 2012 in , , , ,

NIM is WIN upside down!Congratulations to Scam School on reaching 250 shows!

As with any good anniversary celebration, they invited back an old friend of their and ours - Nim! More specifically, their 250th episode looks at Nim with dice.

Let's jump right into the 250th episode:



If you think about it, Dice Nim is really just standard single-pile Nim played backwards. As a matter of fact, go to the Single-Pile Nim Strategy Calculator, and use the following settings:

• Player who makes the last move is the: Winner
• Maximum number of objects (limit): 50
• Nim Game is played: up to limit
• Number of objects used per turn ranges from 1 to: 6

Click the Calculate Nim Strategy button, and you'll note that the Nim Strategy Calculator returns exactly the same strategy Brian teaches in this episode. Try playing around with Dice Nim using this calculator, and see how choosing other strategies, or even using dice with more or fewer sides affect the game.

One nice touch that Brian uses in the video is the use of 2 dice. If he were to use just 1, the other people might notice that he's simply giving it a half turn after they play. When they play a 4, he gives it a half turn to the 3 on the opposite side, and so on. With 2 dice, the playing of opposite sides isn't as obvious.

Here's an interesting thought: What if you were to play Dice Nim (with 1 instead of 2), and the rules specified that only you could only make a quarter turn each time? With a 5 on top, for example, you couldn't play 5 on your next turn, obviously. The 2 would be on the bottom, so you also couldn't play 2. You would be limited to rotating a quarter turn to 1, 3, 4, or 6.

There is a version of Dice Nim played exactly like this, called 31. The object is to be the person who either makes the running total exactly 31, or forces the other person to go over 31.

If you're interested in the strategy for this version, I wrote it up back in June of 2011, along with the game of 50 strategy. The next column even teaches how to play the quarter turn version to any number, so you can let the other person choose the goal.

Granted, carrying dice around with you is unusual (except maybe here in Las Vegas, NV), but not shocking. With a little practice, you can have a little fun, and maybe even win a few drinks.

0

Secrets of Nim (Abacan 2)

Published on Thursday, September 27, 2012 in , , , ,

NIM is WIN upside down!In my previous post, I introduced a new version of Nim called Abacan, and introduced one strategy for winning it.

In this post, I'll teach the rest of the strategy you'll need to win Abacan every time. Before we do that, though, I'll go through a quick review.

In Abacan, you have 5 rows of beads. There are rows of 1, 3, 5, 7, and 9 beads. Players alternate taking turns, and can only move 1, 2, or 3 beads, all in the same row, on their turn. The last player to move a bead is the loser.

The strategy taught last time involves first reducing the number of beads in each row to a number from 0 to 3. In situations where the rows reduced to all 1s and 0s, or all 1s and 0s with a single 2 or 3, you simply move so that the reduced rows become an odd number of 1s. For example, rows of 1, 1, 4, 6, and 8 beads can be reduced to rows of 1, 1, 0, 2, and 0 beads. From there, it's a simple matter to see that the “2” row (reduced from 6) should have 1 bead removed from it, leaving the other player with 1, 1, 4, 5, and 8 beads (which reduces to 1, 1, 0, 1, and 0 beads - the equivalent of 3 piles of 1).

You should always reduce the numbers of beads first, then see if you can apply the strategy above first. This “odd 1s” approach is effectively the endgame strategy of multi-pile Misère Nim, as taught in Secrets of Nim (Part 3). In Abacan, however, it can be used well before the end.

What happens, though, if you reduce the rows of beads and find that there's more than one row containing the equivalent of 2 or 3 beads? In that case, you'll need a second strategy.

Strategy 2: In the Secrets of Nim (Part 2) and Visualizing Multi-Pile Nim posts, I discuss the importance of pairing up similar values using the binary. Thankfully, there won't be any need to delve into binary conversion in the Abacan version.

If you have a set of reduced rows containing multiple rows of 2 and/or 3 beads, you'll use the second strategy. In this strategy, you'll want to leave your opponent with rows that, when reduced, have any 1s, 2s, and 3s paired up with each other. You don't need to worry about pairing up 0s.

This can sound confusing, so let's use the starting arrangement of 1, 3, 5, 7, and 9 beads as an example. The first step is to reduce the arrangement from 1, 3, 5, 7, and 9 beads to its equivalent, which is rows of 1, 3, 1, 3, and 1 beads.

Since we can't use strategy 1 from the previous post, we move on to strategy 2, pairing up all the 1s, 2s, and 3s. With the reduced rows of 1, 3, 1, 3, and 1, it's not difficult to see how we can leave our opponent with a pair of 1s and a pair of 3s.

Taking 1 bead from the first row would make leave your opponent with 3, 5, 7, and 9 beads, which reduces to 3, 1, 3, and 1. You could also remove 1 from the 3rd row, leaving your opponent with rows of 1, 3, 4, 7, and 9, which reduces to rows 1, 3, 0, 3, 1. Another alternative is leaving your opponent with rows of 1, 3, 5, 7, and 8 beads, which reduces to rows of 1, 3, 1, 3, and 0 beads.

Now you know that it's to your advantage to move first, and that your first move should be sliding over 1 bead from the row of either 1, 5, or 9. Since 1, 5, and 9 are all equivalent after performing modulus 4, all 3 of these moves have the same effect.

Full approach: This is almost everything you need to know to win Abacan:


1) Mentally reduce the number of beads in each row by using mod 4.
2) If the reduced rows are all 1s and 0s, or all 1s and 0s with a single 2 or 3, remove enough beads to make the reduced rows consist of an odd number of 1s (strategy 1).
3) If using strategy 1 doesn't apply, use strategy 2. Remove beads in such a way that all any 1s, 2s, and 3s remaining are paired up.
Practice, of course, is the best way to do this. As mentioned in the previous post, Wolfram|Alpha can generate random arrangements for you. You can also double-check your mental reductions of each row on Wolfram|Alpha.

As you do this, however, you'll still find certain arrangements you won't be able to solve. This is why I said you know almost everything you need to know.

Recognizing unsolvable arrangements: By playing first and practicing and using the strategies in these Abacan posts, you'll always be able to leave your opponent with an arrangement that will guarantee they will lose.

However, if the other person goes first, and makes the right move, it is possible that they'll leave you with a position from which you don't have a good move. Assuming they're not wise to the strategy and just got lucky, you'll likely be able to recover on a later move. When you can't make an effective move, the best thing to do is simply slide 1 bead in the row with the most beads remaining.

You'll still need to recognize arrangements you can't win. Fortunately, they all fall into 1 of 4 easily recognizable patterns when reduced:
A) An odd number of 1s: 11559 = 11111, 11458 = 11010
B) All numbers paired: 13578 = 13130
C) 1/2/3: 13468 = 13020
D) 1/2/3 plus paired numbers: 13569 = 13121
Once you've practiced to the point where you can mentally reduce the numbers, apply the strategies to give your opponent losing patterns, and recognize when you're given a losing pattern, you're ready and equipped to win Abacan!

For those who would like to delve deeper into the mathematics behind this strategy, you might enjoy this discussion of the game in the BoardGameGeek forums.

Just like any version of Nim, you can play Abacan with any number of objects, such as playing cards or coins. If, however, you enjoyed these tutorials on how to win it, please consider helping this blog out by purchasing Abacan through the Grey Matters Store.

0

Secrets of Nim (Abacan 1)

Published on Sunday, September 23, 2012 in , , , , ,

NIM is WIN upside down!I just added a Nim game called Abacan to the Grey Matters Store. The main piece is a triangular shape with 25 beads in it, distributed as rows of 1, 3, 5, 7, and 9.

Abacan has rules that are slightly different from the previous versions of Nim discussed here on Grey Matters. To make this simpler, I'll review some previous versions of Nim before moving on to Abacan's peculiarities.

Let's start with single-pile Misère Nim (last player to move loses), using 25 objects, and each player is only allowed to remove 1, 2, or 3 objects on their turn. With your previous knowledge and a little practice, or the use of the Single-Pile Nim Strategy Calculator, you should have no problem determining that the other person should go first, and you need to hit the key numbers of 21, 17, 13, 9, 5, and 1.

For multi-pile Misère Nim, with rows of 1, 3, 5, 7, and 9, you'll need the binary understanding of multi-pile Nim taught here (and made easy to visualize here) and the endgame play knowledge of multi-pile Misère Nim taught here. The Multi-Pile Nim Strategy Calculator can help you learn the ideal strategy for this version.

If Abacan went by either of these rules, you'd be all set. However, as you'll see in the video review below, there's a subtle difference. You're only allowed to move 1, 2, or 3 beads, all from the same row, on each turn. The last player to move a bead loses.



Reducing the problem: The first step in Abacan strategy is, not surprisingly, treating each row as if it only had 0, 1, 2, or 3 beads in it, regardless of the actual number of beads in each row. This works out as follows:

Actual number of beads:   1  2  3  4  5  6  7  8  9
Reduced number of beads:  1  2  3  0  1  2  3  0  1
So, a row of 4 beads would be treated as if it had 0 beads, 5 beads would be treated as 1 bead, and so on. Effectively, you're simply subtracting the nearest multiple of 4 equal to or less than the number of beads in a given row. 9 becomes 1 because 9 - 8 (the nearest multiple of 4 less than or equal to 9) = 1.

The mathematical term for this process would be taking modulo 4, or “mod 4.” You can learn more about modular arithmetic via this fun and clear post at BetterExplained.

Abacan strategy 1: Toward the end of multi-pile Misère Nim, the ideal strategy is to leave your opponent an odd number of row, such as 1, 3, or 5, that each contain a single object. That will also work in Abacan, except that row you're treating as a single object may actually contain 1, 5, or even 9 beads! Let's examine various types of Abacan arrangements to see how we can do this.

All 4s and 8s: The simplest situation is when all the rows in play are multiples of 4. Let's say it's your turn, and there are rows of 4, 4, and 8 beads. You start by reducing the problem as discussed above, so the rows translate into rows of 0, 0, and 0 beads. In a normal game of Nim, every row consisting of 0 beads would be the end of the game, but not in Abacan!

If we slide 1 bead from the row of 8, leaving 7 beads, we see that 7 reduces to 3, so by moving 1, we effectively added 3 to one of the piles. This is also true of the moving 1 from the 4 pile, which also creates a row of 3.

Similarly, moving 2 beads from any row of 4 or 8 effectively adds 2 beads to that row, and moving 3 beads in a row of 4 or 8, effectively adds 1 to that row.

Remember strategy 1 above. If we can create an odd number of rows containing a single object (or a number can be reduced to a single object), we're a step closer to winning!

So, with our example rows of 4, 4, and 8 (again, this reduces to 0, 0, and 0), sliding 3 from the first row would give us 1, 4, and 8, which reduced to 1, 0, and 0 - an odd number of 1s!

Yes, you could slide 3 from the middle row instead, resulting in 4, 1, and 8 (reduces to 0, 1, and 0), with the same result. What happens if you slide 3 from the row of 8? You'd wind up with 4, 4, and 5, which reduces to 0, 0, and 1 - still resulting in the odd number of 1s needed to satisfy the strategy!

Mixed 1s, 4s, 5s, 8s, and 9s: If all the rows in play reduce to 1s (1, 5, and 9 beads) and 0s (4 and 8 beads), this strategy will still work. As an example, let's try rows of 1, 4, 5, and 8, which reduces to rows of 1, 0, 1, and 0 respectively.

The obvious move here would be to remove 1 bead from either the row of 1 or 5, resulting in either rows of 4, 5, and 8 (reduces to 0, 1, and 0) or 1, 4, 4, and 8 (reduces to 1, 0, 0, and 0), giving us an effective single row of 1.

There's another less obvious option here, as well. Remember that you can take rows reduced to 0, and effectively add 1 to them by removing 3 beads. If we take 3 from the row containing 4 beads, we're left with 1, 1, 5, and 8 beads, which reduces to 1, 1, 1, and 0 beads. There are now 3 rows which reduce to a single bead, which still satisfies strategy 1.

Removing 3 beads from the row of 8 would also have the same effect. The resulting piles would be 1, 4, 5, and 5, which reduce to 1, 0, 1, and 1, giving us another 3 piles of single objects. In other words, there's often more than one way to get to a safe position.

Mixed 1s, 4s, 5s, 8s, and 9s with a single 2, 3, 6, or 7: 2 and 6, as explained under Reducing the problem above, both reduce to 2, and 3 and 7 both reduce to 3. If there's just a single row consisting of 2, 3, 6, or 7 beads, and all the rest reduce to 1s and 0s, the same strategy will still work.

Let's assume that you turn leaves you with rows of 1, 4, 6, and 8 beads. As always, the first step is to reduce the problem, which gives us 1, 0, 2, and 0 beads. We're looking for a way to get to an odd number of 1s, and so the simplest solution is remove 2, leaving us with a single 1. So, we slide 2 from the row of 6, leaving rows of 1, 4, 4, and 8, which reduces to 1, 0, 0, and 0 beads!

You can practice your skill at reducing the problem by having Wolfram|Alpha generate random bead arrangements for you. If a randomly-generated arrangement happens to satisfy the situations I've already explained, you can also practice finding the best move. Keep in mind, Wolfram|Alpha may also generate an arrangement from which there is no winning move for you. This is valuable, as you'll start learning how to discern arrangements you can win from ones you can't.

If there are several rows, each with 2, 3, 6, and/or 7 beads, however, you'll need to learn and use a different strategy. We'll cover that strategy in the next post.

0

FREE iOS Nim Games

Published on Sunday, September 02, 2012 in , , , ,

NIM is WIN upside down!I've written quite a few posts about the game of Nim, but practice is the real key.

In this post, we'll take a look at iOS Nim apps that you can download and use to practice for free on the go! Yes, there are free Nim apps for Android devices, but the variety is a little wider for iOS devices.

Most of the Nim apps you find are based on either single-pile Nim or multi-pile Nim.

For single-pile nim, try out Take Apples and NeonNim: The Subtraction Game. Multi-pile Nim can be practiced with the Stick Showdown and myQuickGame Free apps. If you want to switch between the two, there's the simply-named Nim Game and the aptly-named Appointed Win Game.

Back in June 2010, Scam School featured an episode of Nim without props. You'd wouldn't think you could turn a propless Nim game into an app, but it has been done! The calendar Nim variation is available as The Date Game. The other version is available as Race To 100.

There's also the ingenious tic-tac-toe variation of Nim known as Notakto. Notakto's winning approach isn't as easily picked up as some of the other variations of Nim. However, you can learn via my tutorials over in the Mental Gym, How to Play and Win Notakto and How To Play and Win Notakto: 3+ Boards.

There are a few variations of Nim out there, however, for which there are few (if any) ready-made tutorials. If you're up for the challenge, try a version with unfamiliar rules and strategies, and see how well you can do at working them out yourself. There's TacTix, in which you remove items from any contiguous columns OR rows, or the similar Triangular Nim, which throws diagonals into the mix, as well!

Probably the most challenging version of Nim is Hakenbush, which involves erasing lines, and eliminating any lines which are no longer connected to the base. Since there are endless possible shapes and color combinations to use, working out a general strategy is tougher than it may first appear!

I hope you find these versions of Nim fun and thought-provoking. If you have a favorite free Nim app, for any device, let me know about it in the comments!

0

Nim Updates

Published on Sunday, August 05, 2012 in , , , , , , ,

NIM is WIN upside down!(NOTE: Check out my other Nim posts by clicking here.)

Looking around the web, I've discovered many new things related to Nim, a favorite game here at Grey Matters.

Instead of discussing a new variation of Nim, this post goes back and takes a closer look at some versions of Nim that have been discussed in previous posts.

Futility Closet just posted a puzzle called Last Cent, which is simply single-pile Nim played with 15 pennies and moves limited to taking 1, 2, or 3 pennies. If your Nim skills are rusty, try and work out the best strategy for this before moving on.

Moving on to multi-pile Nim, there's an attractive new table-top version of Nim now available, called Abacan. Below is a video review of Abacan, so you can get a better idea of how it looks and works.



It's described in the video as a game where the last player to make a move loses, but readers of Grey Matters know that you could change that rule to the last player to make a move being the winner, and only a minor change in strategy would be required.

With information from my posts on multi-pile Nim, you could work out the strategy for yourself, or you could just take the direct step of using the multi-pile Nim Strategy Calculator for a 5-pile game of piles consisting of 1, 3, 5, 7, and 9 objects.

Back in the March 1962 issue of Scientific American, Martin Gardner wrote about a game called Hexapawn, and how anyone could build a simple computer out of matchboxes and a few tokens that could learn how to win the game on its own! The article was reprinted in his book The Unexpected Hanging and Other Mathematical Diversions, and later in chapter 35 of The Colossal Book of Mathematics.

In that chapter, Martin Gardner briefly mentions that such a computer could also be built to play Nim, but doesn't give much in the way to details. Over at Tony's Math Blog, Tony discusses a Nim matchbox learning computer in more detail, if this strikes you as a fun an interesting project. He called his set “A Nim's Game Experience Learning Automaton”, or A.N.G.E.L.A., for short.

Besides Martin Gardner's classic writings on this game, there are also some excellent papers and lectures about Nim available on the web. Paul Gafni has a multi-part video on YouTube, and here's the first video:



The complete series can be found at the following links:

Intro (This is the above video.)
Part 2
Part 3
Part 4
Part 5

David Metzler also has a lecture video series on Nim, and this one is a bit more technical, with computer graphics used to help explain the concepts. Here's the first video in David Metzler's Nim lecture series:



David Metzler's complete lecture can be found at these links:

Part 1 (This is the above video.)
Part 2
Part 3
Part 4

If you liked my Chocolate Nim post, there's an online paper focusing on approaches to different versions of Chocolate Nim at virtualsciencefair.org. Even if you don't understand it right away, trying out the included Java applets and practicing with real chocolate when possible will help you pick it up quickly.

If you remember my post on fractals from summer 2011, you might be startled to learn that Nim can be examined using fractals! It turns out that the humble Sierpinski triangle turns out to be an excellent tool for examining effective Nim plays, as explained in this PDF.

For even the most ardent Nim fan, there's plenty of material here to study for quite some time. If you've made your own interesting Nim discoveries, let me know about them in the comments!

0

Secrets of Nim (Wythoff's Nim)

Published on Sunday, May 20, 2012 in , , , , , ,

NIM is WIN upside down!One of the oldest versions of Nim is a Chinese game called jiǎn shízǐ, which literally means “picking stones.”

In this particular version, there are two piles of objects of various sizes. On their turn, a player may take either as many objects as they want from just one pile, OR take the same number of objects from both piles. The player who takes the last object wins.

For those familiar with Nim games, this appears to be a minor rule change at first glance. However, a proper analysis of the game yields some surprising principles behind this game.

Completely unfamiliar with the Chinese game, a mathematician named W. A. Wythoff independently reinvented the game, and analyzed the perfect winning strategy back in 1907.

Around 1962, Johns Hopkins University mathematician Rufus P. Isaacs developed a seemingly-unrelated board game using a chess board, often called “Corner the Lady.”

Isaac's game starts with a standard 8 by 8 chessboard or checkerboard, and a single chess queen being placed anywhere in the topmost row, or the rightmost column. The objective is to be the person who moves the queen into the square at the lower right corner. In the image directly below, the black queens represent the possible starting positions for the queen, and the white queen represents the goal square.



The queen moves much like in chess, moving any number of squares in a straight horizontal, vertical, or diagonal line. There is one difference in the queen's move in this game: The queen can only move east, south, or southeast. This means that the queen can never move away from the goal square, only toward it.

How do you win this game? The answer is found by working backwards. Since the goal square is obviously a safe square for winning, it follows that any move a queen's move away would guarantee a win for the next player. The closest two squares that aren't covered by a queen's move would be considered safe, because they're more than one queen's move away from the goal square.

The animation below shows how this principle is applied and re-applied (a process known as recursion) to find all the safe squares on an 8 by 8 chessboard. The queens represent the safe squares, and the pawns represent all possible paths taken to that square.


The location of the safe squares is easy to remember. Think of the goal square, and the two squares that are a knight's move away from it, and you've already remembered 3 of the safe squares. The 4th square from the left in the top row, the 4th square from the top in the left row, and the squares a knight's move from both of those (remembering those specific knight's moves) complete the set.

Interesting how, in a chess-related game with no knights, the knight's moves still play an important role, isn't it?

If we think of the goal square as the (0,0) point on a grid, then we see the nearest safe squares are at (1,2) and (2,1). The next pair is at (3,5) and (5,3), with the final pair on this board being at (4,7) and (7,4).

If you imagine trying this same process on larger boards, you get pairs like (6, 10), (8,13), (9,15), and beyond. Noting the infamous Fibonacci number pairings of 1, 2, 3, 5, 8, 13, and beyond, Isaacs looked deeper to see if Phi (the golden ratio) was somehow involved. When he did, he made three astounding discoveries!

If we call the numbers in each pair A and B, and we're looking for the kth number in each sequence, A can be calculated by multiplying k by the golden ratio, and then rounding down to the nearest whole number (known as the floor function). Here's a table of the results for k running from 0 to 15.

What about B? That was the second amazing discovery. The kth number B can be found by multiplying k by the square of the golden ratio.

Here's a table of the A & B numbers paired up, running from the 0 to the 15th pair.

What about the third discovery? It turns out that Wythoff's 1907 analysis was identical. In fact, Wythoff's game, in which a player may take either as many objects as they want from just one pile, OR take the same number of objects from both piles, is mathematically identical to Isaac's “Corner the Lady” game!

How is this possible? In Isaac's board game, the winner is the person who moves the queen to (0,0). In Wythoff's game, the winner is the person who leaves the piles with the totals of (0,0).

We've seen how it was worked out that (1,2) and (2,1) were safe squares in Isaac's game. How does this apply in Wythoff's game? If you can leave a pile with 1 object, and another pile with 2 objects, that leaves the other player with only 4 moves. They can remove 1 object from the 1-object pile (leaving a single pile of 2), remove 1 object from the 2-object pile (leaving two piles of 1), remove 2 objects from the 2-object pile (leaving a single pile of 1), or take 1 object from both piles (leaving a single pile of 1). In every one of these cases, removing the remaining object(s) is both a legal and winning play.

Similar plays and reasoning hold true for all the other number pairs, as well. You can try a version of Isaac's game online here, and see how easy it is to win, unless the computer picks a safe square.

Martin Gardner wrote about these games in more detail, too. You can read more about these games in this excerpt from Penrose Tiles to Trapdoor Ciphers, or buy the complete book here.

This isn't the first time I've examined Fibonacci numbers in connection with Nim, either. Check out my Fibonacci Nim post to see another use for them.

0

Secrets of Nim (Multi-board Notakto)

Published on Sunday, May 06, 2012 in , , , , ,

NIM is WIN upside down!Last month, I posted about a tic-tac-toe-like version of Nim known as Notakto.

That post only discussed how to win the game on a single board. What about winning on more than one board?

Whether or not you've practiced the technique from the previous Notakto post, try the game for yourself. You can play it either online here or download the iPad app here. If you're not familiar with the game, here are the rules, excerpted from the iPad app homepage:

Notakto is a two-player game that is similar to Tic-Tac-Toe, except that both players make X's, and whoever completes three-in-a-row LOSES the game.

For a challenge, play a multiboard game of Notakto. On your move, make an X on just ONE of the boards. The computer may respond on the board you played on, or on some other board. A board that already has a three-in-a-row configuration is considered out of play. To win, force the computer to complete the last three-in-a-row configuration on the last available board still in play.

Even when you catch on how to win at 1-board Notakto, figuring how to win with 2 or more boards can still be tough.

To make the strategy for multi-board Notakto clearer and easy to follow, I've added 2 new posts to the Mental Gym. The first Notakto post teaches you the basics, and how to win 1- and 2-board games specifically.

The second Notakto post reviews what you've learned, and then expands upon that to show you how to properly apply what you've learned to games using 3 or more boards. This part also includes how to present it as a game to play, and adds some other tips and resources to explore.

The tutorials are set up so that you learn a concept, practice it, and then move on to the next concept. Ideally, this helps make each part clearer, and easier to learn and remember.

If you have any suggestions or questions about these tutorials, or even if you want to share any fun stories relating to the game, post them in the comments!

1

Secrets of Nim (Notakto)

Published on Thursday, April 12, 2012 in , , , , ,

NIM is WIN upside down!Back in 2010, Backgammon giant Bob Koca was playing tic-tac-toe with his 5-year-old nephew, when the nephew whimsically suggested that they both play as X.

Being a mathematics professor, he used his knowledge to analyze this weird version of the classic game with various rules, boards, and objectives. It turns out that this all-Xs version of tic-tac-toe is a version of our old friend Nim!

To keep the game familiar, I'll stick to the standard 3-by-3 board in this post. The rules are as follows:

• Players alternate taking turns, and neither player may pass on their turn.
• A player marks any empty space on the board with an X on their turn.
• The loser is the first person to mark an X on the board that completes a horizontal, vertical, or diagonal line of 3 Xs.

This game is known to mathematicians as neutral or impartial tic-tac-toe, but I prefer the name given to it by Thane Plambeck, who lectured on this game at G4G10: Notakto (pronounced “No Tac Toe”).

As I mentioned, this is variation of Nim, more specifically a Misère version, so there must be some way to win it. I'll start, however, by explaining how to lose the game, instead:

What YOU Should NOT Do

You should start by going first, but the worst possible opening move is to place your X on any of the edge or corner squares. Why?

Because your opponent can basically mirror your moves, and this strategy will ensure that you must eventually make a line of 3 Xs, as shown in the following animation:


As you can see at the end of the animation, when the first player puts their X on an edge or corner square, and the second player mirrors them, this leaves an open diagonal line on the first player's turn that forces them to complete a line.

I mention this strategy mainly so you can be aware of it, and make sure that it doesn't happen to you inadvertently. Should you let the other player go first and they place their first X on an edge or corner square, knowing about this becomes a winning strategy for you!

How To Win

To assure yourself the win, you start by placing your X in the center square. To play from there, Timothy Chow discovered the answer comes with help from a chess knight!

Knowing how a chess knight moves (2 squares horizontally and 1 vertically, OR 2 squares vertically and 1 horizontally) is all you need to win.

After the other player makes their move, mark your next X a knight's move away from where their previous move. Keep using this strategy and they'll always be forced to draw the losing X. Watch the following animation carefully, and you'll get the general idea:


When choosing your spaces using the knight's move strategy, you'll usually have more than one space that qualifies. Often, one of the spaces will complete a line of 3 Xs, while the other is safe, so you'll always want to double check that you don't inadvertently make a losing play when you don't have to.

You can find out more about the game from Bob Koca's original discussion or the MathOverflow discussion. For a deeper look at the mathematics of Notakto, you can also read Thane Plambeck's presentation in PDF form.

If you'd like to practice this and you have an iPad, Thane Plambeck has also developed a Notakto app which will let you practice this version, as well as more difficult versions!

There's a closely related game taught on Scam School, called Napkin Chess, which is won using a similar symmetrical strategy. It's interesting to see the similarities, even though it doesn't have a tic-tac-toe board's discrete spaces.

0

Quick Snippets

Published on Sunday, March 11, 2012 in , , , , , , ,

Luc Viator's plasma lamp pictureIt's time for March's snippets!

This time around, we have a selection of new and unusual approaches to using memory techniques:

• Back in January of this year, British Channel iTV premiered a new game show called The Exit List. Contestants answer trivia questions as they proceed through a “memory maze”, but there's a twist! Contestants must memorize an ever-growing list of the answers in order to exit the maze with the money. Correct answers add only one item to the list that must be memorized, while incorrect answers add four items to the list!

To make the game even more exciting, there's a hidden room in the last row containing $100,000 (the others contain $10,000) for correct answers, and also panic rooms, which can add lists of random letters (as opposed to the usual words or phrases) to your memory list. You can find episodes online to get a better idea of this Indiana Jones-meets-Simon game show.

This game show may be coming to America on ABC, as well, courtesy of the same people who brought Who Wants To Be A Millionaire? to the US.

• Joshua Foer, author of Moonwalking With Einstein, has given a talk on memorization techniques at TED 2012. At this writing, there is no video to accompany that article, but it will likely be available in the long run.

• If you enjoyed my posts on the MIT Blackjack Team, there's a new independent film out on a similar topic. It's called Holy Rollers, and is about a team of card counting Christians. From the trailer alone, it looks like it could be an interesting movie:



• If you've enjoyed my posts on the game of Nim, there's now a commercial desktop version of multi-pile Nim available. It's called Abacan, and is played by sliding beads along different bars from one side of the frame to another.

You can use what I've taught in my Nim posts to try and work out the strategy on your own, or you can just go to the multi-pile Nim Strategy Calculator, select 5 rows, and enter 1-3-5-7-9 for the sizes of the rows to get the winning strategy.

One final note: Ordinarily, my next post would be on Thursday. I'll be posting on Wednesday instead, as Wednesday is Pi Day (3/14)! Pi Day is also Einstein's birthday, and Grey Matters' blogiversary!