• 沒有找到結果。

# 以直向、橫向、斜向磁磚鋪滿 m × n 矩形的研究

N/A
N/A
Protected

Academic year: 2022

Share "以直向、橫向、斜向磁磚鋪滿 m × n 矩形的研究"

Copied!
24
0
0

(1)

## 以直向、橫向、斜向磁磚鋪滿 m × n 矩形的研究

### 台北市立建國高級中學 江誠敏 指導老師 沈朋裕

Abstract

The purpose of this research is to study a tiling problem: Given an m× n chessboard, how many ways are there to tile the chessboard with 1× 2 dominoes and also ”diagonal” dominoes (display in the picture below). First we use a transfer- matrix method and recursive method to calculate the answer. Then we try to use a similar method given out by a research in 2001 to find out the formula of the tiling number.

### 1 摘 摘 摘要 要 要

4mn

m i=1

n j=1

(

cos2

2m + 1 + cos2 2n + 1

)

(2)

n

m

2,n

### 的 的 的遞 遞 遞迴 迴 迴關 關 關係 係 係

(3)

(00) (01) (10) (11)

(00) 1 0 0 1

(01) 0 1 1 0

(10) 0 1 1 0

(11) 1 0 0 0



1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0





an+1

bn+1

cn+1

dn+1



 =



1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0





an

bn

cn

dn



(4)

dn+1 ]

= T2 [an

dn ]

= [1 1

1 0 ] [an

dn ]

m,n

### 到 到 到 Rect

m+1,n

k

(s)

k+ 1

(0s)

k+ 1

(1s)

(S)

(S)

(0S) (1S)

(0S)

(1S)

Tm=

[A00 A10

A A

]

(5)

Tm+1=

[B00 B10

B01 B11

] .

B01= B10= Tm=

[A00 A10

A01 A11

]

B11=

[A10 0 A11 0 ]

B00=

[ A10 0 A00+ A11 A10

]

(0S1)→(1S2)

(S1)→(S2)

(2) B10= Tm

B10 代表從(1S1)轉移到(0S2)的方法數, 即未轉移前的最右上角的區域是已被填滿的, 而轉移後最右上角的區域必須是沒有填滿的, 如圖所示：

(1S1)→(0S2)

(S1)→(S2)

(6)

(3) B11=

[A10 0 A11 0 ]

B11 代表從(1S1) 轉移到(1S2)的方法數, 即未轉移前最右上角的區域已被填滿的, 而 轉移後最右上角的區域必須是沒有填滿的, 此時我們分兩種情況討論.

(i) S1= (1S1)

(11S1)→(1S2)

(1S1) [ ] (0S2) 0 (1S2) 0 .

(ii) S1= (0S1)

(10S1)→(1S2)

(1S1)→(S2)

(S2)的方法數,

(0S1) [ ] (0S2) A10

(1S2) A11

.

(0S1) (1S1)

[ ]

(0S2) A10 0 (1S2) A11 0 =

[A10 0 A11 0 ]

(7)

(4) B00=

[ A10 0 A00+ A11 A10

]

B00代表從(0S1)轉移到(0S2)的方法數, 即未轉移前最右上角的區域已被填滿的, 而轉 移後最右上角的區域必須是沒有填滿的, 此時我們分四種情況討論.

(i) S1= (0S1), S2= (0S2)

(00S1)→(00S2)

(1S1)→(0S2)

(ii) S1= (0S1), S2= (1S2)

(00S1)→(01S2)

(1S1)→(1S2)

(00S1)→(01S2)

(0S1)→(0S2)

(8)

(iii) S1= (1S1), S2= (0S2)

(01S1)→(00S2)

(iv) S1= (1S1), S2= (1S2)

(01S1)→(01S2)

(1S1)→(0S2)

(0S1) (1S1)

[ ]

(0S2) A10 0 (1S2) A00+ A11 A10 =

[ A10 0 A00+ A11 A10

]

(9)

u =[

1 0 0 · · · 0] , v =





 1 0 0 ... 0







T2=



1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0



 依據我們找到的規則, Rect3,n 的轉移矩陣

T3=











0 1 2 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0











T4=



























1 0 0 1 0 2 3 0 0 1 2 0 1 0 0 1 0 1 1 0 2 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 2 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0



























T4 =

(0000) (0011) (0101) (0110) (1001) (1010) (1100) (1111)





















(0000) 1 1 2 3 1 2 1 1

(0011) 1 0 0 1 0 1 1 0

