• Emily Zhang
  • Fiddler

How Many Ways Can You Tile the Tilted Square?

2024 Jun 212024 June 21 Problem Back

This is a problem that can be divided into subproblems. For example, if we decide to pick this rectangle:

Middle 3 by 7 rectangle highlighted in the 41-square configuration

There are four components this gets split into: a triangular formation on the top and bottom, and a single tile on the left and right.

Let's focus on the top component. This can be split in three ways:

Middle 3-by-7 rectangle highlighted in the 41-square configuration; third row, the one with five squares, is highlighted in a different colorMiddle 3-by-7 rectangle highlighted in the 41-square configuration; top three squares in the middle column are highlighted in a different colorMiddle 3-by-7 rectangle highlighted in the 41-square configuration; the 2-by-3 rectangle above that is highlighted in a different color
  1. In the first, this is just a smaller subproblem: a triangular formation of height 2. Let's call this a corner triangle of height 2.
  2. In the second, this is two smaller subproblems, each of them being a triangle. However, these triangles are different: the edge squares lie along the "hypotenuses" of these triangles. Let's call each of these a side triangle of size 2.
  3. In the third, this is three smaller subproblems, each of them being singular squares (only one way to tile). Technically, the one on the top is a corner triangle of side 1, and the ones on the left and right are side triangles of side 1.

Notice that we can find the number of ways to tile any particular subsection, and the total number of ways to tile is the product for each of the subsections.

So with this, we can establish the three functions needed to determine the overall answer:

  • one for the overall diamond (let f(n)f(n)f(n) describe this for a diamond with nnn squares along one edge)
  • one for the corner triangle (let g(n)g(n)g(n) describe this for a corner triangle with height nnn)
  • one for the side triangle (let h(n)h(n)h(n) describe this for a side triangle with size nnn)

Side triangles

Define h(0)=1h(0)=1h(0)=1. Now for an side triangle of size nnn, we can split by a rectangle, creating one side triangle of size kkk and the other of size n−1−kn-1-kn−1−k. As a result, the total number of distinct formations is the sum of all these from k=0k=0k=0 to k=n−1k=n-1k=n−1, or:

h(n)=∑k=0n−1h(k)⋅h(n−1−k)h(n)=\sum_{k=0}^{n-1}{h(k)\cdot h(n-1-k)}h(n)=k=0∑n−1​h(k)⋅h(n−1−k)

Note that h(1)=1h(1)=1h(1)=1, h(2)=2h(2)=2h(2)=2, and h(3)=5h(3)=5h(3)=5, which can be seen manually. In fact, these are Catalan numbers! h(n)h(n)h(n) is indeed just the nnn–th Catalan number, which we will denote as CnC_nCn​.

The first few Catalan numbers:

nnn012345
CnC_nCn​11251442

Corner triangles

Define g(0)=1g(0)=1g(0)=1. Now for a corner triangle of height nnn, we can split by a rectangle, creating one corner triangle of size kkk and two corner triangles, each of size n−1−kn-1-kn−1−k. So the total number of distinct formations is the sum of all these from k=0k=0k=0 to k=n−1k=n-1k=n−1, or:

g(n)=∑k=0n−1g(k)(f(n−1−k))2g(n)=∑k=0n−1g(k)(Cn−1−k)2g(n)=\sum_{k=0}^{n-1}{g(k)\bigl(f(n-1-k)\bigl)^2} \\ g(n)=\sum_{k=0}^{n-1}{g(k)(C_{n-1-k})^2}g(n)=k=0∑n−1​g(k)(f(n−1−k))2g(n)=k=0∑n−1​g(k)(Cn−1−k​)2

The first few values of g(n)g(n)g(n):

nnn012345
g(n)g(n)g(n)11251442

Diamonds

For a diamond, after choosing a rectangle, we split into four corner triangle subregions: two of size kkk and two of size n−1−kn-1-kn−1−k. So the total number of distinct formations is the sum of all these from k=0k=0k=0 to k=n−1k=n-1k=n−1, or:

f(n)=∑k=0n−1(g(k))2(g(n−1−k))2f(n)=\sum_{k=0}^{n-1}{\bigl(g(k)\bigl)^2\bigl(g(n-1-k)\bigl)^2}f(n)=k=0∑n−1​(g(k))2(g(n−1−k))2

The first few values of f(n)f(n)f(n) (with f(0)=1f(0)=1f(0)=1):

nnn012345
f(n)f(n)f(n)11291063002

The questions asked us about diamonds of sides of n=4n=4n=4 and n=5n=5n=5, leading us to the answers below!


Answers

This Week's Fiddler: 106

Extra Credit: 3002


And beyond

While I did not determine a closed form, we now have a recursive definition of the sequence! With Cn=1n+1(2nn)C_n=\frac{1}{n+1}{2n\choose n}Cn​=n+11​(n2n​) as the nnn–th Catalan number, we can define the following functions to describe f(n)f(n)f(n):

g(0)=1,f(0)=1g(n)=∑k=0n−1g(k)(Cn−1−k)2f(n)=∑k=0n−1(g(k))2(g(n−1−k))2g(0)=1, f(0)=1 \\ g(n)=\sum_{k=0}^{n-1}{g(k)(C_{n-1-k})^2} \\ f(n)=\sum_{k=0}^{n-1}{\bigl(g(k)\bigl)^2\bigl(g(n-1-k)\bigl)^2}g(0)=1,f(0)=1g(n)=k=0∑n−1​g(k)(Cn−1−k​)2f(n)=k=0∑n−1​(g(k))2(g(n−1−k))2

And the values for up to n=20n=20n=20:

nnnCnC_nCn​g(n)g(n)g(n)f(n)f(n)f(n)
0111
1111
2222
3579
41438106
5422743002
61322350153432
74292253111209105
814302332921027079042
948622555658109919229034
10167962923255413176445132632
11587863460134501722653938299826
122080124211121946241219579652401784
137429005244697729235714287018956797136
1426744406660247947585537912139464706335288
1596948458599676755883892837334232641551689441
1635357670112647192598844148820403511450083446225026
17129644790149422472087861425530595384066080684214316346
18477638700200410690615508804491442427844125614764520894656
191767263190271454315346852530807865223153246598712705790433906
2065641204203709291397981162290148197637526550957704054952422581656
Back to Fiddler list
© 2024 Emily Bradon Zhang·Support Gaza Recovery