Looking back at the original problem, “How many different ways can you arrange the cards in the frame given the following”. The orientation of the frame doesn’t alter that.

BTW, more on domino tiling can be found on Wikipedia: http://en.wikipedia.org/wiki/Domino_tiling

]]>My way, and your way, and his way and her way and their way and theirs, and theirs, Everyone has a different way!

]]>I’d have to say about 10 or so before my creative juices dried up and I just stopped trying.

But in mathematical terms I’m pretty sure David’s right in comment 2.

]]>Regardless of whether the individual cards look equally good horizontally or vertically – there is still only one best aesthetic composition of all twenty cards in the frame.

(The trick is to find it without spending 385,000 million years trying all alternative permutations first…)

]]>First, we consider the number of ways to arrange the identical mini-frames inside the larger frame. “Tiling the plane” is a well-studied problem in mathematics and happily there is a formula for the case of tiling an MxN rectangle with 2×1 dominoes, as here.

The formula is:

2^(M*N/2) times the product of

{ cos^2(m*pi/(M+1)) + cos^2(n*pi/(N+1)) } ^ (1/4)

over all m,n in the range 0 gt m lt M+1, 0 gt n lt N+1.

Here, M = 5 and N = 8. I wrote a little script to calculate this:

product = 1;

for (n = 1; n lte 8; n++) {

for (m = 1; m lte 5; m++) {

term = ((Math.cos(Math.PI * m / 6)) ** 2 + (Math.cos(Math.PI * n / 9)) ** 2) ** 0.25

product = product * term

}

}

println product

and got 14,824.

Now, for each of these arrangements of mini-frames, in how many ways can we place the moo cards?

In the first position, we can choose 1 of 20 cards. In the second, 1 of 19. And so on. The total number of permutations is 20! (20 factorial).

Each arrangement can be hung horizontally or vertically so we multiply that by 2.

To get the final total, we multiply our two big numbers together:

2 x 20! x 14,824

= 72,130,678,738,421,022,720,000

A couple of extra assumptions I made:

– each moo card looks good vertically or horizontally but not upsidedown in either orientation.

– each moo card is included once (and only once)