(0101) 0 0 1 1 1 1 1 0

(0110) 0 0 1 1 1 1 0 0

(1001) 1 1 1 1 1 1 1 0

(1010) 0 1 1 1 1 1 0 0

(1100) 1 1 1 1 0 0 0 0

(1111) 1 0 0 0 0 0 0 0

(10)

T4n= 5T4n−1+ 4T4n−2− 12T4

n−3+ 9T4n−4+ 7T4n−5− 14T4

n−6+ 5T4n−7. 我們將等號兩邊同乘 u 和 v

uT4nv = 5uT4n−1v + 4uT4n−2v− 12uT4

n−3v + 9uT4n−4v +7uT4n−5v− 14uT4

n−6v + 5uT4n−7v.

n an

0 1

1 1

2 5

3 25

4 139

5 751

6 4051

7 21849

8 117877

9 635969

10 3431155 11 18511575 12 99872603



1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0



 並且用同樣的方法小

τm=

[A00 A10

A01 A11

]

τm+1=

[B00 B10 B01 B11 ]

B01= B10= τm=

[A00 A10 A01 A11 ]

B11= 0 B00=

[A10 0 A11 0 ]

(11)

(0S1)→(1S2)

(S1)→(S2)

(2) B10= τm

B10 代表從(1S1)轉移到(0S2)的方法數, 即未轉移前的最右上角的區域是已被填滿的, 而轉移後最右上角的區域必須是沒有填滿的, 如圖所示:

(1S1)→(0S2)

(S1)→(S2)

(3) B11= 0

B10 代表從(1S1)轉移到(1S2)的方法數, 即未轉移前的最右上角的區域是已被填滿的, 而轉移後最右上角的區域也必須是填滿的, 如圖所示:

(11S1)→(1S2)

(12)

(4) B00=

[A10 0 A11 0 ]

B00 代表從(0S1)轉移到(0S2)的方法數, 即未轉移前的最上面一格是未被填滿的, 而轉 移後最上面一格也必須是未填滿的, 此時我們分兩種情況討論.

(i) S1= (1S1)

(01S1)→(0S2)

(1S1) [ ] (0S2) 0 (1S2) 0 . (ii) S1= (0S1)

(00S1)→(0S2)

(1S1)→(S2)

(0S1) [ ] (0S2) A10 (1S2) A11

.

(0S1) (1S1)

[ ]

(0S2) A10 0 (1S2) A11 0 =

[A10 0 A11 0 ]

(13)

u =[

1 0 0 · · · 0] , v =





 1 0 0 ... 0







τ3=











0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0











τ4=



























1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0



























τ4 =

(0000) (0011) (0101) (0110) (1001) (1010) (1100) (1111)





















(0000) 1 1 0 0 1 0 1 1

(0011) 1 0 0 0 0 0 1 0

(0101) 0 0 0 0 0 1 0 0

(0110) 0 0 0 0 1 0 0 0

(1001) 1 0 0 1 0 0 0 0

(1010) 0 0 1 0 0 0 0 0

(1100) 1 1 0 0 0 0 0 0

(1111) 1 0 0 0 0 0 0 0

(14)

τ4n= τ4n−1+ 7τ4n−2− τ4

n−3− 12τ4

n−4− τ4

n−5+ 7τ4n−6+ τ4n−7− τ4 n−8. 等號兩邊同乘 u 和 v

4n= uτ4n−1v + 7uτ4n−2v− uτ4

n−3v− 12uτ4 n−4v

−uτ4

n−5v + 7uτ4n−6v + uτ4n−7v− uτ4 n−8v.

bn = bn−1+ 7bn−2− bn−3− 12bn−4− bn−5+ 7bn−6+ bn−7− bn−8.

wn = 16k

2 i=1

k j=1

( cos2

5 + cos2 2k + 1

)

n bn wn

0 1 1

1 1 -

2 5 5

3 11 -

4 36 36

5 95 -

6 281 281

7 781 -

8 2245 2245

9 6636 -

10 18061 18061

11 51205 -

12 145601 145601

### 4.1 路 路 路徑 徑 徑對 對 對應 應 應

(15)

y

x

• 第 i 條路徑的起點為 (0, 2i − 1.5), 其中 1 ≤ i ≤ m.

• 假設現在的座標為 (x, y), 如果現在碰到了一個水平磁磚的左端, 則前進到 (x + 2, y).

• 如果現在碰到了一個垂直磁磚上面一格的左端, 則前進到 (x + 1, y + 1).

• 如果現在碰到了一個垂直磁磚下面一格的左端, 則前進到 (x + 1, y − 1).

• 當 x = 2n 則結束.

(圖二)

(16)

(1) 合法的舖法會一對一對映到路徑互不重複的路徑組:

(2) 路徑互不相交的路徑組也會一對一對映到合法的舖法:

(17)

k2m,2n = det





h1,1 h1,2 · · · h1,m

h2,1 h2,2 · · · h2,m

... ... . .. ... hm,1 hm,2 · · · hm,m





### 5 延 延 延伸 伸 伸路 路 路徑 徑 徑

s1s1) s2

s3 t3

t2

t1

¯ s2

¯ s3

¯t1

¯ t2

¯t3

(18)

k2m,2n= det





¯h1,1 ¯h1,2 · · · ¯h1,m

¯h2,1 ¯h2,2 · · · ¯h2,m

... ... . .. ...

¯hm,1 ¯hm,2 · · · ¯hm,m





### 5.1 路 路 路徑 徑 徑表 表 表示 示 示

• A 代表這條路徑中往正右方走的邊有 k 條, 並且依序是在 x = ai− 1 的時候通過這 條邊, 通過後 x = ai+ 1.

• B 代表這條路徑中往右下方走的邊有 h 條, 並且依序是在 y = bi− 0.5 的時候通過 這條邊, 通過後 y = bi+ 0.5. 如下圖舉例的路徑可以用 ((1, 4, 6), (3, 3, 2)) 表示.

¯ s1

¯ s2

¯ s3

¯t1

¯ t2

¯t3

1 4 6

3 3

2

• |A| + |B| = k + h = n + i − j, 這可以由計算得知.

• 1 ≤ ai≤ 2n − 1.

• ai+1≥ ai+ 2,這是因為 ai 表示你已經從 x = ai− 1 走到 x = ai+ 1了, 由於路徑 的 x 座標遞增, 可以知道 ai+1 必須大於等於 ai+ 2.

• 1 ≤ bi≤ 2m − 1.

• bi+1 ≥ bi− 1, 這是因為每次往右下走一次, y 座標只會減少 1, 如果繼續往右下走的 話 bi+1= bi− 1, 而如果到下一次往右下走之間曾向右上走過, 顯然 bi+1≥ bi− 1.

(19)

0≤k≤n+i−j

fn,k× gm,(n+i−j−k),即原本的矩陣 ¯Hm,n可以表示成兩個矩陣的乘積.

H¯m,n= Fm,n· Gtm,n

Fm,n=





fn,0 fn,1 · · · fn,n+m−1

fn,−1 fn,0 · · · fn,n+m−2

... ... . .. ... fn,−m fm,−m+1 · · · fm,n





Gm,n=





gm,n gm,n−1 · · · gm,−m+1

gm,n+1 gm,n · · · gm,−m+2

... ... . .. ... gm,n+m−1 gm,n+m−2 · · · gm,0





Fm,n 和 Gm,n皆為 m × (m + n) 的矩陣. 注意到一些 fi,j 或 gi,j 顯然是不合理的, 此時 應等於 0.

### 5.2 路 路 路徑 徑 徑對 對 對偶 偶 偶

det(Fm,n· Gtm,n) = ∑

J([n+m]m )

det (Fm,n(1, ..., m|J)) · det(Gm,n(1, ..., m|J))

• 由上到下分別有 m + n 條水平線, 水平線的左端為起點, 右端為終點, 第 i 條水平線 的起點和終點分別為 ui, vi.

• 任兩個相鄰的水平線間都會有 2n − 1 條垂直線段連接兩條水平線, 並且任兩個相鄰 的水平線間的任何一條垂直線段到他右邊的垂直線段的間距都一樣.

• 第 i 條水平線和第 i + 1 條水平線間由左到右的第 1 條垂直線段的水平位置會在第 i− 1 條水平線和第 i 條水平線間由左到右的第 2 和第 3 條垂直線段之間.

u1 v

1

u2 v2

u3 v3

u4 v

4

u5 v

5

u6 v

6

u7 v7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

(20)

ak+1≥ ak+ 2,且 |A| = j − i 不同的序列 A 的個數, 而每一種符合的 A 序列都可以看作 是在 Φm,n一條從 ui 走到 vj 且只往右方和下方走的路徑過程中所依序經過的數字.

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

u7 v7

u6 v6

