Remember that represents the set of all permutations of {1, 2,... n}

Similar documents
17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

Ma/CS 6a Class 16: Permutations

Math 127: Equivalence Relations

The Problem. Tom Davis December 19, 2016

Permutations. Example : let be defned by and let be defned by

Chapter 6.1. Cycles in Permutations

Permutation Groups. Definition and Notation

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

An Intuitive Approach to Groups

EXPLAINING THE SHAPE OF RSK

Lesson 16: The Computation of the Slope of a Non Vertical Line

Permutations. = f 1 f = I A

MA 524 Midterm Solutions October 16, 2018

Determinants, Part 1

Practice Midterm 2 Solutions

Launchpad Maths. Arithmetic II

COUNTING AND PROBABILITY

Solving Equations and Graphing

Chapter 1 out of 37 from Discrete Mathematics for Neophytes: Number Theory, Probability, Algorithms, and Other Stuff by J. M. Cargal.

Grade 7/8 Math Circles. Visual Group Theory

1.6 Congruence Modulo m

CIS 2033 Lecture 6, Spring 2017

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors.

It is important that you show your work. The total value of this test is 220 points.

Combinations and Permutations

ECS 20 (Spring 2013) Phillip Rogaway Lecture 1

Grade 7/8 Math Circles. Visual Group Theory

Solution: This is sampling without repetition and order matters. Therefore

Section 2.1 Factors and Multiples

CS 202, section 2 Final Exam 13 December Pledge: Signature:

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

X = {1, 2,...,n} n 1f 2f 3f... nf

2 Logic Gates THE INVERTER. A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs.

MAT Modular arithmetic and number theory. Modular arithmetic

Distribution of Primes

CLASS NOTES. A mathematical proof is an argument which convinces other people that something is true.

Quotients of the Malvenuto-Reutenauer algebra and permutation enumeration

LECTURE 8: DETERMINANTS AND PERMUTATIONS

Solutions to Exercises Chapter 6: Latin squares and SDRs

Combinatorics and Intuitive Probability

5 Symmetric and alternating groups

Introduction to Combinatorial Mathematics

Three of these grids share a property that the other three do not. Can you find such a property? + mod

MA10103: Foundation Mathematics I. Lecture Notes Week 3

Compound Probability. Set Theory. Basic Definitions

MA/CSSE 473 Day 9. The algorithm (modified) N 1

CS103 Handout 22 Fall 2017 October 16, 2017 Practice Midterm Exam 2

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

The Math Behind Futurama: The Prisoner of Benda

Modular Arithmetic. Kieran Cooney - February 18, 2016

Econ 172A - Slides from Lecture 18

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

SMT 2014 Advanced Topics Test Solutions February 15, 2014

Public Key Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Card-Based Protocols for Securely Computing the Conjunction of Multiple Variables

Laboratory 1: Uncertainty Analysis

Lecture 2.3: Symmetric and alternating groups

CPM EDUCATIONAL PROGRAM

Dyck paths, standard Young tableaux, and pattern avoiding permutations

Massachusetts Institute of Technology 6.042J/18.062J, Spring 04: Mathematics for Computer Science April 16 Prof. Albert R. Meyer and Dr.

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Counting Cube Colorings with the Cauchy-Frobenius Formula and Further Friday Fun

The mathematics of the flip and horseshoe shuffles

Latin Squares for Elementary and Middle Grades

arxiv: v1 [cs.cc] 21 Jun 2017

A NEW COMPUTATION OF THE CODIMENSION SEQUENCE OF THE GRASSMANN ALGEBRA

LINEAR EQUATIONS IN TWO VARIABLES

The Sign of a Permutation Matt Baker

Developing Algebraic Thinking

THE 15-PUZZLE (AND RUBIK S CUBE)

Crossing Game Strategies

Greedy Flipping of Pancakes and Burnt Pancakes

SMT 2013 Advanced Topics Test Solutions February 2, 2013

