13. `
규칙 3
two moves -> transfer = single interchange (by 규칙1 when n=1)
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
Transfer
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
2019-01-02 13
14. `
규칙 4
n move -> transfer
= (n-1) move -> transfer -> 1 interchange (by 규칙1)
= (n-2) move -> transfer -> 2 interchange (by 규칙1)
= …
= 1 move -> transfer -> n-1 interchange (by 규칙1)
= n-1 interchange (by 규칙2)
2019-01-02 14
15. `
규칙 5
nth move 후에 blank square가 vacant square가 될 때
n move
= (n-1) move -> transfer (nth move는 transfer와 동일)
= (n-2) interchange (by 규칙 4)
2019-01-02 15
16. `
nth move 후에 blank square가 vacant square가 될 때 n은 항상 짝수이다
• 퍼즐의 각 칸에 교대로 검은색과 흰색을 칠했을 경우 검은 칸에서는 흰
칸으로만, 흰 칸에서는 검은 칸으로만 움직일 수 있다
• 처음에 vacant square가 검은 칸이었을 경우, n move 후에 다시 검은 칸
이 되기 위해서는 n이 짝수여야 한다. vacant square가 처음에 흰 칸인
경우도 마찬가지다.
규칙 6
2019-01-02 16
18. `
규칙 5에 의해 정답 상태에서 n move 후 다시 blank square가 vacant square로 되기 위해서는
n개의 interchange가 필요하다. 또한 규칙 6에 따라 n은 짝수여야 한다. 따라서 정답 상태로부
터 홀수개의 interchange를 필요로 하고 blank가 square인 상태로 갈 수 없다. 그리고 그 상태
에서 갈 수 있는 다른 상태들 또한 갈 수 없다. 이렇게 N-Puzzle의 모든 상태는 두가지 class로
나뉜다
증명
2019-01-02 18
19. `
현재 상태가 정답 상태로 변환할 수 있는지 어떻게 알 수 있을까?
1. 현재 상태 => blank square가 vacant square인 상태로 변환
2. interchange 개수 새기
의문
2019-01-02 19
22. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1
2019-01-02 22
23. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8
2019-01-02 23
24. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2
2019-01-02 24
25. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3
2019-01-02 25
26. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1)
2019-01-02 26
27. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4
2019-01-02 27
28. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4
2019-01-02 28
29. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4
2019-01-02 29
30. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)(6)
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)
2019-01-02 30
31. `
set = {1, 2, … , n}
while set exist {
pop s from set
create cycle and add s
x = value under row1 at s
while s != x {
add x to cycle
x = val under row1 at x}
close cycle}
2. Interchange 수 세기
• Cycle로 분할
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)(6)(7)
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)(6)
1 2 3 4 5 6 7 8
8 3 1 5 4 6 7 2
1 8 2 3 1) 4 5)
2019-01-02 31
32. `
2. Interchange 수 세기
• Cycle로 분할
1 2 3 8
8 2 3 1
8 1 3 2
8 3 1 2
4 5
5 4
6
6
7
7
1 <-> 8
1 <-> 2
1 <-> 3 4 <-> 5
no interchange no interchange
Total 4 cycles, 4 interchanges
2019-01-02 32
33. `
• 길이가 n인 permutation을 m 개의 사이클 c1, c2, … , cm 으로 분할
• 사이클 ck 의 길이를 lk라 할 때 각 사이클은 lk − 1 interchange 가능
• 전체 interchange 수 = 각 cycle interchang수 = lk − 1 = 𝑛 − 𝑚
• n – m 이 짝수일때 변환 가능!
2. Interchange 수 세기
2019-01-02 33
34. `
더 쉬운 방법
• 모든 move는 vacant square의 taxicab distance와 permutation의 cycle 수를
1씩 바꾼다
• 따라서 taxicab distance와 cycle 수의 합의 parity는 불변
2019-01-02 34
36. `
• 현대대수학
• Archer, Aaron F. (1999), "A modern treatment of the 15 puzzle
", The American Mathematical Monthly
• Wilson, Richard M. (1974), "Graph puzzles, homotopy, and the
alternating group", Journal of Combinatorial Theory, Series B, 16:
86–96
후속 공부
2019-01-02 36
37. `
• Johnson, Wm. Woolsey; Story, William E. (1879), "Notes on the "15" Puzzle", American
Journal of Mathematics, The Johns Hopkins University Press, 2 (4): 397–404
• https://en.wikipedia.org/wiki/15_puzzle
• https://en.wikipedia.org/wiki/Permutation
• https://en.wikipedia.org/wiki/Parity_of_a_permutation
참조
2019-01-02 37