ECS 20 (Spring 2013) Phillip Rogaway Lecture 1

Similar documents
Theory of Probability - Brett Bernstein

Lecture 18 - Counting

CSE 20 DISCRETE MATH. Fall

Laboratory 1: Uncertainty Analysis

Arithmetic Sequences Read 8.2 Examples 1-4

29. Army Housing (a) (b) (c) (d) (e) (f ) Totals Totals (a) (b) (c) (d) (e) (f) Basketball Positions 32. Guard Forward Center

The study of probability is concerned with the likelihood of events occurring. Many situations can be analyzed using a simplified model of probability

Discrete Structures for Computer Science

Math Fundamentals for Statistics (Math 52) Unit 2:Number Line and Ordering. By Scott Fallstrom and Brent Pickett The How and Whys Guys.

Teacher s Notes. Problem of the Month: Courtney s Collection

Problem Set 8 Solutions R Y G R R G

On uniquely k-determined permutations

Section 8.1. Sequences and Series

Notes for Recitation 3

CALCULATING SQUARE ROOTS BY HAND By James D. Nickel

Problem Set 8 Solutions R Y G R R G

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

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

Chapter 1. Probability

DVA325 Formal Languages, Automata and Models of Computation (FABER)

COUNTING AND PROBABILITY

Analyzing Games: Solutions

Intermediate Math Circles November 1, 2017 Probability I

Topics to be covered

MA 524 Midterm Solutions October 16, 2018

By Scott Fallstrom and Brent Pickett The How and Whys Guys

Algebra. Recap: Elements of Set Theory.

Grade 6 Math Circles February 21/22, Patterns - Solutions

Grade 7/8 Math Circles Game Theory October 27/28, 2015

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

Checkpoint Questions Due Monday, October 7 at 2:15 PM Remaining Questions Due Friday, October 11 at 2:15 PM

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

Cardinality revisited

The Problem. Tom Davis December 19, 2016

Sequence and Series Lesson 6. March 14, th Year HL Maths. March 2013

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

Unit Nine Precalculus Practice Test Probability & Statistics. Name: Period: Date: NON-CALCULATOR SECTION

Grade 6 Math Circles February 21/22, Patterns

MATH 2420 Discrete Mathematics Lecture notes

An Efficient Implementation of Tower of Hanoi using Gray Codes

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

THE ASSOCIATION OF MATHEMATICS TEACHERS OF NEW JERSEY 2018 ANNUAL WINTER CONFERENCE FOSTERING GROWTH MINDSETS IN EVERY MATH CLASSROOM

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

Grades 7 & 8, Math Circles 27/28 February, 1 March, Mathematical Magic

Conway s Soldiers. Jasper Taylor

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

Greedy Flipping of Pancakes and Burnt Pancakes

MA10103: Foundation Mathematics I. Lecture Notes Week 3

POKER (AN INTRODUCTION TO COUNTING)

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

Restricted Permutations Related to Fibonacci Numbers and k-generalized Fibonacci Numbers

Acing Math (One Deck At A Time!): A Collection of Math Games. Table of Contents

Honors Precalculus Chapter 9 Summary Basic Combinatorics

Let start by revisiting the standard (recursive) version of the Hanoi towers problem. Figure 1: Initial position of the Hanoi towers.

Week 1. 1 What Is Combinatorics?

Tribute to Martin Gardner: Combinatorial Card Problems

CSE 21 Practice Final Exam Winter 2016

Math 1111 Math Exam Study Guide

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER II EXAMINATION MH1301 DISCRETE MATHEMATICS. Time Allowed: 2 hours

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

European Journal of Combinatorics. Staircase rook polynomials and Cayley s game of Mousetrap

Important Distributions 7/17/2006

1.6 Congruence Modulo m

Latin squares and related combinatorial designs. Leonard Soicher Queen Mary, University of London July 2013

The mathematics of the flip and horseshoe shuffles

GREATER CLARK COUNTY SCHOOLS PACING GUIDE. Algebra I MATHEMATICS G R E A T E R C L A R K C O U N T Y S C H O O L S

Math 1111 Math Exam Study Guide

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C

Grade 6, Math Circles 27/28 March, Mathematical Magic

Free Cell Solver. Copyright 2001 Kevin Atkinson Shari Holstege December 11, 2001

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY

Staircase Rook Polynomials and Cayley s Game of Mousetrap

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000.

UNIT 2: RATIONAL NUMBER CONCEPTS WEEK 5: Student Packet

Puzzling Math, Part 2: The Tower of Hanoi & the End of the World!

Countability. Jason Filippou UMCP. Jason Filippou UMCP) Countability / 12

Radical Expressions and Graph (7.1) EXAMPLE #1: EXAMPLE #2: EXAMPLE #3: Find roots of numbers (Objective #1) Figure #1:

SMT 2014 Advanced Topics Test Solutions February 15, 2014

The mathematics of the flip and horseshoe shuffles

How to Become a Mathemagician: Mental Calculations and Math Magic

