Prove the Impossible Lecture 6: Sep 19 (based on slides in MIT 6.042) 1234 5678 9101112 131415 1234 5678 9101112 131514.

Slides:



Advertisements
Similar presentations
Chessboard problems You don’t have to know chess to solve them.
Advertisements

Mathematical Induction
Methods of Proofs October 20, A Good Proof State your plan Avoid excessive symbols Simplify as much as possible Good notation 2.
Today’s agenda 1. WASI test results 2.Quiz or HW? 3.Your stage 2 reports 4.Individual activity points.
AE1APS Algorithmic Problem Solving John Drake
Lecture ,3.3 Sequences & Summations Proof by Induction.
Introduction to Graphs
1 More Counting by Mapping Lecture 16: Nov 7. 2 This Lecture Division rule Catalan number.
Sam Chow. One Player Games Bored MUMSians Han writes the numbers 1, 2,..., 100 on the MUMS whiteboard. He picks two of these numbers, erases them, and.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
Mathematical Induction II Lecture 14: Nov
Prove the Impossible Sep 28 No program can check whether another program will run into infinite loop. x=0.
Basic properties of the integers
Induction Lecture 5: Sep 21 (chapter of the book and chapter of the notes)
Problems in Ramsey theory typically ask a question of the form: "how many elements of some structure must there be to guarantee that a particular property.
Structured Graphs and Applications
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Introduction to Graphs Lecture 18: Nov 16. Seven Bridges of Königsberg Is it possible to walk with a route that crosses each bridge exactly once?
Invariant Method Lecture 6: Sep
Strong Induction, WOP and Invariant Method Leo Cheung.
4. There once lived a king, named Hagar, who had thousands of sons and daughters, still giving more births to his wives. One of his serious problems was.
Invariant Method Lecture
Induction (chapter of the book and chapter of the notes)
Introduction to Discrete Mathematics
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
Invariant Method
The Pigeonhole (Dirichlet’s box) Principle
Copyright © Cengage Learning. All rights reserved.
Reading and Writing Mathematical Proofs
CSE 20 Lecture 12 Induction CK Cheng 1. Induction Outlines Introduction Theorem Examples: The complexity calculation – Tower of Hanoi – Merge Sort – Fibonacci.
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
B ASIC P ROOF M ETHODS HWW Math Club Meeting #3 (October 18, 2010) Presentation by Julian Salazar.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Discrete Mathematics Tutorial 11 Chin
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
Mathematical Induction I Lecture 4: Sep 16. This Lecture Last time we have discussed different proof techniques. This time we will focus on probably the.
Great Theoretical Ideas in Computer Science.
Discrete Structures & Algorithms More on Methods of Proof / Mathematical Induction EECE 320 — UBC.
A game based off of the esteemed classic By: Tadziu Kosiara.
Kindergarten Shapes. Part 1: Multiple Choice (1 point each)
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
Every chess master was once a beginner. Irving Chernev
Matching Lecture 19: Nov 23.
1 INFO 2950 Prof. Carla Gomes Module Induction Rosen, Chapter 4.
Great Theoretical Ideas in Computer Science.
Quiz highlights 1.Probability of the song coming up after one press: 1/N. Two times? Gets difficult. The first or second? Or both? USE THE MAIN HEURISTICS:
INDUCTION Slides of Ken Birman, Cornell University.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 26.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 27.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Introduction to Discrete Mathematics Lecture 1: Sep 6 AB C a = qb+r gcd(a,b) = gcd(b,r)
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Fifteen Puzzle Move: can move a square adjacent to the empty square to the empty square.
Some counting questions with the Rules of Chess. Chessboard and Chess pieces The game of chess is played on an 8-by-8 grid of alternately colored squares.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Chapter 3 The Real Numbers.
Bipartite Matching Lecture 8: Oct 7.
Mathematical Induction II
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Sit-In Lab 1 Ob-CHESS-ion
Gray Code Can you find an ordering of all the n-bit strings in such a way that two consecutive n-bit strings differed by only one bit? This is called the.
Use mathematical induction to prove that the formula is true for all natural numbers m. {image} Choose the first step of the proof from the following:
Lecture 7 All-Pairs Shortest Paths
Introduction to Discrete Mathematics
Mathematical Games Sam Chow.
Induction (Section 3.3).
Magical Hexagons (Teachers notes):
Lecture 3.1: Mathematical Induction
THE WELL ORDERING PROPERTY
Presentation transcript:

Prove the Impossible Lecture 6: Sep 19 (based on slides in MIT 6.042)

Domino Puzzle An 8x8 chessboard, 32 pieces of dominos Can we fill the chessboard?

Domino Puzzle An 8x8 chessboard, 32 pieces of dominos Easy!

Domino Puzzle An 8x8 chessboard with two holes, 31 pieces of dominos Can we fill the chessboard? Easy!

Domino Puzzle An 8x8 chessboard with two holes, 31 pieces of dominos Can we fill the chessboard? Easy??

Domino Puzzle An 4x4 chessboard with two holes, 7 pieces of dominos Can we fill the chessboard? Impossible!

