puzzle of week 1 you have 2 identical straight pieces of rope. each takes 1 hour to burn if you...

9
Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show how we can count 15 minutes. You cannot use rulers, you cannot fold the ropes, and you cannot estimate accurately where the middle point of each rope is. You can ONLY use lighters.

Upload: james-fields

Post on 18-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 1• You have 2 identical straight pieces of rope. • Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one).

• Show how we can count 15 minutes. • You cannot use rulers, you cannot fold the ropes, and you cannot estimate accurately where the middle point of each rope is.

• You can ONLY use lighters.

Page 2: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 2• The city of Königsberg (now Kaliningrad) has 7

bridges in the following arrangement:

• Can we make a tour through the city that crosses each bridge exactly once?

• HINT: you can model it as a graph problem• Generalization: More importantly and more

interestingly, can you find an algorithm that decides if, in a given graph G, it is possible to walk through the graph so that we cross every edge exactly once? (i.e., solving a postman’s problem)

Page 3: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 3

• You have nine coins. Eight are genuine and one is fake. The fake coin is heavier than the other eight. You are allowed to use a balance scale at most two times. Figure out which coin is fake.

• HINT: Think of a Divide & Conquer approach

Page 4: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 4Divide & Conquer + Recurrence relations

•Suppose you have n coins, out of which one is fake and the other n-1 coins are genuine. The fake coin is heavier than the rest. You are allowed to use a balance scale to figure out which coin is fake. •Can you think of a recursive algorithm to solve this? (e.g. Divide into 2 parts) •Write a recurrence relation for the number of times you use the scale and solve it•What is the best recursive algorithm you can think of? (For convenience, assume n is a power of 3, n = 3k, for some k)

Page 5: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 5

• You are given 12 coins, one of which is fake. You do not know however if it is heavier or lighter than the original ones. You can use a balance scale up to 3 times. Determine the fake coin.

Page 6: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 6Definition 1: A tromino is an L-shaped tile

Definition 2: A defective chessboard is a chessboard where one square is broken

Page 7: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 61.Consider a 2n x 2n defective

chessboard. Show that it can always be filled up with trominos so that all squares are covered apart from the defective one (think of a recursive algorithm for this)

1.How many trominos do you need? (think of a recursive formula)

Page 8: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 7Odd pie fightSuppose a set of n people are in a birthday partyAfter some drinks, each person grabs a piece of a pie, and he plans to throw it at the person who is in the shortest distance from him

Page 9: Puzzle of Week 1 You have 2 identical straight pieces of rope. Each takes 1 hour to burn if you light it from 1 side (it doesn’t matter which one). Show

Puzzle of Week 7

Odd pie fightSuppose that:n is oddThe distances between the people are all distinctQ1: Show that there is at least one lucky person who will not get hit by a pieQ2: Find an algorithm to identify who is the lucky person. In how much time does your algorithm run?