Fun with Factorials

g01A while back my youngest son, who is an avid Go player, asked me, “Is it true there are more possible Go games than there are atoms in the universe?”

go2“Absolutely,” I replied, “Let’s fire up FileMaker Pro and prove it.” (I wasn’t about to let a rare teachable moment slip by.) “If memory serves, the number of atoms in the universe is estimated be roughly 10^80. Since a Go board is 19 by 19, in theory there are 361 possible first moves (19^2), followed by 360 possible second moves for each of those 361 first moves, followed by 359 possible third moves for each of the 360 possible second moves, and so on. Therefore the total number of moves can be calculated as 361 x 360 x 359… x 1, or, more simply, 361! (i.e., 361 factorial).”

In Go, stones are placed on the line intersections, not on the spaces, which is why the Go board is 19 by 19, and not 18 by 18. It also turns out that my assumption re: possible Go moves was overly simplistic, but I didn’t realize that at the time… see Number of Possible Go Games for a detailed exploration.

2-14-2013 10-33-06 PMSo, which number is bigger, 361! or 10^80? Given that FileMaker has a Factorial function, you might think that the expression at left would work, but alas, the largest value that the Factorial function can handle is 212. So, I headed over to WolframAlpha, requested the factorial for 361…

2-14-2013 10-55-45 PM

…and, yep, 10^768 is certainly larger than 10^80.

2-14-2013 11-04-55 PM

Several days later, I happened to mention this episode to Jason DeLooze, and expressed disappointment that I hadn’t been able to compute 361! using my favorite database program. He pointed out that there is a simple work around (apart from the obvious 361 x 360 x 359… approach), and suggested that I take a look at the Factorial help page, and think about that “optional number of factors” parameter.

2-14-2013 11-18-58 PM

Near the bottom of the help page, the second example caught my eye…

2-14-2013 11-26-10 PM

…but I wasn’t sure what to make of it, so he explained that I could create two factorial statements and multiply them together, like so:

Factorial ( numberA ) * Factorial ( numberB ; numberOfFactors )

…where numberA = 212, numberB = 361 and numberOfFactors =149 (i.e., the difference between 361 and 212). And you know what? He was right.

2-14-2013 11-59-06 PM

4 thoughts on “Fun with Factorials

    1. Kevin Frank

      As noted in the article (“It also turns out that my assumption re: possible Go moves was overly simplistic, but I didn’t realize that at the time…”).


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.