An Analytical Study in Connectivity of Neighborhoods for Single Round Robin Tournaments

MATHEMATICS 152, FALL 2004 METHODS OF DISCRETE MATHEMATICS Outline #10 (Sets and Probability)

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

Fall 2017 March 13, Written Homework 4

SET THEORY AND VENN DIAGRAMS

Grade 7/8 Math Circles February 21 st /22 nd, Sets

Slide 1 Math 1520, Lecture 13

BRITISH COLUMBIA SECONDARY SCHOOL MATHEMATICS CONTEST, 2006 Senior Preliminary Round Problems & Solutions

Shuffling with ordered cards

ON SPLITTING UP PILES OF STONES


Assignment 2. Due: Monday Oct. 15, :59pm

Sequential games. We may play the dating game as a sequential game. In this case, one player, say Connie, makes a choice before the other.

LECTURE 8: DETERMINANTS AND PERMUTATIONS

MAT points Impact on Course Grade: approximately 10%

PHYSICS 140A : STATISTICAL PHYSICS HW ASSIGNMENT #1 SOLUTIONS

NOTES ON SEPT 13-18, 2012

MUMS seminar 24 October 2008

Olympiad Combinatorics. Pranav A. Sriram

Transcription:

ECS 20 (Spring 2013) Phillip Rogaway Lecture 1 Today: Introductory comments Some example problems Announcements course information sheet online (from my personal homepage: Rogaway ) first HW due Wednesday PS1, PS2, Q1 mandatory Introduce TAs: Darren, Theo Topics of this class o o o Discrete (not discreet!) mathematics deals with finite and countably infinite sets A term rarely used by mathematicians, who say what they do more specifically. Some branches mathematics that fall in scope of discrete math: Combinatorics (how to count things, how to make combinatorial objects that have desired properties) Graph theory (points and two-elements subsets of them) Logic Set theory (normally dealt with in a class like this, but much modern set theory is not dealing with finite or countably infinite sets) Probability (again, routinely treated in discrete math classes, but only when we assume that the underlying probability space is finite or countably infinite). And much more Omit: meld into examples -- Helpful Techniques for Solving Discrete Math Problems 1. Generalize the problem (in the right way!) 2. Introduce variables (e.g., substituting n for 100 in Ex. 0) 3. Group terms cleverly (e.g., the algebraic analysis of Ex. 0) 4. Name the things that you are interested in. 5. Think recursively. 6. Solve small cases by hand and look for emerging patterns. 7. Substitute repeatedly to simplify recurrence relations. 8. Use contradiction (this is demonstrated in Ex. 2). 9. Follow your nose (often only one natural path to go down) (eg, Ex. 2) Some Example Problems Example 1: Sum of the first n numbers Find the following sum: 1 + 2 + + 100 or more generally 1 + 2 + + n Gauss is said to have done this in seconds as a young child.

Solution: This problem can be viewed algebraically by writing the list of numbers forwards and backwards, i.e. 1 + 2 + + (n-1) + n + n + (n-1) + + 2 + 1 (n + 1) + (n + 1) + + (n + 1) + (n + 1) so n(n + 1) Since this result is really twice the sum we are looking for it follows that 1 + 2 + + n = (n (n + 1)) / 2 Sums like this come up often so have their own notation that you will have seen, n i=1 i You can discover formulas like this by induction, which we will be doing much more of later. This example can also be solved geometrically by writing twice 1 + 2 + + n points in the following way: * o o o o * * o o o * * * o o n points (n=5 in the picture) * * * * o * * * * * So he total number of * points is n + 1 points (n=5 in the picture) (n 2 n )/2 + n = n 2 /2 + n/2 = n(n+1)/2 which is the sum we are after. Example 2: The Towers of Hanoi _ A B C Five rings of increasing diameter are placed on peg A. The pegs must be moved from A to C using the following rules:

Only the topmost ring on a peg can be moved. A bigger ring cannot be placed on a smaller one. Problem: Find a function that describes the least number of moves needed to solve the problem when you have n rings. How many moves do you think it takes to move the five rings? Nobody guessed it or figured it out. Rogaway claims that the answer is 31. We want a formula that specifies a number of moves that is both: Sufficient: there is a solution to the game using this number of moves. Necessary: no solution can use fewer moves than this. Solution: First, let s define what we re interested in. Let T n = The minimum number of moves needed to move the n rings from peg A to peg C (obeying the rules of the game). Actually, this isn t good. We need to generalize the definition to do the job. So, instead, let T n = The minimum number of moves needed to move n rings from some one specified peg to some other specified peg (obeying the rules of the game). Sufficiency: Think recursively. Assume a black box algorithm can move the first n - 1 rings from any peg to any other peg. Solving the problem this way requires that the first n -1 rings be moved, then the largest ring be moved once, then the smaller rings be moved on to the largest ring. This number of moves can be represented by: T n T n-1 + 1 + T n-1 = 2T n-1 + 1 Necessity: Now we have to reason about any algorithm that solves the puzzle. Any solution must move the largest ring to the final peg for the very last time. That takes one move. But before that happened, we had to get the n-1 rings that were formerly on top of the start peg and move them off to a free peg. That takes at least T n-1 moves. After we got the biggest ring to its destination peg, we had to move the n-1 smaller rings from the free peg where they were at to the final peg. That takes at least T n-1 moves. So, all in all, any solution needs to spend at least moves. T n 1 + T n-1 + T n-1 = 2T n-1 + 1

