Quantcast
Viewing all articles
Browse latest Browse all 35

Extending OEIS: Counting Diamond Tilings

I promise, this will be my last challenge about diamong tilings (for a while, anyway). On the bright side, this challenge doesn't have anything to do with ASCII art, and is not a code golf either, so this is actually completely different.

So just as a reminder, every hexagon can be titled with three different diamonds:

Image may be NSFW.
Clik here to view.

An interesting question to ask is how many of these tilings exist for a given hexagon size. It seems these numbers have been studied fairly thoroughly and can be found in OEIS A008793.

However, the problem gets trickier if we ask how many tilings exist up to rotation and reflection. For instance, for side length N = 2, the following 20 tilings exist:

   ____     ____     ____     ____     ____     ____     ____     ____     ____     ____    /\_\_\   /\_\_\   /\_\_\   /\_\_\   /_/\_\   /_/\_\   /\_\_\   /_/\_\   /_/\_\   /_/\_\  /\/\_\_\ /\/_/\_\ /\/_/_/\ /\/_/\_\ /\_\/\_\ /\_\/_/\ /\/_/_/\ /\_\/\_\ /\_\/_/\ /_/\/\_\ \/\/_/_/ \/\_\/_/ \/\_\_\/ \/_/\/_/ \/\_\/_/ \/\_\_\/ \/_/\_\/ \/_/\/_/ \/_/\_\/ \_\/\/_/  \/_/_/   \/_/_/   \/_/_/   \_\/_/   \/_/_/   \/_/_/   \_\/_/   \_\/_/   \_\/_/   \_\/_/    ____     ____     ____     ____     ____     ____     ____     ____     ____     ____    /_/_/\   /\_\_\   /_/\_\   /_/_/\   /_/\_\   /_/\_\   /_/_/\   /_/_/\   /_/_/\   /_/_/\  /\_\_\/\ /\/_/_/\ /_/\/_/\ /\_\_\/\ /\_\/_/\ /_/\/_/\ /_/\_\/\ /\_\_\/\ /_/\_\/\ /_/_/\/\ \/\_\_\/ \/_/_/\/ \_\/\_\/ \/_/\_\/ \/_/_/\/ \_\/_/\/ \_\/\_\/ \/_/_/\/ \_\/_/\/ \_\_\/\/  \/_/_/   \_\_\/   \_\/_/   \_\/_/   \_\_\/   \_\_\/   \_\/_/   \_\_\/   \_\_\/   \_\_\/ 

But many of these are identical under rotation and reflection. If we take these symmetries into account, only 6 distinct tilings remain:

   ____     ____     ____     ____     ____     ____    /\_\_\   /\_\_\   /\_\_\   /_/\_\   /_/\_\   /_/\_\  /\/\_\_\ /\/_/\_\ /\/_/_/\ /\_\/_/\ /\_\/_/\ /_/\/\_\ \/\/_/_/ \/\_\/_/ \/\_\_\/ \/\_\_\/ \/_/\_\/ \_\/\/_/  \/_/_/   \/_/_/   \/_/_/   \/_/_/   \_\/_/   \_\/_/    2        2        6        6        1        3

where the numbers indicate the multiplicity of each tiling. Note that for larger hexagons there are also tilings with multiplicities 4 and 12.

It appears that the number of tilings up to symmetry has been studied less thoroughly. The OEIS entry A066931 only lists the five terms:

1, 1, 6, 113, 20174

where the first term is for side length N = 0 and the last term for side length N = 4.

I'm sure we can do better than that!

Your task is to compute the number of tilings for a given side length.

This is . Your score will be the highest side-length N for which your code produces the correct result within 30 minutes on my machine. In case of a tie, I will accept the submission which produces the result for thatN fastest.

As usual, you must not hardcode results you already know to win the tie-breaker. The algorithm that solve N = 3 should be identical to the one that solves N = 5.

Your submission must not use more than 4GB of memory. I will give some leeway on this if you're operating close to that limit, but if you're consistently above that limit, or if you spike significantly beyond it, I will not count that N for your submission.

I will test all submissions on my Windows 8 machine, so make sure your language of choice is freely available on Windows. The only exception to this is Mathematica (because I happen to have a licence for it). Please include instructions for how to compile/run your code.

Of course, feel free to compute more terms in your own time (for science, and for others to check their numbers against), but your answer's score will be determined in those 30 minutes.


Viewing all articles
Browse latest Browse all 35

Trending Articles