ma/cs 6a2015-16/1term/ma006a/17. more...11/5/2015 3 the 15 puzzle and permutations how a...

15
11/5/2015 1 Ma/CS 6 a Class 17: More Permutations By Adam Sheffer 1 2 1 โ€ฆ 1 2 1 โ€ฆ Reminder: The Permutation Set โ€“ The set of permutations of โ„• = 1,2,3, โ€ฆ , . The set 3 : 1 2 3 โ†“ โ†“ โ†“ 1 2 3 1 2 3 โ†“ โ†“ โ†“ 1 3 2 1 2 3 โ†“ โ†“ โ†“ 2 1 3 1 2 3 โ†“ โ†“ โ†“ 2 3 1 1 2 3 โ†“ โ†“ โ†“ 3 1 2 1 2 3 โ†“ โ†“ โ†“ 3 2 1

Upload: others

Post on 27-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

1

Ma/CS 6aClass 17: More Permutations

By Adam Sheffer

๐‘Ž

๐‘ฅ1

๐‘ฅ2

๐‘ฅ๐‘Ÿ๐‘

๐‘ฆ1

๐‘ฆ๐‘ 

โ€ฆ

๐‘Ž

๐‘

๐‘ฅ1

๐‘ฅ2

๐‘ฅ๐‘Ÿ๐‘

๐‘ฆ1

๐‘ฆ๐‘ 

โ€ฆ

๐‘Ž

Reminder: The Permutation Set ๐‘†๐‘›

๐‘†๐‘› โ€“ The set of permutations of โ„•๐‘› = 1,2,3, โ€ฆ , ๐‘› .

The set ๐‘†3:

1 2 3โ†“ โ†“ โ†“1 2 3

1 2 3โ†“ โ†“ โ†“1 3 2

1 2 3โ†“ โ†“ โ†“2 1 3

1 2 3โ†“ โ†“ โ†“2 3 1

1 2 3โ†“ โ†“ โ†“3 1 2

1 2 3โ†“ โ†“ โ†“3 2 1

Page 2: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

2

Reminder: Cycle Notation

We can consider a permutation as a set of cycles.

1 2 3โ†“ โ†“ โ†“5 6 3

4 5 6โ†“ โ†“ โ†“2 1 4

1 โ†’ 5 2 โ†’ 6 โ†’ 4 3

We write this permutation as1 5 2 6 4 3 .

Reminder: Classification of Permutations

Both (1 2 4)(3 5) and (1 2 3)(4 5) are of the same type: one cycle of length 3 and one of length 2.

โ—ฆ We denote this type as 2 3

In general, we write a type as 1๐›ผ12๐›ผ23๐›ผ34๐›ผ4 โ€ฆ .

Page 3: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

3

The 15 Puzzle and Permutations

How a configuration of the puzzle can be described as a permutation?

โ—ฆ Denote the missing tile as 16.

โ—ฆ The board below corresponds to the permutation

1 16 3 4 6 2 11 10 5 8 7 9 14 12 15 13

The 15 Puzzle Revisited

What kind of permutations describe a move in the 15 Puzzle?

โ—ฆ Permutations that switch 16 with an element that was adjacent to it.

Page 4: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

4

Transpositions

Transposition: a permutation that interchanges two elements and leaves the rest unchanged.

โ—ฆ 1 3 5 2 4

1 2 3 4 5

1 4 3 2 5

Decomposing a Cycle

Problem. Write the cycle (1 2 3) as a composition of transpositions.

1 2 3

2 1 3

2 3 1

(1 2)(3)

(1 3)(2)

1 2 3 = 1 3 1 2

Page 5: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

5

Decomposing a Cycle (2)

Problem. Write the cycle (๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘˜) as a composition of transpositions.

๐‘ฅ1 ๐‘ฅ2 ๐‘ฅ3 โ€ฆ ๐‘ฅ๐‘˜

(๐‘ฅ1 ๐‘ฅ2)

๐‘ฅ2 ๐‘ฅ1 ๐‘ฅ3 โ€ฆ ๐‘ฅ๐‘˜

(๐‘ฅ1 ๐‘ฅ3)

๐‘ฅ2 ๐‘ฅ3 ๐‘ฅ1 โ€ฆ ๐‘ฅ๐‘˜

๐‘ฅ2 ๐‘ฅ3 ๐‘ฅ4 โ€ฆ ๐‘ฅ1

๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘˜ =๐‘ฅ1 ๐‘ฅ๐‘˜ ๐‘ฅ1 ๐‘ฅ๐‘˜โˆ’1 โ‹ฏ ๐‘ฅ1 ๐‘ฅ2

