Dominoes: Difference between revisions

m
different source for formula
m (different source for formula)
Line 202:
</pre>
===Extra credit task ===
<lang julia>""" From https://enwww.wikipediamath.orgcmu.edu/wiki~bwsulliv/Domino_tiling#Counting_tilings_of_regionsdomino-tilings.pdf
The number of ways to cover an m X n rectangle with m * n / 2 dominoes, calculated
independently by Temperley & Fisher (1961) and Kasteleyn (1961), is given by
"""
function dominotilingcount(m, n)
return BigInt(floor(prod([prod(
[abs(big"2.0" * cospi(j / (m + 1)) + 2 * im * cospi(k / (n + 1))) for k in 1:n])
[prod(
for [big"4.0" * cospi(j / (m + 1)) + 4 * cospi((k / (n + 1))) for k in 1:(n+1)÷2m]
) for j in 1:(m+1)÷2]
)))
end
Line 225 ⟶ 224:
</lang>{{out}}
<pre>
Arrangements ignoring values: 25418017001671065533809
Permutations of 28 dominos: 304888344611713860501504000000
Permuted arrangements ignoring flipping dominos: 774965712644240130536285719756800000000509488404340715971133309942207348736000000
Possible flip configurations: 268435456
Possible permuted arrangements with flips: 208028274458021565214007381729204817100800000000136764752145912471077652891125763304499183616000000
</pre>
 
4,102

edits