Breakpoints Proof

Given permutations π and σ, a breakpoint between π and σ is defined as a pair of adjacent elements πi and πi+1 in π that are separated in σ. For example, if π = 143256 and σ = 123465, then π1 = 1 and π2= 4 in π form a breakpoint between π and σ since 1 and 4 are separated in σ. The number of breakpoints between π=01432567 and σ=01234567 is three (14, 25 and 67), while the number of breakpoints between σ and π is also three (12, 46 and 57).

Prove that the number of breakpoints between π and σ equals the number of breakpoints between σ and π.

Suppose there are n characters in π and σ. There are exactly n-1 adjacent pairs in them:

(π1, π2), (π2, π3), … , (πn-1, πn) with total of n-1 pairs, and same for σ1 to σn.

Between π and σ, the number of breakpoints are number of pairs of (πi, πi+1) do not exist in all possible (σj, σj+1) or (σj, σj-1). Assume there are k (k < n-1) breakpoints. That is the same as saying among n-1 adjacent pairs, there are k pairs found in π but not found in σ. However, it also means there are n-1-k pairs both found in π and σ. With this knowledge, we can look at the number of breakpoints between σ and π.

There are also n-1 adjacent pairs in (σ1, σ2), (σ2, σ3), … , (σn-1, σn). We know that n-1-k pairs are found in both π and σ. That leaves the number of breakpoints between σ and π: (n-1) – (n-1-k) = k. Therefore number of breakpoints between π and σ equals the number of breakpoints between σ and π.

今天被 TA 叫上台解說我怎麼解這題的,當場其實有點囧。都一個禮拜前的事情,忽然間要我解釋我寫了甚麼我怎麼可能記得 XD

Tags:

One Response to “Breakpoints Proof”

  1. Tiff Says:

    Is this site for people to post homework answer? =)

Leave a Reply

All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh