The Math Behind Futurama: The Prisoner of Benda

Similar documents
The Futurama Theorem.

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

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

Lecture 3 Presentations and more Great Groups

MATH 433 Applied Algebra Lecture 12: Sign of a permutation (continued). Abstract groups.

Know how to represent permutations in the two rowed notation, and how to multiply permutations using this notation.

Ma/CS 6a Class 16: Permutations

Determinants, Part 1

Chapter 6.1. Cycles in Permutations

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

LECTURE 8: DETERMINANTS AND PERMUTATIONS

Permutations. = f 1 f = I A

Chapter 1. The alternating groups. 1.1 Introduction. 1.2 Permutations

Lecture 2.3: Symmetric and alternating groups

The Sign of a Permutation Matt Baker

Cardinality and Bijections

Permutation group and determinants. (Dated: September 19, 2018)

Equivalence classes of length-changing replacements of size-3 patterns

Math Lecture 2 Inverse Functions & Logarithms

REU 2006 Discrete Math Lecture 3

The Place of Group Theory in Decision-Making in Organizational Management A case of 16- Puzzle

5 Symmetric and alternating groups

Math236 Discrete Maths with Applications

Permutation Groups. Definition and Notation

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

Section II.9. Orbits, Cycles, and the Alternating Groups

Pattern Avoidance in Unimodal and V-unimodal Permutations

Week 3-4: Permutations and Combinations

Theory of Probability - Brett Bernstein

On Hultman Numbers. 1 Introduction

Lecture 2: Sum rule, partition method, difference method, bijection method, product rules

Computing and Communications 2. Information Theory -Channel Capacity

Counting Permutations by Putting Balls into Boxes

Domino Tilings of Aztec Diamonds, Baxter Permutations, and Snow Leopard Permutations

Section Summary. Permutations Combinations Combinatorial Proofs

Reading 14 : Counting

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

Factorization of permutation

7.4 Permutations and Combinations

THE SIGN OF A PERMUTATION

Solutions to Exercises Chapter 6: Latin squares and SDRs

Sample Spaces, Events, Probability

EXPLAINING THE SHAPE OF RSK

With Question/Answer Animations. Chapter 6

The mathematics of the flip and horseshoe shuffles

16 Alternating Groups

14.2 Limits and Continuity

Fermat s little theorem. RSA.

MA 524 Midterm Solutions October 16, 2018

A Cryptosystem Based on the Composition of Reversible Cellular Automata

On uniquely k-determined permutations

Module 3 Greedy Strategy

Section 7.2 Logarithmic Functions

FOURTEEN SPECIES OF SKEW HEXAGONS

Math 127: Equivalence Relations

Introductory Probability

Practice Midterm 2 Solutions

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Introduction to Computational Manifolds and Applications

Symmetric Permutations Avoiding Two Patterns

Weighted Polya Theorem. Solitaire

Sec$on Summary. Permutations Combinations Combinatorial Proofs

THE 15-PUZZLE (AND RUBIK S CUBE)

The mathematics of the flip and horseshoe shuffles

Chained Permutations. Dylan Heuer. North Dakota State University. July 26, 2018

Lecture 18 - Counting

PERMUTATIONS AS PRODUCT OF PARALLEL TRANSPOSITIONS *

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

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

Fifteen puzzle. Sasha Patotski. Cornell University November 16, 2015

Module 3 Greedy Strategy

To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we. The first (and most delicate) case concerns 2

In how many ways can we paint 6 rooms, choosing from 15 available colors? What if we want all rooms painted with different colors?

Exploiting the disjoint cycle decomposition in genome rearrangements

Self-Inverse Interleavers for Turbo Codes

Heuristic Search with Pre-Computed Databases

Pattern Avoidance in Poset Permutations

Dyck paths, standard Young tableaux, and pattern avoiding permutations

Orthomorphisms of Boolean Groups. Nichole Louise Schimanski. A dissertation submitted in partial fulfillment of the requirements for the degree of

The next several lectures will be concerned with probability theory. We will aim to make sense of statements such as the following:

SYMMETRIES OF FIBONACCI POINTS, MOD m

A NEW COMPUTATION OF THE CODIMENSION SEQUENCE OF THE GRASSMANN ALGEBRA

Quotients of the Malvenuto-Reutenauer algebra and permutation enumeration

SF2972: Game theory. Mark Voorneveld, February 2, 2015

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Algebra. Recap: Elements of Set Theory.

Equivalence Classes of Permutations Modulo Replacements Between 123 and Two-Integer Patterns

Honors Algebra 2 Assignment Sheet - Chapter 1

Permutations with short monotone subsequences

Lecture (06) Digital Coding techniques (II) Coverting Digital data to Digital Signals

Chapter 3 PRINCIPLE OF INCLUSION AND EXCLUSION

Gray code for permutations with a fixed number of cycles

MAT3707. Tutorial letter 202/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/202/1/2017

THE 15 PUZZLE AND TOPSPIN. Elizabeth Senac

baobabluna: the solution space of sorting by reversals Documentation Marília D. V. Braga

Asymptotic behaviour of permutations avoiding generalized patterns

Grade 7/8 Math Circles. Visual Group Theory

A Quick Introduction to Modular Arithmetic

Goldbach Conjecture (7 th june 1742)

November 6, Chapter 8: Probability: The Mathematics of Chance

Transcription:

of Benda May 7, 2013

The problem (informally) Professor Farnsworth has created a mind-switching machine that switches two bodies, but the switching can t be reversed using just those two bodies. Using this machine, some number of people got their bodies mixed up. Can we get all the minds back to their original bodies? If so, how?

An Introduction to Set Theory in 30 seconds Definition: A set is just a collection of objects we call elements. Whenever we mean a is an element of the set A, we denote it by a A as it makes the notation shorter. A simple example: We can list out all the set of all people whose bodies were switched like this, calling the set A: A = {Leela, Fry, Amy, Farnsworth, Bender, Washbucket,...}. But we can compactify this notation even more: if n people had their bodies switched, we can rename the people 1,..., n and then denote this set by A = {1, 2,..., n}.

Functions and Permutations Definitions: Given 2 sets X and Y, a function f from X to Y, which we often denote using the notation f : X Y, is a rule that assigns each element x of X to an element of Y we ll call f (x). A function f : X Y is called a bijection if the following two criteria hold: (1) For each y Y there exists an x X such that y = f (x) and (2) if for two elements x 1 and x 2 of X we have f (x 1 ) = f (x 2 ), then x 1 and x 2 are the same element. A bijection from a set X to itself is called a permutation on X.

An Example and Some Motivation Example: People and chairs Main point: The scrambling of minds and bodies in the episode can be thought of as a permutation/bijection on the set of people whose bodies were switched by Farnsworth s machine.

Binary operations Definition: A binary operation on a set X is a rule that assigns each ordered pair (x, y) of elements of X to a new element of X we call x y. Examples: +,, on the integers; function composition on the set of permutations f : X X.

Function composition Take a permutation f : X X and another permutation g : X X. We define a new function g f in the following way: To each x X, x is assigned to an element f (x) by the function f, and the element f (x) is assigned to an element g(f (x)) by the function g, and we call this element (g f )(x), which is in X. So, first we apply f to x, and then we apply g to that result, and this defines the element that f (x) gets sent to by our new function g f. Mnemonic: Function composition is done right to left.

Example of function composition Let R denote the set of real numbers (2, 1 3, π, etc.). Consider f : R R defined by f (x) = x 3 and g : R R defined by g(x) = x + 1. We have (f g)(x) = (x + 1) 3 and (g f )(x) = x 3 + 1 for each real number x. Consequence: In general, given two permutations f and g on a set X, f g g f.

Groups Definition: A group is a set G with binary operation such that (i) is an associate operation; that is, a (b c) = (a b) c (ii) there is an identity element with respect to ; that is, there exists some e G such that for all g G, e g = g e = g (iii) each element in G admits an inverse with respect to ; that, is for all g G, there exists a g 1 such that g g 1 = g 1 g = e Examples: The integers Z with respect to +, the nonzero fractions Q {0} with respect to

The Permutation Group Fact: The set of permutations on a set X, denoted S(X ), with binary operation (function composition) forms a group! Verification: (i) For all f, g, h S(X ) and for all x X, ((f g) h)(x) = (f g)(h(x)) = f (g(h(x))) and (f (g h))(x) = f ((g h)(x)) = f (g(h(x))). So, f (g h) = (f g) h for all f, g, h, and is associative. (ii) We have the identity permutation id X, and indeed, id X f = f id X = f for all f S(X ). (iii) Permutations are bijections and thus invertible. Given a permutation f, for any y X, there is a unique x X such that f (x) = y. Define a new permutation f 1 by setting f 1 (y) = x. Thus, f f 1 = f 1 f = id X.

Special notation for permutation groups on finite sets When X is a finite set with n elements, we rename the elements {1, 2,..., n} and call the resulting permutation group S n. Renaming a set doesn t change its permutation group. In S n, each permutation f can be identified with a matrix (box of ( numbers) like the following: ) 1 2 n f (1) f (2) f (n) With this, new notation, we compose permutations like this, right ( to left: ) ( ) 1 2 n 1 2 n = f (1) f (2) f (n) g(1) g(2) g(n) ( ) 1 2 n f g(1) f g(2) f g(n)

Examples and Notation for Transpositions Example: If I have a permutation on the set {1, 2, 3} that sends 1 to 2, 2 to ( 1, and 3 ) to itself, I write the permutation as 1 2 3 2 1 3 A permutation like this that just interchanges two elements is called a transposition. Special notation for transpositions: We ( denote 1 i 1 i i + 1 j 1 j j + 1 n 1 i 1 j i + 1 j 1 i j + 1 n by simply (i j). )

Examples of composition: ( 1 2 3 2 1 3 ) ( 1 2 3 2 3 1 ) = ( 1 2 3 1 3 2 ) while ( 1 2 3 2 3 1 ) ( 1 2 3 2 1 3 ) = ( 1 2 3 3 2 1 ) Moral: Order of composition almost always matters!

Cycles Transpositions are also called 2-cycles because they cycle through two elements. We can extend this notation to arbitrary lengths. So, for instance, on the set {1, 2, 3, 4, 5, 6}, an example of a cycle would be (2 5 3 1), which tells us 2 goes to 5, 5 goes to 3, 3 goes to 1, and 1 goes to 2 (and everything else doesn t move). Using our box notation, this is ( ) 1 2 3 4 5 6 2 5 1 4 3 6 Two cycles are called disjoint if they don t have any numbers in common, so (1 4 5) and (2 3 6 7) are disjoint, but (1 2 3) and (5 2 4 6) are not disjoint because 2 appears in both. It s easy to see that the order of composition doesn t matter for disjoint cycles because one cycle leaves everything involved in the other cycle unchanged.

An Important Theorem Theorem Any permutation on a finite set can be written as a composition of disjoint cycles. Example that gives the main idea of the proof ( 1 2 3 4 5 6 7 8 2 5 1 8 3 7 4 6 can be decomposed into (1 2 5 3) and (4 8 6 7). Just pick an element and chase where it goes when you apply the permutation over and over. You ll always get a cycle. Pick something outside the cycle you just found and repeat. )

Consequence: We only have to think of the problem posed in the episode in the case of cycles! Hurray!

Keeler s Theorem Theorem: Given the set n = {1, 2,..., n} (the n is just my own abbreviation) and an arbitrary permutation on n, if two additional elements x and y are adjoined to n (meaning we add x and y to make a new set n {x, y}), can be reduced to the identity permutation by applying a sequence of distinct transpositions of n {x, y}, each of which includes at least one of x or y.

Keeler s Theorem (ctd.) Sketch of proof Consider each of the disjoint cycles involved in the permutation one at a time. As a result, if a cycle has length k, we can temporarily rename it as (1 2 k). Then, fixing i between 1 and k arbitrarily, apply µ = (x 1)(x 2) (x i)(y i + 1)(y i + 2) (y k)(x i + 1)(y 1) and we get ( ) 1 2 k x y 1 2 k y x Repeat with other cycles and transpose x and y at the end if necessary.

Questions? Thanks for showing up! Figure : Image from the episode