人工智能教程 - 數學基礎課程1.5 - 離散數學-3-5 不變式,第二數學歸納法

不變式和第二數學歸納法

Good proofs are:
  • correct
  • complete
  • clear
  • brief
  • elegant
  • well-organized
  • inorder

introduction:

Legal Move:slide a letter into adjacent square?

A B C
D E F
H G

to

A B C
D E F
G H

Thm:
there is no sequence of legal moves to invert G &H and return all other letters to original position

不變式(invariant)

引理一:(Lemma1)

橫向移動不改變字母的相對順序。

A row move does not change the order

Proof: In a row move, we move an item from cell i into an adjacent cell i-1 or i+1 .Nothing else moves.Hence the order of items is preserved.\square

引理二:(Lemma2)

A column move changes the relative order of precisely 2 pairs of items

Proof: In a column move, we move an item from cell i into an blank spot i-3 or i+3 .
When an item moves three positions,It changes relative order with two other items.(i-1,i-2 or i+1,i+2)\square

Def:一對字母,記作L1和L2,他們表示兩個顛倒的字母,叫做一對逆序。也就是如果字母表中L1在L2前面,那麼在拼圖中L2會出現在L1後面。

(A pair of letters of items,call L1 and L2.they form an inversion,also known as an inverted pair,if L1 precedes L2 in the alphabet,but L1 appears after L2 in the puzzle)

A B C
D E F
H G

1 inversion

to

A B C
D E F
G H

0 inversion

conclusion: 1 inversion can never get 0 inversion

引理三:(Lemma3)

在一次移動中,逆序對的數量一次只能增加或者減少兩個或者保持不變。

during a move,the number of inversion can only increase by two ,decrease by two or stay same.

Pf:
Row move : no changes (by lemma1)
column move: 2 pairs change order(by lemma2)

A. both pairs were inorder\Rightarrowinversions ↑2
B. both pairs were inverted\Rightarrowinversions ↓2
C. one pair was inverted\Rightarrowinversions stays same

推論:(corollary)

在一次移動中,奇偶性(的意思是偶數和奇數)。逆序對的數量的奇偶性不會改變。

during a move,the parity ( even/odd)and the oddness of the number of inversions dose not change.

Pf:
加上或者減去2不會改變它的奇偶性
adding or subtracting 2does not change the pairty.

引理四:(Lemma4)

在可以達到的狀態中(即可達狀態),從

in every state or configuration reachable from

A B C
D E F
H G

逆序對的數量會保持爲奇數。

the parity of the number of inversions is odd

Pf: by induction.
P(n):After any sequence of n moves from

A B C
D E F
H G

Base Case:
n = 0 haven’t move.#inversions = 1 \Rightarrow pairty is odd.\square

Inductive Step:
For n\geq 0 show P(n)\RightarrowP(n+1)
Consider any sequence of n+1 moves M1,...,Mn+1M_1,...,M_{n+1}

By I.H(P(n)),we know that the parity after moves M1,...,MnM_1,...,M_{n} is odd
By corl 1,we know parity of #inversions does not change during Mn+1M_{n+1}\Rightarrow the pairty afterM1,M2,...,Mn,Mn+1M_1,M_2,...,M_{n},M_{n+1} is odd\RightarrowP(n+1)

Thm:
there is no sequence of legal moves to invert G &H and return all other letters to original position

Pf of Thm:
The pairty of #inversions in desired state is even(0).By lemma 4 ,the desired state can not be reached from the start state ,because its parity is odd.that cannot be reached form

A B C
D E F
H G

\square

第二數學歸納法

(Strong Induction Axiom)

Let P(n) be any precticate.If P(0) is true & (P(0)P(1)...P(n))P(n+1)(P(0)\wedge P(1)\wedge...\wedge P(n))\Rightarrow P(n+1) is true,then nP(n)\forall nP(n) is true

Unstacking Game example

數論Number theory

study of the integers 0,1,2,3…
Def: m | a(m divides a) a能被m整除
if k\exists k a=km
3 | 6 a=0=0.m m|0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章