part 2 some mathematical principles and problem solving
play

Part 2 Some mathematical principles and problem-solving techniques - PDF document

Problem Solving Skills (14021601-3 ) Part 2 Some mathematical principles and problem-solving techniques 2 1 Some mathematical principles and problem-solving techniques Invariant Principle 3 Gauss When Karl Friedrich Gauss was still in


  1. Puzzle • The sum of their ages is equal to the number of windows in the building next to us … x y z 36 + 1 + 1 = 38 18 + 2 + 1 = 21 12 + 3 + 1 = 16 9 + 4 + 1 = 14 9 + 2 + 2 = 13 6 + 6 + 1 = 13 6 + 3 + 2 = 11 4 + 3 + 3 = 10 71 Puzzle There are five houses, each of a different color and inhabited by men of different nationalities, with one unique pet, drink, and car. Some facts are given: 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. Who owns the zebra? 14. The Norwegian lives next to the blue house. 72 36

  2. Puzzle – a model House 1 2 3 4 5 Color Drink Country Car Pet 73 Puzzle – a model There are: • five colors: blue , green , ivory , red , and yellow ; • five drinks: cocoa , eggnog , milk , orange , and water ; • five nationalities: Englishman , Japanese , Norwegian , Spaniard , and Ukrainian ; • five cars: Chevrolet , Ford , Mercedes , Oldsmobile , and Volkswagen ; • five pets: dog , fox , horse , snails , and zebra . 74 37

  3. Puzzle – arbitrary arrangement House 1 2 3 4 5 Color blue yellow ivory red green Drink milk eggnog orange water cocoa Country Englishman Ukrainian Norwegian Japanese Spaniard Car Mercedes Chevrolet Oldsmobile Ford Volkswagen Pet zebra dog snails horse fox 75 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 76 38

  4. Puzzle House 1 2 3 4 5 Color blue 14 Drink milk 8 Country Norwegian 9 Car Pet 77 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 78 39

  5. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 Drink milk 8 Country Norwegian 9 Car Pet 79 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 80 40

  6. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 Drink milk 8 Country Norwegian 9 Car Ford 7 Pet horse 11 81 Puzzle Now we can consider two cases for two possible sequences of colors for houses 3, 4, and 5: • ivory , green , red ; • red , ivory , green ; Let ’ s consider the first possibility: ivory , green , red . 82 41

  7. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 ivory green red Drink milk 8 Country Norwegian 9 Car Ford 7 Pet horse 11 83 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 84 42

  8. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 ivory green red Drink milk 8 Country Norwegian 9 Englishman 1 Car Ford 7 Pet horse 11 85 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 86 43

  9. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 ivory green red Drink milk 8 cocoa 3 Country Norwegian 9 Englishman 1 Car Ford 7 Pet horse 11 87 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 88 44

  10. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 ivory green red Drink eggnog 4 milk 8 cocoa 3 Country Norwegian 9 Ukrainian 4 Englishman 1 Car Ford 7 Pet horse 11 89 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 90 45

  11. Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 ivory green red Drink eggnog 4 milk 8 cocoa 3 orange 12 Country Norwegian 9 Ukrainian 4 Englishman 1 Car Ford 7 Mercedes 12 Pet horse 11 91 Puzzle 1. The Englishman lives in the red house. 2. The Spaniard owns the dog. 3. The man in the green house drinks cocoa. 4. The Ukrainian drinks eggnog. 5. The green house is immediately to the right (your right) of the ivory house. 6. The owner of the Oldsmobile also owns snails. 7. The owner of the Ford lives in the yellow house. 8. The man in the middle house drinks milk. 9. The Norwegian lives in the first house on the left. 10. The man who owns the Chevrolet lives in the house next to the house where the man owns a fox. 11. The Ford owner's house is next to the house where the horse is kept. 12. The Mercedes-Benz owner drinks orange juice. 13. The Japanese drives a Volkswagen. 14. The Norwegian lives next to the blue house. 92 46

  12. Puzzle Contradiction! When we assumed that the sequence of colors for houses 3, 4, and 5 is: ivory , green , red it is impossible to satisfy the remaining constraints of the problem. Thus: backtrack! The second sequence: red , ivory , green must be true … 93 Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 red ivory green Drink milk 8 Norwegian 9 Country Car Ford 7 Pet horse 11 94 47

  13. Puzzle The rest is easy … We can continue in a similar fashion and we can easily complete the table … Then we can answer the question: “ Who owns the zebra? ” 95 Puzzle House 1 2 3 4 5 Color yellow 1,5 blue 14 red ivory green Drink milk 8 water eggnog orange cocoa Norwegian 9 Country Ukrainian Englishman Spaniard Japanese Car Ford 7 Chevrolet Oldsmobile Mercedes Volkswagen Pet fox horse 11 snails dog zebra 96 48

  14. Sudoku A standard Sudoku puzzle is a table of 3 × 3 boxes, each of which contains a 3 × 3 array of cells; altogether Sudoku table looks like 9 × 9 grid. 97 Sudoku 98 49

  15. Sudoku At the start of the puzzle some cells of the grid are filled with integer numbers from 1 to 9 and the others are empty. Our task is to fill in the empty cells in such a way that: • Every row of the whole 9 × 9 grid must contain all the numbers from 1 to 9. • Every column of the whole 9 × 9 grid must contain all the numbers from 1 to 9. • Every 3 × 3 box must contain all the numbers from 1 to 9. 99 Puzzle 7 6 2 4 5 5 8 2 6 9 3 8 8 9 5 1 2 6 3 3 1 9 9 3 6 4 5 9 8 4 2 9 6 7 100 50

  16. Puzzle 7 6 2 4 5 5 8 2 6 9 3 8 8 9 5 1 2 6 3 3 1 9 9 3 6 4 5 9 8 4 4 2 9 6 7 101 Puzzle Mr. and Mrs. Smith invited 4 married couples for dinner. When everyone arrived, they greeted each other by a handshake. These were the rules: – no one shakes his/her own hand – no handshake between married couple – no pair does it twice – there are pairs which did not shake their hands Mr. Smith asked all people in the room, how many times did they shake their hands, and all answers he got were different. How many hands did Mrs. Smith shake? 102 51

  17. Puzzle Remember 3 rules? • Do you understand the problem? • Do you have any intuition on the solution? • Can we build a model? 103 Puzzle – a model Mr. Smith 104 52

  18. Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 105 Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 106 53

  19. Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 107 Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 108 54

  20. Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 109 Puzzle – a model 5 4 3 6 2 7 1 8 0 Mr. Smith 110 55

  21. Puzzle – a model Mrs. Smith 5 4 3 6 2 7 1 8 0 Mr. Smith 111 Puzzle Mrs. Brown, Mrs. White, and Mrs. Green went to a hairdresser where they experimented with different colors and haircuts. When they left the hairdresser, the lady with green hair said: – “ Have you noticed that although our hair colors match our names, none of us has the same hair color as our name? ” Mrs. Brown replied: – “ Indeed, you are right! This is remarkable! ” What hair color did each lady have? 112 56

  22. Puzzle Rule #1: Do we understand the problem? Rule #2: Reject your intuition “ It is impossible to tell! ” Rule #3: Construct a model by listing all the variables, constraints, and objectives. The letters B , W , and G mark three colors: ( B ) brown, ( W ) white, and ( G ) green. If we knew nothing apart that three ladies selected some colors for their hair from this list, the model would be: Mrs. Brown: B or W or G Mrs. White: B or W or G Mrs. Green: B or W or G 113 Puzzle Initial model: Mrs. Brown: B or W or G Mrs. White: B or W or G Mrs. Green: B or W or G As none of the ladies ’ hair color matched their name (this is the first fact, hence the first constraint), the possible arrangements are: Mrs. Brown: W or G Mrs. White: B or G Mrs. Green: B or W 114 57

  23. Puzzle Now we are ready for considering the other constraints. As the lady with green hair made a remark that was answered by a different lady, Mrs. Brown, so the immediate inference is that Mrs. Brown does not have green hair! And this is all we need to solve this puzzle, as: Mrs. Brown: W or G Mrs. White: B or G Mrs. Green: B or W 115 Puzzle Now: Mrs. Brown: W Mrs. White: B or G Mrs. Green: B or W implies: Mrs. Brown: W Mrs. White: B or G Mrs. Green: B which in turn implies: Mrs. Brown: W Mrs. White: G Mrs. Green: B 116 58

  24. Puzzle Find a number that consists of six digits such that the result of multiplying that number with any number in the range from two to six, inclusive, is a number that consists of the same six digits as the original number but in a different order. 117 Puzzle We are after a six-digit number x that satisfies the given property, and we can mark each digit by a separate variable: a is the first digit, b is the second digit, and so on. x → a b c d e f Of course, for each variable, there are 10 available digits: from 0 to 9. 118 59

  25. Puzzle x → a b c d e f 2x → * * * * * * 3x → * * * * * * 4x → * * * * * * 5x → * * * * * * 6x → * * * * * * 119 Puzzle x → a b c d e f 2x → * * * * * * 3x → * * * * * * 4x → * * * * * * 5x → * * * * * * 6x → * * * * * * 120 60

  26. Puzzle x → 1 b c d e f 2x → * * * * * * 3x → * * * * * * 4x → * * * * * * 5x → * * * * * * 6x → * * * * * * 121 Puzzle What are the consequences of x → 1 b c d e f ? Since the six digits for x , 2x , 3x , 4x , 5x , and 6x are the same, and each of these numbers starts with a digit greater than the first digit of the previous number, then • all six digits are different ! • also, the digit 0 is not included. 122 61

  27. Puzzle So we know that all digits are from a range from 1 to 9, and they are different, i.e. a ≠ b , a ≠ c , a ≠ d , a ≠ e , a ≠ f , b ≠ c , and so on. Now, what about f : x → 1 b c d e f ? 123 Puzzle f = 1 f = 2 f = 3 f = 4 f = 5 f = 6 f = 7 f = 8 f = 9 124 62

  28. Puzzle f = 1 – impossible! f = 2 – impossible! f = 3 – ? f = 4 – impossible! f = 5 – impossible! f = 6 – impossible! f = 7 – ? f = 8 – impossible! f = 9 – ? 125 Puzzle So f = 3, f = 7, or f = 9 … • If f = 3: x → 1 b c d e 3 then the last digits of 2x , 3x , 4x , 5x , and 6x are 6 , 9 , 2 , 5 , and 8 . Impossible ( 1 is not included). • If f = 9: x → 1 b c d e 9 then the last digits of 2x , 3x , 4x , 5x , and 6x are 8 , 7 , 6 , 5 , and 4 . Impossible ( 1 is not included). 126 63

  29. Puzzle x → 1 b c d e 7 2x → * * * * * * 3x → * * * * * * 4x → * * * * * * 5x → * * * * * * 6x → * * * * * * 127 Puzzle Actually, as f = 7, we know much more … The digits we are after are: 7 , 4 , 1 , 8 , 5 , and 2 In sorted order: 1 , 2 , 4 , 5 , 7 , and 8 , which means that: 128 64

  30. Puzzle x → 1 b c d e 7 2x → 2 * * * * 4 3x → 4 * * * * 1 4x → 5 * * * * 8 5x → 7 * * * * 5 6x → 8 * * * * 2 129 Puzzle Further observation: all columns contain different digits (i.e. a permutation of 1, 2, 4, 5, 7, and 8). Why? Can we take advantage of this observation? 130 65

  31. Puzzle Can we take advantage of this observation? Yes, we can! 131 Puzzle x → 1 b c d e 7 2x → 2 * * * * 4 3x → 4 * * * * 1 4x → 5 * * * * 8 5x → 7 * * * * 5 6x → 8 * * * * 2 _______________________ 21x = 2 7 7 7 7 7 7 132 66

  32. Puzzle As 21x = 2,777,777 then x = 142,857 133 Puzzle Mr. White, Mr. Brown, and Mr. Green took part in a shooting competition where each of them fired 6 shots. The competition resulted in a three-way draw, as each participant got 71 points. The first two shots of Mr. White gave him 22 points and the first shot of Mr. Green gave him 3 points. Who hit the bull ’ s eye? 134 67

  33. Puzzle 1 2 3 5 10 20 25 50 135 Puzzle We know the scores for all 18 shots made by the three competitors; these are (from the best to the worst): 50, 25, 25, 20, 20, 20, 10, 10, 10, 5, 5, 3, 3, 2, 2, 1, 1, 1. 136 68

  34. Puzzle Let us denote the scores of Mr. White, Mr. Brown, and Mr. Green by: Mr. White: w 1 , w 2 , w 3 , w 4 , w 5 , w 6 Mr. Brown: b 1 , b 2 , b 3 , b 4 , b 5 , b 6 Mr. Green: g 1 , g 2 , g 3 , g 4 , g 5 , g 6 Q: Is w 1 the score of the first shot by Mr. White or rather the score of his best shot? 137 Puzzle It does not really matter that much (both approaches would lead to a solution) but it is important to define these precisely to model the constraints. So, let us assume that all shots of all three competitors are sorted from the best to the worst: w 1 ≥ w 2 ≥ w 3 ≥ w 4 ≥ w 5 ≥ w 6 b 1 ≥ b 2 ≥ b 3 ≥ b 4 ≥ b 5 ≥ b 6 g 1 ≥ g 2 ≥ g 3 ≥ g 4 ≥ g 5 ≥ g 6 138 69

  35. Puzzle What do we know? w 1 + w 2 + w 3 + w 4 + w 5 + w 6 = b 1 + b 2 + b 3 + b 4 + b 5 + b 6 = g 1 + g 2 + g 3 + g 4 + g 5 + g 6 = 71 139 Puzzle We should convince ourselves (it is time- consuming exercise) that the only way to partition the set of scores into three disjoint subsets of six shots with a total of 71 for each subset is: 25, 20, 20, 3, 2, 1 25, 20, 10, 10, 5, 1 50, 10, 5, 3, 2, 1 140 70

  36. Puzzle Anything else? • There exist 1 ≤ i, k ≤ 6 such that w i + w k = 22, as two shots of Mr. White gave him 22 points. • There exist 1 ≤ i ≤ 6 such that g i = 3, as one shot of Mr. Green gave him 3 points. 141 Puzzle The first row must represent results of Mr. White, as it is the only row that contains two numbers whose sum is 22. Then the third row must be of Mr. Green, as it is the only remaining row that contains 3. Thus it was Mr. Green who hit the bull ’ s eye … 142 71

  37. Puzzle Annual International Conference on Logic: • 31 participants • one main organizer • it is it is necessary to test, whether all participants are logicians … • each participant gets from the organizer a dot of some colour on his forehead • the organizer assures one participant (who expressed a concern) that everyone will be able to guess the colour of his/her dot at some stage 143 Puzzle This is what happened. When the bell ring: 1 st time: 4 people left • 2 nd time: all with red dots left • 3 rd time: no one left • 4 th time: at least one left • • shortly afterwards: a participant, who expressed concern left together with his sister; both had dots of different colour … At that time there were still some people left … How many times did the bell ring? 144 72

  38. Puzzle When the bell ring the 1 st time, 4 people left … What does it mean? What did they see? What did they know at that time? 145 Puzzle When the bell ring the 1 st time, 4 people left … Hint: You are one of the participants. You look around and you see only one participant with yellow dot. What can you claim? 146 73

  39. Any Question ??? Some mathematical principles and problem-solving techniques Optimisation What is the best arrangement? 148 74

  40. Optimization Many problems fall into category of optimization problems. These problems require finding the best solution among many possible solutions. There is hardly a real-world problem without an optimization component. For example, how should we get to a particular destination in the shortest possible time? How should we schedule orders on a production line to minimize the production cost? How should we cut components from a piece of metal to minimize the waste? And so on … 149 Puzzle Four travellers approached a bridge … A (1), B (2), C (5), D (10) How should the travelers schedule the crossing of the bridge to minimize the total time? 150 75

  41. Puzzle A possible solution: A & B ↑ 2 Rule #2 ↓ A 1 A & C ↑ 5 ↓ 1 A A & D ↑ 10 A (1), B (2), C (5), D (10) 151 Puzzle Find the shortest possible travel distance for a salesman that must visit every city in his territory (exactly once) and then return home. The diagram below represents a seven-city version of this problem: 3 1 2 7 4 5 6 152 76

  42. Puzzle 1 2 3 4 5 6 7 1 19 27 17 21 31 2 16 15 18 14 22 26 3 25 14 20 18 13 4 16 20 11 19 12 17 12 17 5 6 33 24 20 23 15 7 29 14 16 153 Puzzle Different tours may have different costs (total distances). For example, if we follow the tour: 2 – 3 – 7 – 6 – 1 – 4 – 5 – 2 the quality measure (i.e. the total distance) of this tour is 15 + 13 + 16 + 33 + 17 + 11 + 12 = 117. If the salesman follows a different tour: 2 – 1 – 3 – 7 – 6 – 5 – 4 – 2 then the total distance would be 127 … Which tour provides the shortest total distance ? 154 77

  43. Puzzle • A 10-city problem has 362,880 possible solutions. • A 20-city problem has approximately 10 17 possible solutions. • A 50-city problem has approximately 10 64 possible solutions. 155 Puzzle 6.5 y maximize $20 x + $30 y 99 x + 6 y ≤ 288 x = 18 y = 45 3 x + y ≤ 99 48 x 33 288 This diagram explains the principles of linear programming 156 78

  44. Puzzle From a piece of rectangular paper 20 × 30 centimeters, cut corners in such a way that after bending the sides of the paper we get box of the largest possible volume: 20 cm 30 cm 157 Puzzle V = (20 – 2 x )(30 – 2 x ) x = = 4 x 3 – 100 x 2 + 600 x This is example of a non-linear problem – nonlinear programming techniques must be used. Solution: x ≈ 3.92 cm, and V ≈ 1056.31 cm 3 158 79

  45. Making connections … • Make an efficient connection: 159 A possibility length = 3 160 80

  46. Another possibility … length = 2.83 161 And another possibility … . length = 3.14 162 81

  47. A solution length = 2.73 n points – so called Steiner ’ s problem … still unsolved … 163 How did it start? C F A B Find a point F such that the total distance AF + BF + CF is minimum 164 82

  48. Puzzle A rectangular chocolate bar consists of m × n small rectangles and you wish to break it into its constituent parts. At each step, you can only pick up one piece and break it along any of its vertical or horizontal lines. How should you break the chocolate bar using the minimum number of steps (breaks)? 165 Key questions Key questions for any optimization problem: (1) What is a solution ( potential / candidate solution versus final solution)? (2) What is feasible solution? Infeasible one? (3) What is representation of a solution? (4) What is the quality measure of a solution? 166 83

  49. Optimization all solutions (search space) 167 Optimization quality measure all solutions (search space) 168 84

  50. Optimization quality measure infeasible solution feasible solution Optimization task : Find the highest quality feasible solution … 169 Optimization quality measure another quality measure feasible solution infeasible solution Optimization task : Find the highest quality feasible solution … 170 85

  51. Puzzle Suppose you wish to know which floors in a 36-story building are safe to drop eggs from and which will cause the eggs to break on landing (using a special container for the eggs). We eliminate chance and possible differences between different eggs (e.g. one egg breaks when dropped from the 7th floor and another egg survives a drop from the 20th floor) by making a few (reasonable!) assumptions (Rule #1): 171 Puzzle • An egg that survives a drop can be used again (no harm is done and the egg is not weaker). • A broken egg can not be used again for any experiment. • The effect of a fall is the same for all eggs. • If an egg breaks when dropped from some floor, it would break also if dropped from a higher floor. • If an egg survives a fall when dropped from some floor, it would survive also if dropped from a lower floor. 172 86

  52. Puzzle Further, there are no pre-existing assumptions concerning when the egg will break. It is possible that a drop from the first floor in the special container would break an egg. It is also possible that a drop from the 36th floor in the special container would not break an egg. 173 Puzzle Now, if only one egg is available for experimentation, we have no choice. To obtain the required result, we have to start by dropping the egg from the first floor. If it breaks, we know the answer. If it survives, we drop it from the second floor and continue upward until the egg breaks. The worst-case scenario would require 36 drops to determine the egg-breaking floor. 174 87

  53. Puzzle Suppose we have two eggs. What is the least ( minimum ) number of egg drops required to determine the egg-breaking floor? 175 Puzzle Most people when given this puzzle try to start somewhere in the middle of the building, e.g. dropping the first egg from the half-height. Most likely they use – more or less consciously – a technique called binary search , where we divide a sample in half (or as close to half as possible) and – based on the outcome – proceed further. 176 88

  54. Puzzle Is the binary search a good approach? If we drop the first egg from, say, the 18th floor, there are two possible outcomes: • The egg breaks. In this case we have to test every floor starting from floor 1. In the worst case, we drop the second egg 17 times to determine the egg-breaking floor.... • The egg does not break. We have to examine remaining 18 floors; however, we have still two eggs for experimentation … 177 Puzzle These two cases suggest that we should start lower than the 18th floor: if the first egg breaks, we will have a shorter segment of floors to experiment with; if the first egg does not break, the segment would be longer but we would have still two eggs for our experiments … 178 89

  55. Key questions, again What is representation of a solution? a b c A drop from floor level a . The thick line indicates that the egg breaks and the thin line that it does not. In the former case, we can drop the second egg from the level b , whereas in the latter case we drop the first egg from the level c . 179 Example 14 1 22 15 30 What is the quality measure of a solution? 180 90

  56. Puzzle The quality measure of a solution is determined by the longest branch of the strategy tree: the shorter the longest branch is, the better the solution … So the problem is to find a strategy tree where its longest branch is the shortest possible! 181 Puzzle 8 1 15 2 9 21 3 10 16 26 4 11 17 22 30 5 12 18 23 27 33 6 13 19 24 28 31 35 7 14 20 25 29 32 34 36 182 91

  57. Puzzle Now, suppose we have three eggs. What is the least ( minimum ) number of egg drops required to determine the egg- breaking floor? Suppose we have k eggs and the building has n floors. What is the least ( minimum ) number of egg drops required to determine the egg-breaking floor? 183 Any Question ??? 92

  58. Some mathematical principles and problem-solving techniques Probability: Coins, dice, boxes, and bears 185 Two bears Let us consider the case of two bears – one white and one black. We ask three similar questions and suggest thinking about the answers before reading further. The questions are:  What is the probability that both bears are males?  What is the probability that both bears are males if you were told that one of them is male?  What is the probability that both bears are males if you were told that the white one is male? 186 93

  59. Two bears Rule #1 : Be sure you understand the problem, and all the basic terms and expressions used to define it . There are two bears, but where did they come from? Were they selected from a large population of bears? If so, we should know the distribution of sexes and colors in this population … Since this information was not given in the problem, we have to assume that among all bears, the two sexes and two colors (black or white) are equally likely. 187 Two bears Rule #2 : Do not rely on your intuition too much; solid calculations are far more reliable Rule #3 : Solid calculations and reasoning are more meaningful when you build a model of the problem by defining its variables, constraints, and objectives . 188 94

  60. Two bears  What is the probability that both bears are males? Let ’ s list all the possible outcomes, which are: ( white , black ) = ( f f ), ( f m ), ( m f ), and ( m m ) where m is male and f is female. Answer: 1/4 189 Two bears  What is the probability that both bears are males if you were told that one of them is male? We know that all possible outcomes are: ( white , black ) = ( f f ), ( f m ), ( m f ), and ( m m ) Answer: 1/3 190 95

  61. Two bears  What is the probability that both bears are males if you were told that the white one is male? We know that all possible outcomes are: ( white , black ) = ( f f ), ( f m ), ( m f ), and ( m m ) Answer: 1/2 191 Puzzle There are three cards in a bag: • The first card has the symbol X written on both sides, • The second card has the symbol O written on both sides, • The third card has an X on one side and an O on the other . You draw one card at random and examine one side of this card. You see an X . What is the probability that there is also an X on the other side? 192 96

  62. Puzzle Again: Rule #1 , Rule #2 , and Rule #3 … Clue : Altogether, there are 6 symbols on these three cards: three X s and three O s. Model : a, b, c X d, e, f O Card #1 Card #2 Card #3 a b c d e f 193 Puzzle Model : a, b, c X d, e, f O Card #1 Card #2 Card #3 a b c d e f Now we can do some reasoning: “ You draw one card at random and examine one side of this card. You see an X . ” So you saw either a, b, or c … Answer: 2/3 194 97

  63. Puzzle  A boy is often late for school. When approached by his teacher, he explained that it is not his fault. Then he provided some details. His father takes him from home to the bus stop every morning. The bus is supposed to leave at 8:00 am, but this departure time is only approximate. The bus arrives at the stop anytime between 7:58 and 8:02 and immediately departs. The boy and his father aim at arriving at the bus stop at 8:00, however, due to variable traffic conditions they arrive anytime between 7:55 and 8:01. This is why the boy misses the bus so often.  Can you determine how often the boy is late for school? 195 Puzzle – the model As we know, the two variables of the problem are:  x : arrival/departure time of the bus, 7:58 ≤ x ≤ 8:02.  y : arrival time of the boy, 7:55 ≤ y ≤ 8:01. 196 98

  64. Puzzle – one model 6/35 ≈ 17% Possible arrivals: every minute … x 8:02 8:01 8:00 7:59 y 7:58 7:55 7:56 7:57 7:58 7:59 8:00 8:01 197 Puzzle – another model 81/925 ≈ 18.5% Possible arrivals: every 10 sec … x 8:02 8:01 8:00 7:59 y 7:58 7:55 7:56 7:57 7:58 7:59 8:00 8:01 198 99

  65. Puzzle - solution The line x = y Exact answer: 18.75% divides the rectangle into x two areas: area x < y 8:02 (dark part) 8:01 when the boy is late for the 8:00 bus, and area x ≥ y 7:59 (light part), y when the boy 7:58 is on time. 7:55 7:56 7:57 7:58 7:59 8:00 8:01 199 Remark “ Everything we do, everything that happens around us, obeys the laws of probability. We can no more escape them than we can escape gravity. ‘ Probability, ’ a philosopher once said, ‘ is the very guide of life. ’ We are all gamblers who go through life making countless bets on the outcome of countless actions . ” Martin Gardner, 1960s 201 100

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend