Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

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 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.

2 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)

3 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

4 Puzzle of Week 4 Divide & 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 = 3 k, for some k)

5 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.

6 Puzzle of Week 6 Definition 1: A tromino is an L-shaped tile Definition 2: A defective chessboard is a chessboard where one square is broken

7 Puzzle of Week 6 1.Consider a 2 n x 2 n 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)

8 Puzzle of Week 7 Odd pie fight Suppose a set of n people are in a birthday party After 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

9 Puzzle of Week 7 Odd pie fight Suppose that: n is odd The distances between the people are all distinct Q1: Show that there is at least one lucky person who will not get hit by a pie Q2: Find an algorithm to identify who is the lucky person. In how much time does your algorithm run?


Download ppt "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."

Similar presentations


Ads by Google