Putting together the two inequalities we have that T n = 2T n-1 + 1 We know that in order to move zero rings to their final location requires zero moves, so T 0 = 0 Using this as our base value we can then determine that: T 1 T 2 T 3 T 4 T 5 T n 1 3 7 15 31 2 n -1 (apparently) One way to get the general formula is by repeated substitution: T n = 2 T n-1 + 1 = 2 [2 T n-2 + 1] + 1 = 2 2 T n-2 + (1 + 2) = 2 2 [2 T n-3 + 1] + (1 + 2) = 2 3 T n-3 + (1 + 2 + 4) = 2 n * 0 + (1 + 2 + 2 2 + + 2 n-1 ) = (1 + 2 + 2 2 + + 2 n-1 ) = 2 n 1 Binary Representation Example 3: Sqrt(2) is irrational Prove that x = 2 is irrational. Definition: x Є R is rational if x = p/q for some integers p and q Є Z, q 0. x Є R is irrational if it is not rational. Note: if in definitions mean if and only if, or exactly when Here we prove by contradiction. Assume for contradiction that x is rational, ie, x = p/q for some integers p and q, q 0 Without a loss of generality, it can be assumed that either p is odd or q is odd (if they re both even, cross out the common factors of 2 until one of the numbers is odd). Additionally, an odd number squared is still an odd number. 2 = p/q square both sides: 2 = p 2 /q 2 multiply through by the denominator: 2q 2 = p 2

From this we know that p is even, because the square of an odd number is odd (why?!). But then q is odd, because we know that at least one of p and q is odd. So we can write p = 2j for some j Є Z and q = 2i + 1 for some i Є Z 2 (2i + 1) 2 = (2j) 2 (2i + 1) 2 = 2j 2 4i 2 + 4i + 1 = 2j 2 4(i 2 + i) + 1 = 2j 2 The contradiction is that an odd number (the LHS) can equal an even number (the RHS). We can conclude that our original assumption is wrong: x = 2 is not rational, which, by definition, means that it is irrational. Example 4: Shuffling a deck of cards Famous result (1992) of Bayer and Diaconis: In 1992, Bayer and Diaconis showed that after seven random riffle shuffles of a deck of 52 cards, every configuration is nearly equally likely. In gener, BD show that you need 1.5 lg n + shuffes necessary and sufficient Shuffling more than this does not significantly increase the "randomness"; shuffle less than this and the deck is "far" from random. We claim that : 5 shuffles of a deck of cards is not enough to randomize the cards. Here by shuffles I mean the usual rifle shuffle. Prof. Rogaway demonstrates one with an imaginary deck. Assume a starting sequence of 1, 2, 3,, 51, 52 Even though we won t define what it means to randomize the cards, clearly a deck cannot be well randomized unless you can get any resulting sequence of cards, including, for example, the sequence: 52, 51,, 3, 2, 1

We are going to show that 5 shuffles of this deck will never transform the specified starting sequence to the specified final sequence. So it can t do a good job of mixing the deck. From http://www.math.hmc.edu/funfacts/ffiles/20001.4-6.shtml: An amazing fact is that five random riffle shuffles are not enough to randomize a deck of cards, because not only is every configuration not nearly equally likely, there are in fact some configurations which are not reachable in 5 shuffles! To see this, suppose (before shuffling) the cards in a deck are arranged in order from 1 to 52, top to bottom. After doing one shuffle, what kind of sequences are possible? A moment's reflection reveals that only configurations with 2 or fewer rising sequences are possible. A rising sequence is a maximal increasing sequential ordering of cards that appear in the deck (with other cards possibly interspersed) as you run through the cards from top to bottom. For instance, in an 8 card deck, 12345678 is the ordered deck and it has 1 rising sequence. After one shuffle, 16237845 is a possible configuration; note that it has 2 rising sequences (the black numerals form one, the red numerals form the other). Clearly the rising sequences are formed when the deck is cut before they are interleaved in the shuffle. So, after doing 2 shuffles, how many rising sequences can we expect? At most 4, since each of the 2 rising sequences from the first shuffle have a chance of being cut in the second shuffle. So the number of rising sequences can at most double during each shuffle. After doing 5 shuffles, there at most 32 rising sequences. But the reversed deck, numbered 52 down to 1, has 52 rising sequences! Therefore the reversed deck cannot be obtained in 5 random riffle shuffles! Max number of rising sequences after 0 shuffles: 1 1 shuffles: 2 2 shuffles: 4 3 shuffles: 8 4 shuffles: 16 5 shuffles: 32 We still can t have reached anything with more than 32 rising sequences 6 shuffles: 52