Presentation is loading. Please wait.

Presentation is loading. Please wait.

Problems as Puzzles William Gasarch, Evan Golub Department of Computer Science University of Maryland.

Similar presentations


Presentation on theme: "Problems as Puzzles William Gasarch, Evan Golub Department of Computer Science University of Maryland."— Presentation transcript:

1 Problems as Puzzles William Gasarch, Evan Golub Department of Computer Science University of Maryland

2 William Gasarch, Evan Golub - UMD2 Why puzzles? Before you can begin to code a program to solve a problem, you need to figure out how the problem can be solved. Once you know what you want to build, you need to design a plan to implement the solution. You need to devise tests to determine whether your implementation is correct. To do this, you often need to play the adversary to your own ideas. These “puzzle” stages are critical components in the life cycle of an application. Take real world problems and turn them into math and/or algorithm problems.

3 William Gasarch, Evan Golub - UMD3 The Dr. Ecco Series by Dennis Shasha The Puzzling Adventures of Dr. Ecco Dr. Ecco: Mathematical Detective Dr. Ecco's Cyberpuzzles Puzzling Adventures The Puzzler's Elusion …and many other books of puzzles…

4 William Gasarch, Evan Golub - UMD4 Cake Cutting You have a regular round cake with icing on top. You want to cut it into 16 equal pieces using only 4 straight cuts. How would you do it?

5 William Gasarch, Evan Golub - UMD5 Cake Cutting You have a regular round cake with icing on top. You want to cut it into 16 equal pieces using only 4 straight cuts. Lessons: Lateral Thinking Powers of 2

6 William Gasarch, Evan Golub - UMD6 Cake Cutting You have a regular round cake with icing on top. You want to cut it into 16 equal pieces using only 4 straight cuts. Questions: How long do you give students to work on it? What if a student wants to keep working on it until they figure it out? What if they want to ask questions as they are working on it?

7 William Gasarch, Evan Golub - UMD7 Single-elimination Tournament Assume you have a problem in which there are multiple candidates or players or ideas that need to compete against each other, but that one-on-one competition is the only direct test available to you, and once someone/thing loses a round, it’s out.

8 William Gasarch, Evan Golub - UMD8 Single-elimination Tournament Candidate A and Candidate B each have 40% of the population strongly on their side and totally opposed to the other of the two candidates. Candidate C has 20% of the population who would vote for them. Everyone must vote in every election. How can Candidate C win?

9 William Gasarch, Evan Golub - UMD9 Single-elimination Tournament Candidate A and Candidate B each have 40% of the population strongly on their side and totally opposed to the other of the two candidates. Candidate C has 20% of the population who would vote for them. Everyone must vote in every election. How can Candidate C win? Is there a way for Candidate C lose?

10 William Gasarch, Evan Golub - UMD10 Single-elimination Tournament There are four proposals. People have ranked the proposals differently: 17% of the people like C better than A, A better that D and D better than B 32% of the people like A better than B, B better that D and D better than C 34% of the people like D better than B, B better that C and C better than A 17% of the people like B better than A, A better that C and C better than D In what order would you hold the elections to make sure that Choice C wins? ___ TRY IT!

11 William Gasarch, Evan Golub - UMD11 Single-elimination Tournament There are four proposals. People have ranked the proposals differently: 17% of the people like C better than A, A better that D and D better than B 32% of the people like A better than B, B better that D and D better than C 34% of the people like D better than B, B better that C and C better than A 17% of the people like B better than A, A better that C and C better than D In what order would you hold the elections to make sure that Choice C wins? For each of the four choices, does there exist an ordering that will allow the choice to win?

12 William Gasarch, Evan Golub - UMD12 Single-elimination Tournament There are eight tennis players that need to be ranked. You may assume that if A beats B in one match and if B beats C in another match, that if A were to play C the outcome is already known; A will beat C. Assuming there is one tennis court available, and that a game takes an hour, can you rank all of the players in fewer than twenty hours? How many hours would it take if you instead had four courts available?

13 William Gasarch, Evan Golub - UMD13 Single-elimination Tournament Assume you have a problem in which there are multiple candidates or players or ideas that need to compete against each other, but that one-on-one competition is the only direct test available to you… Lessons: Game/Decision Trees Combinatorics Working Backwards From a Goal Sorting Parallelism

14 William Gasarch, Evan Golub - UMD14 Single-elimination Tournament Assume you have a problem in which there are multiple candidates or players or ideas that need to compete against each other, but that one-on-one competition is the only direct test available to you… Questions: How many different problems do you do within an area, even if the solutions are different? In how many increasingly levels of challenge do you present questions?

15 William Gasarch, Evan Golub - UMD15 Clock Gourds A gourd is a fruit. Let’s say that if you poke one hole in it then the water it contains will drain in exactly 11 minutes. If you poke two holes in it then the water will drain in exactly 5 minutes. Using these facts, can you time 1 minute?