Decomposing a Permutation

Problem. Can every permutation be written as a composition of transpositions?

Yes! Write the permutation in its cycle notation and decompose each cycle.

1 3 6 2 4 5 7= 1 6 1 3 2 7 2 5 2 4

Page 6: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

6

Unique Representation?

Problem. Does every permutation have a unique decomposition into transpositions (up to their order)?

1 2 3 4 5 6 :

โ—ฆ 1 3 1 2 4 6 4 5 .

โ—ฆ 1 4 1 6 1 5 3 4 2 4 1 4 .

โ—ฆ No. But the different decompositions of a permutation have a common property.

Composing a Permutation with a Transposition Problem.

โ—ฆ ๐›ผ โ€“ a permutation of ๐‘†๐‘› that consists of ๐‘cycles in its cycle notation.

โ—ฆ ๐œ โ€“ a transposition of ๐‘†๐‘›.

โ—ฆ What can we say about the number of cycles in ๐œ๐›ผ? And of ๐›ผ๐œ?

Page 7: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

7

Solution: Case 1

Write ๐œ = ๐‘Ž ๐‘ .

First, assume that ๐‘Ž, ๐‘ are in the same cycle of ๐›ผ.

โ—ฆ Write the cycle as๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿ ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  .

โ—ฆ Then ๐œ๐›ผ contains the cycles ๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿand ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  (and similarly for ๐›ผ๐œ).

๐‘Ž ๐‘ฅ1 โ€ฆโ†“ โ†“ โ†“๐‘ฅ1 ๐‘ฅ2 โ€ฆ

๐‘ฅ๐‘Ÿ ๐‘ ๐‘ฆ1โ†“ โ†“ โ†“๐‘Ž ๐‘ฆ1 ๐‘ฆ2

โ€ฆ ๐‘ฆ๐‘ โ†“ โ†“โ€ฆ ๐‘

Solution: Case 1

Write ๐œ = ๐‘Ž ๐‘ .

First, assume that ๐‘Ž, ๐‘ are in the same cycle of ๐›ผ.

โ—ฆ Write the cycle as๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿ ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  .

โ—ฆ Then ๐œ๐›ผ contains the cycles ๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿand ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  (and similarly for ๐›ผ๐œ).

๐‘Ž

๐‘ฅ1

๐‘ฅ2

๐‘ฅ๐‘Ÿ๐‘

๐‘ฆ1

๐‘ฆ๐‘ 

โ€ฆ

๐‘Ž

๐‘

๐‘ฅ1

๐‘ฅ2

๐‘ฅ๐‘Ÿ๐‘

๐‘ฆ1

๐‘ฆ๐‘ 

โ€ฆ

๐‘Ž

Page 8: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

8

Solution: Case 2

Write ๐œ = ๐‘Ž ๐‘ .

Assume that ๐‘Ž and ๐‘ are in different cycles of ๐›ผ.

โ—ฆ Write the cycles as ๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿ and ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  .

โ—ฆ Then ๐œ๐›ผ contains the cycle ๐‘Ž ๐‘ฅ1 ๐‘ฅ2 โ€ฆ ๐‘ฅ๐‘Ÿ ๐‘ ๐‘ฆ1 ๐‘ฆ2 โ€ฆ๐‘ฆ๐‘  .

๐‘Ž ๐‘ฅ1 โ€ฆโ†“ โ†“ โ†“๐‘ฅ1 ๐‘ฅ2 โ€ฆ

๐‘ฅ๐‘Ÿ ๐‘ ๐‘ฆ1โ†“ โ†“ โ†“๐‘ ๐‘ฆ1 ๐‘ฆ2

โ€ฆ ๐‘ฆ๐‘ โ†“ โ†“โ€ฆ ๐‘Ž

Solution

๐›ผ โ€“ a permutation of ๐‘†๐‘› that consists of ๐‘cycles in its cycle notation.

๐œ โ€“ a transposition of ๐‘†๐‘›.

The number of cycles in ๐œ๐›ผ (or ๐›ผ๐œ) is either ๐‘ + 1 or ๐‘ โˆ’ 1.

Page 9: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

9

Parity of a Permutation

Theorem. Consider a permutation ๐›ผ โˆˆ ๐‘†๐‘›. Then

โ—ฆ Either every decomposition of ๐›ผ into transpos. consists of an even number of elements,

โ—ฆ or every such decomposition consists of an odd number of elements.

1 2 3 4 5 6 :

โ—ฆ 1 3 1 2 4 6 4 5 .

