- Slides: 13
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 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.
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)
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
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)
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.
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
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)
Puzzle of Week 7 Odd pie fight n n 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
Puzzle of Week 7 Odd pie fight Suppose that: n n is odd n The distances between the people are all distinct n Q 1: Show that there is at least one lucky person who will not get hit by a pie n Q 2: Find an algorithm to identify who is the lucky person. In how much time does your algorithm run?
Puzzle of Week 8 • • • On a Saturday morning at 9 am, a student starts from AUEB and goes up to Akropolis following a specific route. He arrives at Akropolis at 11 am On Sunday, he goes down from Akropolis to AUEB, starting at the exact same time, following the exact same route backwards and returns to AUEB at 11 am. We do not know if the student has the same pace of walking in both days and he does not need to have the same speed during his walk. Is there a point in the route that is visited by the student at the exact same time in both days?
Puzzle of Week 9 St. Petersburg Paradox How much should you be willing to pay (as a participation fee) to play the following game: • The game starts with 1 euro on the table and proceeds in rounds. • In each round a coin is flipped. • If it comes up Tails, then the game stops and you win whatever is on the table. • If it comes up Heads, then the amount is doubled and we go to the next round. • For example, if the first toss is T, you win 1 euro. If the tosses are HT, you win 2 euros. If it is HHT, then you win 4 euros.
Puzzle of Week 10 Christmas puzzle 1 (the 5 card trick) • Two computer scientists, Alice and Bob, are imprisoned by a ruthless king because of a hack they did to the king’s PC. The king gives them 1 chance to survive if they succeed in the following: • The king will pick 5 cards from a regular deck of cards (52 cards, no jokers) and will give them to Bob looks at the cards, and then he has to give 1 card back to the king and present the 4 other cards to Alice then has to guess the 5 th card. • Alice and Bob can communicate before the process starts and possibly agree on an encoding algorithm. Afterwards, the only communication between them is via the arrangement of the four cards presented to Alice. There is no encoded speech or hand signals, no bent or marked cards, or any other such thing.
Puzzle of Week 11 Christmas puzzle 2 • • • Someone puts 100 cards one after the other, face down, in front of you. Each card contains one number and all you know about it is that it is an integer >=1. Your task is to start picking up cards one after the other, see the number that is written on them and try to guess the maximum number among these 100 numbers. You start from the 1 st card and continue sequentially. When you feel that you found the maximum number you can declare that you stop. If the number where you stopped is indeed the maximum number among all 100, then you win 80 euros. If not, then you lose 25. Is there a strategy for you that guarantees that the average profit for you is > 0 ? What is the best strategy you can think of?