Pages, some stolen, some original

Saturday, October 24, 2009

Eternity II, Part 3

I couldn't leave it alone until I sorted it out. Here's the formula for calculating the possible number of unique square tiles where each edge can be a different color and N is the number of colors. I have verified it up to 10 colors. Spreadsheet here.

N
+ (N * (N-1))
+ (N * (N-1) / 2)
+ (N * (N-1) / 2)
+ (N * (N-1) * (N-2))
+ (N * (N-1) * (N-2) / 2)
+ (N * (N-1) * (N-2) * (N-3) / 4)

While I was fooling around with this I ran into a weird problem. When I tried to reduce the formula through factoring, the computer code would not produce the right number for all the different values of N. It would get most of them right, but not all. I am going to try and stop fooling with this now and go on to something else. We shall see how that works. Here is the formula that does not work:

N * (1 + ((N-1) * (2 + ((N-2) * (1.5 + (N-3)/4)))))

Update: problem was caused by intermediate results being fractions. Changing N to a floating point number fixed the problem.

No comments:

Post a Comment