u5 v5

u4 v4

u3 v3

u2 v2

u1 v1

([n + m]

m )

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

1 2 3 4 5 6 7

u7 v7

u6 v6

u5 v5

u4 v4

u3 v3

u2 v2

u1 v1

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

u7 v7

u6 v6

u5 v5

u4 v4

u3 v3

u2 v2

u1 v1

(21)

([n + m]

m )

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

u7 v7

u6 v6

u5 v5

u4 v4

u3 v3

u2 v2

u1 v1

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

1 2 3 4 5

u7 v7

u6 v6

u5 v5

u4 v4

u3 v3

u2 v2

u1 v1

([n + m]

m )

,

### 5.3Resultant

det(Fm,n· Gtm,n) = ∑

J([n+m]m )

det(Fm,n(1, ..., m|J)) · det(Gm,n(1, ..., m|J))

= ∑

J([n+m]m )

det(Fm,n(1, ..., m|J)) · det(Fn,m(1, ..., n|Jc))

= ∑

J([n+m]m )

(−1)sum(J )+m(m+1)2 det(Fm,n(1, ..., m|J)) · det(Fn,m (1, ..., n|Jc))

= det [ Fm,n

Fn,m ]

(22)

(2n− (j − i) j− i

) . 因 此我們可以用組合數寫出矩陣, 為了方便說明我們舉 n = 4, m = 3 作例子.

[ F3,4

F4,3 ]

=

























 (8

0

) (

7 1

) (

6 2

) ( 5 3

) ( 4 4

) ( 3 5

) ( 2 6 ) ( 9

−1

) (

8 0

) (

7 1

) ( 6 2

) ( 5 3

) ( 4 4

) ( 3 5 ) (10

−2 ) (

9

−1 ) (

8 0

) ( 7 1

) ( 6 2

) ( 5 3

) ( 4 4 )

(6

0

) (

5 1 )

(4

2 ) (

3 3 )

(2

4 ) (

1 5 )

(0

6 ) ( 7

−1 )

(6

0 ) (

5 1 )

(4

2 ) (

3 3 )

(2

4 ) (

1 5 )

( 8

−2 ) (

7

−1 )

(6

0 ) (

5 1 )

(4

2 ) (

3 3 )

(2

4 ) ( 9

−3 )

( 8

−2 ) ( 7

−1 )

(6

0 ) (

5 1 )

(4

2 ) (

3 3 )



























y )

[ F3,4

F4,3 ]

=

























 (8

0 ) (

7 1

) ( 6 2

) ( 5 3

) ( 4 4 )

0 0

0

(8 0

) ( 7 1

) ( 6 2

) ( 5 3

) ( 4 4 )

0

0 0

(8 0

) ( 7 1

) ( 6 2

) ( 5 3

) ( 4 4 )

(6

0 ) (

5 1 )

(4

2 ) (

3 3 )

0 0 0

0 (6

0 ) (

5 1 )

(4

2 ) (

3 3 )

0 0

0 0

(6 0

) ( 5 1 )

(4

2 ) (

3 3 )

0

0 0 0

(6 0

) ( 5 1 )

(4

2 ) (3

3 )



























n k=0

(n + k n− k )

tk. 這個函數和 Chebychev 第二類多項式有以下關聯

fn(t) = (−1)nU2n (i√

t 2

)

n

(−1)n−k (n + k

n− k )

(2t)2k.

• Given a (singly) linked list of unknown length, design an algorithm to find the n-th node from the tail of the linked list. Your algorithm is allowed to traverse the linked

There is no general formula for counting the number of transitive binary relations on A... The poset A in the above example is not

For a 4-connected plane triangulation G with at least four exterior vertices, the size of the grid can be reduced to (n/2 − 1) × (n/2) [13], [24], which is optimal in the sense

Therefore, the purpose of this study is to propose a model, named as the Interhub Heterogeneous Fleet Routing Problem (IHFRP), to deal with the route design

Developing a signal logic to protect pedestrian who is crossing an intersection is the first purpose of this study.. In addition, to improve the reliability and reduce delay of

Developing a signal logic to protect pedestrian who is crossing an intersection is the first purpose of this study.. In addition, to improve the reliability and reduce delay of

Therefore, the purpose of this study is to investigate the hospitality students’ entrepreneurial intentions based on theory of planned behavior and also determine the moderating

The purpose of this study is to analyze the status of the emerging fraudulent crime and to conduct a survey research through empirical questionnaires, based on