16 William Gasarch, Evan Golub - UMD16 Clock Gourds A gourd is a fruit. Let’s say that if you poke one hole in it then the water it contains will drain in exactly 11 minutes. If you poke two holes in it then the water will drain in exactly 5 minutes. Using these facts, can you time 1 minute? Generalize: Let a 1,...,a n be positive integers. Assume you have gourds that drain in a 1 minutes, a 2 minutes,..., a n minutes. Which “times” can you measure?

17 William Gasarch, Evan Golub - UMD17 Clock Gourds A gourd is a fruit. Let’s say that if you poke one hole in it then the water it contains will drain in exactly 11 minutes. If you poke two holes in it then the water will drain in exactly 5 minutes. Using these facts, can you time 1 minute? Generalize: Let a 1,...,a n be positive integers. Assume you have gourds that drain in a 1 minutes, a 2 minutes,..., a n minutes. Which “times” can you measure? Lesson: Model problems as graphs.

18 William Gasarch, Evan Golub - UMD18 Zoranic Monopoles The book presents a problem where there are 52 compounds, numbered from 1..52 (and later increases this to 65 compounds). A box is allowed to contain any number of the compounds but if there are three compounds X, Y, Z in the box such that X+Y=Z, then the box explodes! How many boxes required to pack up all of the compounds WITHOUT having anything blow up? Let’s think of it as compounds numbered from 1…N and consider for how large an N can we solve this here today. TRY IT!

19 William Gasarch, Evan Golub - UMD19 Zoranic Monopoles The book presents a problem where there are 52 compounds, numbered from 1..52 (and later increases this to 65 compounds). A box is allowed to contain any number of the compounds but if there are three compounds X, Y, Z in the box such that X+Y=Z, then the box explodes! How many boxes required to pack up all of the compounds WITHOUT having anything blow up? Let’s think of it as compounds numbered from 1…N and consider for how large an N can we solve this here today. Lessons: Greedy algorithms, Open problems

20 William Gasarch, Evan Golub - UMD20 Hovertanks in Battle Assume there are 25 hills to which a tank can go (number them 0, 1, 2, …, 24). For each hill we can only shoot at certain hills (e.g., from hill 0 we can only shoot hills 1, 2, 3, 7). We have 10 tanks available. Where should you put them so that every hill is either: –occupied –can be shot it by a hill that is occupied Generalize: A graph is a set of vertices and lines (called edges) between some of them. Given a graph and a number k, can you pick out k vertices so that every vertex is either picked or adjacent to one that is picked?

21 William Gasarch, Evan Golub - UMD21 Hovertanks in Battle Assume there are 25 hills to which a tank can go (number them 0, 1, 2, …, 24). For each hill we can only shoot at certain hills (e.g., from hill 0 we can only shoot hills 1, 2, 3, 7). We have 10 tanks available. Where should you put them so that every hill is either: –occupied –can be shot it by a hill that is occupied Lesson: There are problems that currently take a long time to solve perfectly, but a greedy algorithm might give a good answer in good time.

22 William Gasarch, Evan Golub - UMD22 Lasers on Utopia Basin There are stations on Mars. We need to be able to fly (using Laser Shuttles) from one to the other. We will set up routes from certain pairs of cities but we want to make sure that there are never any crashes! If the path from (say) A to B crosses the path from C to D we will never have A--B and C--D as routes. We want to know what is the max number of routes we can set up without two routes crossing. Generalize: Given any n points in the plane, how many straight lines can you put between pairs of them? Lesson: This is the “maximum number of edges in a Euclidean planar graph” problem!

23 William Gasarch, Evan Golub - UMD23 Untangling the Rosetta Web You are given two graphs. One uses the labels fig, prune, grapefruit, apricot, currant, pineapple, date, raisin, coconut. The other uses nine labels in an alien language. We know the two graphs are the same. You need to figure out which alien words to use to ask for the fruit that you know you like Lesson: This is a classic “graph isomorphism” problem. A follow-up question could be “What if there is not a unique solution?”

24 William Gasarch, Evan Golub - UMD24 The Richest of Them All There are 20 hecto-millionaires (over 100 million dollars) in a club. They all have between 100 million dollars and 10 billion dollars. They want to know what the least amount of money is that someone in the club has and what the most amount of money that someone in the club has. But they DO NOT want to know who those “poorest” and “richest” people ARE. They can only communicate by calling each other one-on-one and exchanging information. Can they accomplish this? TRY IT! (at home)

25 Puzzles and games can be great sources of problems in computational thinking which can engage and motivate students…


Download ppt "Problems as Puzzles William Gasarch, Evan Golub Department of Computer Science University of Maryland."

Similar presentations


Ads by Google