6089 comments
2357 subscribers
6234 on Twitter
Subscribe! Feed reader E-mail

XKCD, tic-tac-toe, and fractal goodness

image

I was delighted to see an analysis of Tic-tac-toe on XKCD. Here is a small part of the remarkable graph format XKCD uses to show all the possible outcomes. It shows all the possible moves and the optimal responses for games that start with X in the top left corner and O in the center.

Tic-tac-toe is a good game for computer science. The rules are easy to code. Unlike chess, go, or poker, it’s possible to write a simple program that plays the game perfectly. Games finish in at most nine moves, so it’s easy to test. By considering similar states (starting with X in the top left corner is similar to starting with X in the bottom right corner, and so on), you can learn about the tradeoff between efficiency and complexity. You might start out creating a interface for playing Tic-tac-toe, and then move on to building a system that plays it against you.

A few years ago, W- was active in a LEGO group that organized occasional contests. They were thinking about competing to build a robot that could play tic-tac-toe using a marker and paper. I played with the idea of making a similar graph of all the tic-tac-toe possibilities so that I could encode it into a program, but I never considered anything close to this brilliant format.

The compactness of this graph is amazing. The recursive fractal goodness of it all warms the cockles of my geek heart. And yes, on first look, it seems really complicated and confusing, but if you can figure out enough to find the first few steps, everything will fall into place and you’ll be able to follow it all the way down. I love it like I love iterations of the Peano space-filling curve, the Koch snowflake, and the Sierpinski carpet.

What I like even more is the fact that the community has been debugging the graph, discussing optimal strategies that start with non-corner moves, sharing complete computer-drawn graphs and other sources for similar diagrams (including books). Ahh, geekery…

Image excerpt © 2010 Xkcd – Creative Commons Attribution Noncommercial 2.5 License

Short URL: http://sachachua.com/blog/p/21952
  • http://www.thegeekettespeaketh.com Charo

    Reminds me of the time Dr. Reynaldo Lesaca (RIP) approached me one fine day during a Mensa gathering and handed me a sheaf of papers. It was his research on the mathematics of sungka. He gave it to me with hopes that I might use it one day to create a game for it or to further expand the paper.

    I still have it with me. :)

On This Day...

  • 2012: Visual book review: The Sketchnote Handbook–Mike Rohde — I know, I know, two visual book reviews in one day. But The Sketchnote Handbook is cool and I just [...]
  • 2012: Visual book notes: Best Practices Are Stupid: 40 ways to Out-Innovate the Competition–Stephen M. Shapiro — Here’s my visual summary of Stephen M. Shapiro’s 2011 book Best Practices Are Stupid: 40 Ways to Out-Innovate the Competition [...]
  • 2011: 2011 in review — 2011-12-14: Oops! Forgot to make sure the linked image was the original size. Fixed! Also, added a PDF link for [...]
  • 2010: Weekly review: Week ending December 10, 2010 — I fell off the wagon of early-morning wakeups. Ah, Angry Birds! I’m going to try a few things to [...]
  • 2009: Fall down intentionally — We had circled the ice twice. Hadn’t fallen yet, just wobbled about in the way beginners do. Mel stopped. She [...]
  • 2009: Book: Making Work Work —   Making Work Work: New Strategies for Surviving and Thriving at the OfficeJulie Morgenstern, 2004 Making Work Work In every industry I [...]
  • 2008: Why automation matters to me — The release engineer working on our Drupal project is happy. He manages the deployment of four Drupal projects (each with [...]
  • 2006: Christmas letter prioritization — Hmm. The prospect of sending a Christmas letter / annual report to 500+ people is a little overwhelming. Granted, some of [...]
  • 2005: Pinoy Blog Aggregator — Check out the Philippine Blog Aggregator. It would be nice to see that populated by the blogs on PinoyTopBlogs… Hmm. No [...]
  • 2005: Argh. — Hoping I recover full use of my legs by 7:00, or I won’t be able to make it to the International [...]
  • 2004: Evolution as a Planner user — (Posted to emacs-wiki-discuss some time back.) Me, I started by using Planner+Remember to scribble down random thoughts and put them somewhere publishable. [...]
  • 2004: On call centers — Nix wrote about his unsavory experience with call center recruitment at http://voidphoenix.blogthing.com/2004/11/23/can-you-smell-the-bs/#comments . The excerpts make me really nervous about what people in [...]
  • 2004: Open Source Conference 2005 / Tokyo — ■『オープンソースカンファレンス2005』開催概要 開催日時:2005å¹´3月25日(金)・26日(土) 10:00-17:00 開催場所:日本電子専門学校 7号館(東京・大久保 2004と同じ会場です) 主催:オープンソースカンファレンス実行委員会 OSPN(Open Source People Network) ARGH! I’ll miss it! E-Mail from Hiroshi Miura
  • 2004: From Doc Mana: We made it to the finals! — I am very proud to announce that Ateneo de Manila University’s programming team, “Res cogitans”, made it to the ACM International Collegiate [...]
  • 2002: From the Philosophy handout just distributed today — “A human being who is weaned from all attachment to internally unstable pursuits such as love, sexual activity, power-seeking, and money-making is [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!