Single Error Correcting Codes (SECC) 6.02 Spring 2011 Lecture #9. Checking the parity. Using the Syndrome to Correct Errors

AL-JABAR. Concepts. A Mathematical Game of Strategy. Robert P. Schneider and Cyrus Hettle University of Kentucky

Adventures with Rubik s UFO. Bill Higgins Wittenberg University

Generating trees and pattern avoidance in alternating permutations

Principle of Inclusion-Exclusion Notes

MAT points Impact on Course Grade: approximately 10%

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

GLOSSARY. a * (b * c) = (a * b) * c. A property of operations. An operation * is called associative if:

Analysis on the Properties of a Permutation Group

On uniquely k-determined permutations

MATH 351 Fall 2009 Homework 1 Due: Wednesday, September 30

GRADE 3 TEKS ALIGNMENT CHART

28,800 Extremely Magic 5 5 Squares Arthur Holshouser. Harold Reiter.

Updated December Year. Small Steps Guidance and Examples. Block 4: Multiplication & Division

Topspin: Oval-Track Puzzle, Taking Apart The Topspin One Tile At A Time

Rotational Puzzles on Graphs

Permutations and Combinations

Error Detection and Correction

Content Area: Mathematics- 3 rd Grade

ACTIVITY 6.7 Selecting and Rearranging Things

Coding for Efficiency

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

PERMUTATIONS - II JUNIOR CIRCLE 11/17/2013

The mathematics of the flip and horseshoe shuffles

You ve seen them played in coffee shops, on planes, and

6.2 Modular Arithmetic

Transcription:

20180918 Remember that represents the set of all permutations of {1, 2,... n} There are some basic facts about that we need to have in hand: 1. Closure: If and then 2. Associativity: If and and then 3. Identity Element: There is a permutation such that 4. Inverse: If then and Property 1 says that the composition of two permutations is another permutation. This sounds trivial but it is our frst look at a very important concept: closure. When we apply an operation to two elements of a set and always get another element of the same set, we say that set is closed under that operation. Not all sets are closed under all operations. For example, is not closed under the operation of subtraction (for instance, and, but, which is not in ). However is closed under addition and multiplication. This concept is vital to us as computer scientists because we frequently work with strongly typed programming languages, where each variable has a specifc type that cannot change. If we are dealing with integer variables, we need to be sure the operations we perform will only produce integer values. Property 2 is called the associative property. It says that if we are composing a sequence of permutations we can group them with parentheses in diferent ways without changing the result. We will see an application of this later in these notes. Property 3 asserts that the identity permutation can be composed with any permutation without changing it. Once again, we can draw a parallel to other sets and operations. For example, in the set and the operation of multiplication, we know that Property 4 asserts that every permutation has an inverse. This property is also true for some sets and operations but not all. For example, in the set and the operation of addition, the

identity element is 0 and every element has an inverse (for instance, the inverse of 7 is -7). However in the set and the operation of addition, the identity element is still 0 but the nonzero values do not have inverses (for instance there is no integer such that ). Property 4 is particularly important when we use permutations in cryptography there s not much point encoding information with a permutation if there is not some other permutation that will do the decoding. Each of these properties follows from the defnition of permutations and the properties of functions. I recommend that you do some examples and convince yourself that these are true. (Side note: A set and an operation that satisfy these four properties are called a group. Group theory is one of the most important branches of mathematics, with applications in communications, theoretical physics, applied physics, biology, chemistry, robotics and many other felds. We don t have time in CISC-203 to explore this topic but I encourage you to spend some time looking into it.) Note that there is property possessed by many operations that is not true of the composition of permutations: commutativity. Commutativity holds when we can switch the left-to-right order of the operands without changing the result. For example, when we are multiplying integers, we know that... and the same is true for addition. Not all operations are commutative. For example, subtraction is not commutative: except when Composition of permutations is not commutative. In general, we will see some special cases where they are equal.... although In class I posed a challenge: given permutations and in, can you always fnd a permutation such that?