Domino Puzzle An 8x8 chessboard with two holes, 31 pieces of dominos Can we fill the chessboard? Then what??

Another Chessboard Problem ? A rook can only move along a diagonal Can a rook move from its current position to the question mark?

Another Chessboard Problem ? A rook can only move along a diagonal Can a rook move from its current position to the question mark? Impossible! Why?

Another Chessboard Problem ? 1.The rook is in a blue position. 2.A blue position can only move to a blue position by diagonal moves. 3.The question mark is in a white position. 4.So it is impossible for the rook to go there. Invariant! This is a very simple example of the invariant method.

Domino Puzzle An 8x8 chessboard with two holes, 31 pieces of dominos Can we fill the chessboard?

Domino Puzzle 1.Each domino will occupy one white square and one blue square. 2.There are 32 blue squares but only 30 white squares. 3.So it is impossible to fill the chessboard using only 31 dominos. Invariant! This is a simple example of the invariant method.

Invariant Method 1.Find properties (the invariants) that are satisfied throughout the whole process. 2.Show that the target do not satisfy the properties. 3.Conclude that the target is not achievable. In the rook example, the invariant is the colour of the position of the rook. In the domino example, the invariant is that any placement of dominos will occupy the same number of blue positions and white positions.

The Possible We just proved that if we take out two squares of the same colour, then it is impossible to finish. What if we take out two squares of different colours? Would it be always possible to finish then? Yes??

Prove the Possible Yes??

Prove the Possible The secret.

Prove the Possible The secret.

Fifteen Puzzle Move: can move a square adjacent to the empty square to the empty square.

Fifteen Puzzle Initial configuration Target configuration Is there a sequence of moves that allows you to start from the initial configuration to the target configuration?

Invariant Method 1.Find properties (the invariants) that are satisfied throughout the whole process. 2.Show that the target do not satisfy the properties. 3.Conclude that the target is not achievable. What is an invariant in this game?? This is usually the hardest part of the proof.

Hint Initial configuration Target configuration ((1,2,3,…,14,15),(4,4)) ((1,2,3,…,15,14),(4,4)) Hint: the two states have different parity.

Parity Given a sequence, a pair is “out-of-order” if the first element is larger. For example, the sequence (1,2,4,5,3) has two out-of-order pairs, (4,3) and (5,3). Given a state S = ((a1,a2,…,a15),(i,j)) Parity of S = (number of out-of-order pairs + i) mod 2 row number of the empty square

Hint Initial configuration Target configuration ((1,2,3,…,14,15),(4,4)) ((1,2,3,…,15,14),(4,4)) Clearly, the two states have different parity. Parity of S = (number of out-of-order pairs + i) mod 2

Invariant Method 1.Find properties (the invariants) that are satisfied throughout the whole process. 2.Show that the target do not satisfy the properties. 3.Conclude that the target is not achievable. Invariant = parity of state Claim: Any move will preserve the parity of the state. Proving the claim will finish the impossibility proof. Parity is even Parity is odd

Proving the Invariant Claim: Any move will preserve the parity of the state. Parity of S = (number of out-of-order pairs + i) mod 2 ???? ?a? ???? ???? ???? ?a? ???? ???? Horizontal movement does not change anything…

Proving the Invariant Claim: Any move will preserve the parity of the state. Parity of S = (number of out-of-order pairs + i) mod 2 ???? ?ab1b2 b3?? ???? ???? ?b1b2 b3a?? ???? If there are (0,1,2,3) out-of-order pairs in the current state, there will be (3,2,1,0) out-of-order pairs in the next state. Row number has changed by 1 So the parity stays the same! We’ve proved the claim. Difference is 1 or 3.

Fifteen Puzzle Initial configuration Target configuration Is there a sequence of moves that allows you to start from the initial configuration to the target configuration? This is a standard example of the invariant method.

Checker x=0 Start with any configuration with all men on or below the x-axis.

Checker x=0 Move: jump through your adjacent neighbour, but then your neighbour will disappear.

Checker x=0 Move: jump through your adjacent neighbour, but then your neighbour will disappear.

Checker x=0 Goal: Find an initial configuration with least number of men to jump up to level k.

K=1 x=0 2 men.

K=2 x=0

K=2 x=0 4 men. Now we have reduced to the k=1 configuration, but one level higher.

K=3 x=0 This is the configuration for k=2, so jump two level higher.

K=3 x=0 8 men.

K=4 x=0

K=4 x=0

K=4 x=0

K=4 x=0

K=4 x=0 Now we have reduced to the k=3 configuration, but one level higher 20 men!

K=5 a.39 or below b men c men d men e.101 – 1000 men f.1001 or above None of the above (but f is closest), it is impossible! This is a tricky example of the invariant method. Excellent project idea

Classwork 1 October 3 (in class) 1.Logic. 2.Sets, functions. 3.Proof by cases, contradiction. 4.Proof by inductions. 5.Invariant method. True or false, multiple choice, short question, long question. A very useful method