โ—ฆ 1 4 1 6 1 5 3 4 2 4 1 4 .

Proof

๐‘ โ€“ the number of cycles in ๐›ผ.

(WLOG) Assume that ๐‘› is even.

Consider a decomposition ๐›ผ = ๐œ1๐œ2โ‹ฏ๐œ๐‘˜.

โ—ฆ The number of cycles in the cycle structure of ๐œ๐‘˜ is ๐‘› โˆ’ 1.

โ—ฆ The number of cycles in ๐œ๐‘˜โˆ’1๐œ๐‘˜ is even.

โ—ฆ The number of cycles in ๐œ๐‘˜โˆ’2๐œ๐‘˜โˆ’1๐œ๐‘˜ is odd.

โ—ฆ โ€ฆ

โ—ฆ The number of cycles in ๐œ1๐œ2โ‹ฏ๐œ๐‘˜ is ๐‘.

Thus, ๐‘˜ has the same parity as ๐‘.

Page 10: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

10

Even and Odd Permutations

We say that a permutation is even or oddaccording to the parity of the number of transpositions in its decompositions.

Finding the Parity

What is the parity of

Cycle notation: 1 2 3 4 5 6 7 8 9 .

We saw that a cycle of length ๐‘˜ can be expressed as composition of ๐‘˜ โˆ’ 1transpositions.

โ—ฆ 8 transpositions = even.

1 2 3โ†“ โ†“ โ†“2 3 4

4 5 6โ†“ โ†“ โ†“5 6 7

7 8 9โ†“ โ†“ โ†“8 9 1

Page 11: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

11

Parity of Inverse

Problem. Prove that any permutation ๐›ผ โˆˆ ๐‘†๐‘› has the same parity as its inverse ๐›ผโˆ’1.

Proof.

โ—ฆ Decompose ๐›ผ into transpositions ๐œ1๐œ2โ‹ฏ๐œ๐‘˜.

โ—ฆ We have ๐›ผโˆ’1 = ๐œ๐‘˜โ‹ฏ๐œ2๐œ1, since the product of these two permutation is obviously id.

The 15 Puzzle

Problem. Start with the configuration on the left and move the tiles to obtain the configuration on the right.

Page 12: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

12

Solution (Finally!)

The number of moves is even since

โ—ฆ For every time that we move the empty tile left/up, we must move it back right/down.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Even permutation 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 16

Odd permutation

Solution (Finally!)

The number of moves/ transpositions is even.

To move from an even transposition to an oddone, there must be an odd number of transpositions.

Even permutationOdd permutation

Page 13: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

13

Even and Odd Permutations of ๐‘†5

Type Example Number

15 id 1

132 1 2 (3)(4)(5) 10

123 (1 2 3)(4)(5) 20

122 1 2 (3 4)(5) 15

14 1 2 3 4 5 30

23 1 2 3 4 5 20

5 1 2 3 4 5 24

Even

OddEven

Even

Odd

OddEven

Even: 60 Odd: 60

Even and Odd Permutations of ๐‘†๐‘›

Theorem. For any integer ๐‘› โ‰ฅ 2, half of the permutations of ๐‘†๐‘› are even and halfare odd.

Page 14: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

14

Proof

๐œ โ€“ an arbitrary transposition of ๐‘†๐‘›.

If ๐›ผ โˆˆ ๐‘†๐‘› is even, then ๐œ๐›ผ is odd.

If ๐›ผ โˆˆ ๐‘†๐‘› is odd, then ๐œ๐›ผ is even.

For any ๐›ผ โˆˆ ๐‘†๐‘›, we have ๐œ๐œ๐›ผ = ๐›ผ.

๐œ defines a bijection between the set of even permutations of ๐‘†๐‘› and the set of odd permutations of ๐‘†๐‘›.

โ—ฆ Thus, the two sets are of the same size.

Example: The Bijection in ๐‘†3

Let ๐œ = 1 2 โˆˆ ๐‘†3.

1 2 3 1 2 31 2 3 1 2 33 2 1 1 3 2

Even Odd

1 2 1 3 = 1 2 3

Page 15: Ma/CS 6a2015-16/1term/ma006a/17. More...11/5/2015 3 The 15 Puzzle and Permutations How a configuration of the puzzle can be described as a permutation? Denote the missing tile as 16

11/5/2015

15

The End: The First Math Theorem Proved in a TV Script? The 10th episode of 6th season of the TV show

Futurama is about people switching bodies.

This is a permutation of people, and a property of the permutations is used as a plot twist!

You can also see a complete mathematical proof for a second.