The answer is yes. Here s how: we can solve this equation for in much the same way as we would solve an equation involving numbers... we just try to get by itself on one side. (What I mean is, if we are asked to solve we isolate the by adding to both sides getting, which simplifes to, and fnally. But here the only operation we have is composition. So what can we do with composition to get rid of the on the left side? Well, remember that... and So we can start with (in which and are known, and is the unknown) and apply the following operations that maintain equality and we are done! It s exactly the same process as solving for in It s easy to check that this is correct. If we take and replace by we get which equals which equals which equals Cycle Notation for Permutations Now we introduce another representation for permutations... one that makes it possible to work with permutations very easily. Consider this permutation: What happens if we imagine composing with itself? Let s trace what happens to the element 1. We are going to apply twice: the frst application maps 1 to 4, and the second

application maps that 4 to 2. If we compose with again, that 2 is mapped back to 1. Treating as a function, we see,, and (It is traditional to write as and as etc.) Composing with even more times will cycle through 4 then 2 then 1 then 4 then 2 then 1 etc. We can write this behaviour as etc. If we trace what happens to 2 when we repeatedly compose with itself and apply the resulting function to 2, we see exactly the same pattern : etc. The same thing happens if we start with 4 and trace what happens to it when we repeatedly compose with itself and apply the resulting function to 4: we get the pattern 4 etc So in this sense, 1, 4 and 2 form a cycle: 1 goes to 4, 4 goes to 2, and 2 goes to 1. We write this cycle as (1, 4, 2) - it is a notational device that describes the three ordered pairs (1,4),(4,2), (2,1) which belong to What about the rest of? Since we have dealt with 1, 2 and 4, let s see what happens to 3. Following the same analysis as we did for 1, 2 and 4 (but skipping over some of the details) we see this pattern: etc. which we write as (3, 5, 7, 6). Again we can see that this is a non-ambiguous shorthand way to represent the four ordered pairs (3,5), (5,7), (7,6), (6,3) that make up the rest of Thus we can express the entire defnition of with the two cycles (1,4,2)(3,5,7,6) - we call this the cycle notation for All of the information that defnes is there, expressed in a diferent way (in other words, we can reconstruct the standard representation from the cycle notation). Notice that from each permutation, we can only get one cycle notation version. (We saw this for above: no matter which elements we start with, we always get the same repeating patterns for 1, 4 and 2, and for 3, 5, 7, and 6.) Similarly, from any cycle notation representation, we can only reconstruct one permutation in standard notation. This means that the cycle notation for each permutation is unique (up to changing the order of the cycles, because (1,4,2)(3,5,7,6) gives the same information as (3,5,7,6)(1,4,2) and up to rotating the elements within each cycle, since (1,4,2) and (4,2,1) and (2,1,4) all represent the same information). We can also extract the cycle notation for a permutation without going through the efort of composing with itself over and over. We can just build the cycles directly from by observing 1 goes to 4, 4 goes to 2, and 2 goes to 1 to get the cycle (1, 4, 2). Then we can say What happens to 3? and observe 3 goes to 5, 5 goes to 7, 7 goes to 6, and 6 goes to 3 to get

the cycle (3, 5, 7, 6). We can also represent the permutation by a diagram with each ordered pair represented by an arrow. This is what we did in class. The diagram for looks like this: This is as far as we got on Tuesday, but there were a couple of other things to say about permutations in cycle notation. I m including them here, and I will present them in class on Thursday. So what can we do with a permutation expressed in cycle notation? Computing the Inverse of a Permutation in Cycle Notation Suppose we have a permutation and we need to compute. We could do it from standard representation... For example, consider To compute, we could see that

4 is in the frst position, so the ordered pair (1,4) must be in... which means the ordered pair (4,1) must be in. Similarly, 2 is in the fourth position, so the ordered pair (4,2) is in, so (2,4) must be in, and so on... it s not that hard but it s a bit tedious. But with the permutation expressed in cycle notation, computing is trivially easy: we just reverse each cycle. So the inverse of (1,4,2)(3,5,7,6) is simply (2,4,1)(6,7,5,3). You can check the details of this example to confrm that it works, but the logic of it is pretty straightforward: contains the ordered pair (1,4) this is encoded in the frst cycle, so must contain the ordered pair (4,1) and this is encoded in the reverse of the frst cycle. Note that reversing a cycle is very diferent from rotating a cycle: the cycles (a, b, c, d) and (c, d, a, b) represent exactly the same information, but (d, c, b, a) represents the inverse. Composition of Two Permutations in Cycle Notation Now suppose we have two permutations and and we want to compute. (Remember, this means the permutation that results when we apply, then apply ) Once again cycle notation makes this very easy, and an example will show how this is done. Let s use and. In cycle notation, = (1,4,2)(3,5,6,7) and = (1,4)(2,7)(3,6)(5) - you should check this. (Why is 5 all by itself in? Because maps 5 to itself... 5 forms a cycle of length 1.) We can build the cycle notation for as follows: Start with 1. Apply to it, giving 4 (that is to say ). Then apply to that 4, giving 2 (that is, ). So in, we see that 1 2 (that is, ). So our frst cycle in starts (1, 2...) Now let s see what does to 2. takes 2 to 7, and takes 7 to 6. So. So our cycle in now looks like (1, 2, 6...) Now let s see what does with 6. takes 6 to 3 and takes 3 to 5, so. The cycle in we are building now looks like (1, 2, 6, 5...)

Following the same steps we see that. Then we discover that So we have discovered that in, is a cycle, and in cycle notation this is (1,2,6,5,7) We still haven t dealt with 3 and 4. It doesn t matter which we start with, so let s start with 4. and, so. In cycle notation this is just (4) You can verify for yourself that, giving (3) as the last cycle in Putting all the cycles together, we get = (1,2,6,5,7)(4)(3) You should check this too! Shorthand Notation for Cycles When using cycle notation, sometimes we leave out the cycles of length 1. This can be ambiguous unless we know we are dealing with permutations from a particular In the previous example, if we specify that and are in then we can write and just leave out the (4) and (3). The reader will know they are cycles of length 1 because if they weren t we would have included them.

****** Bonus Material For Those Who Just Can t Say No to Permutations ****** This material will not be on any of our tests, but I hope some members of the class will fnd it interesting. Consider these permutations of {1,2,3,4,5,6,7,8}: and When we put these into cycle notation, we get and They look very diferent... and yet in a certain sense they are identical! Each has two cycles of length 3 and a single cycle of length 2. Their essential structure is the same we have just re-labelled the elements. Compare this to the permutation It s clear that has a fundamentally diferent structure from and. And what can we do with this? We can defne an equivalence relation on permutations! For permutations and, both in, we can say if and have the same cycle structure. It should be clear that is reflexive, symmetric and transitive. Now we can ask questions about this equivalence relation. For example, how many equivalence classes are there for? We can answer this by looking at the number of diferent cycle structures. Let s consider permutations of [1 2 3]. The cycle structure of a permutation of this set must be either (...) - a single cycle containing all three values, or (.)(..) - a cycle of length 1 and a cycle of length 2, or (.)(.)(.) - three cycles of length 1 (there is only one permutation with this structure : ) and this means that in a very real sense, there are only 3 ways to permute a set with 3 elements.

Now consider permutations of [1 2 3 4]. The possible cycle structures are (....) (.)(...) (.)(.)(..) (..)(..) (.)(.)(.)(.) so there are 5 ways to permute a set with 4 elements. Unfortunately there is no simple formula to compute the number of equivalence classes of for arbitrary values of n (there is a formula but it s not simple). It turns out that these are known as partition numbers. Wikipedia has a good article about them : https://en.wikipedia.org/wiki/partition((number(theory). We can also use the cycle representation to prove this claim: Let be a permutation. Then there exists a positive integer such that Proof: Suppose contains a cycle c of length t. where x is any positive multiple of t will restore the elements of c to their natural positions. Thus if contains cycles with lengths in the set then