1 / 39

Substitute: Margaret Ellis

Substitute: Margaret Ellis. General Problem Solving Strategies. diagraming/externalizing ideas rewriting in symbols divide and conquer enumerate possibilities top down/bottom up solve a simpler problem solve a similar problem look for special cases look for a pattern.

rsutherland
Download Presentation

Substitute: Margaret Ellis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Substitute: Margaret Ellis

  2. General Problem Solving Strategies • diagraming/externalizing ideas • rewriting in symbols • divide and conquer • enumerate possibilities • top down/bottom up • solve a simpler problem • solve a similar problem • look for special cases • look for a pattern

  3. How can programmers deal with interruptions? • http://heeris.id.au/2013/this-is-why-you-shouldnt-interrupt-a-programmer Adapted from 2011-12 Shaffer & McQuain CS 2104

  4. Visualization in CS problems • Actual content of problem being solved (architecture, manufacturing, telecommunications...) • Graphic displays • Interfaces • Data structures(arrays, linked lists, stacks, queues, trees) • System design diagram (UML class diagrams, workflow, storage) Adapted from 2011-12 Shaffer & McQuain CS 2104

  5. Heuristics for Problem Solving(in the small) • Heuristic: A rule of thumb, a way of doing things that might or might not work • Goal of problem-solving heuristics: Help us to overcome our own limitations • Motivation • Working memory • Insight • Process • Emotions.

  6. The Mind Three things that your mind does: • Receives/processes external information • “Displays” stored information • Manipulates information It tends not to do more than one of these well at a time Limited “bandwidth” of attention

  7. Consider Brain ResourcesComputer-Brain Analogy Need to consider “Resource Allocation”: • Memory • Amount of space • Memory Access for input (learning) • Memory Access for output (recall) • Information organization • Executive Functioning like working memory – RAM/Frontal Lobe • Long term memory is storage • The Paradox of Choice book by Barry Schwartz • Processing • Computation • Instruction following • Automatic behaviors • There are many differences! Here’s one reference: • http://scienceblogs.com/developingintelligence/2007/03/27/why-the-brain-is-not-like-a-co/

  8. Externalizing – Expand Bandwidth! • After motivation and mental attitude, the most important limitation on your ability to solve problems is biological: • Working memory is 7 +/- 2 “pieces of information.” • You can't change this biological fact. All you can do is take advantage of your environment to get around it. • That means, you must put things into your environment to manipulate them. • Externalize: write things down, manipulate aspects of the problem (correct representation).

  9. Example • Remember these numbers: 483 and 627 • Now, look away and multiply them in your head.

  10. Ball Bounce Example A rubber ball has the property that, on any bounce, it returns to one-third of the height from which it just fell. Suppose the ball is dropped from 108 ft. How far has the ball traveled the fourth time it hits the ground?

  11. Ball Bounce Clicker Choices • 160 ft • 204 ft • 212 ft • 320 ft

  12. Externalizing • In this example, drawing the picture left your mind free to concentrate on problem solving. • Not drawing is probably hopeless, too much to keep track of. • To be effective, the drawing needs to be set up right – a diagram of some sort makes a big difference. • Externalizing helps you revisit your own thought process • Externalizing helps you share your thought process

  13. Rectangular Board Example A rectangular board is sawed into two pieces by a straight cut across its width. The larger piece is twice the length of the smaller piece. This smaller piece is cut again into two parts, one three times the length of the other. You now have three pieces of board. The smallest piece is a 7-inch square. What was the original area of the surface of the board?

  14. Rectangular Board Clicker Choices • 49 in2 • 147 in2 • 441 in2 • 588 in2

  15. Straight-line Problems Problems along one dimension: distance, money, etc. John has a pretty good salary. In fact if the salary of his older brother, Bob, were suddenly doubled, John would make only 100 dollars less than Bob. Bob’s current salary is 50 dollars more than that of the youngest brother, Phil. John makes 600 dollars per week. What is Phil’s salary? Draw a line and put the information onto the line.

  16. Straight Line Clicker Choices • $300/wk • $350/wk • $600/wk • $650/wk

  17. A Marriage Logic Problem Tom, Diego, Henry, and Al are married to Madeline, Jane, Sue, and Bai, though not necessarily in that order. Jane, who is Diego’s sister, has five children. Tom and his wife want to wait a few more years before starting a family. Tom has never introduced his wife to Sue, who is carrying on an extramarital affair with Diego. (Madeline is considering telling Diego’s wife about it.) Diego and Henry, by the way, are twin brothers. Who is married to whom?

  18. Marriage Logic Clicker Choices Who is Sue’s husband? • Tom • Diego • Henry • Al

  19. Matrix Problems • How can we organize this information? • Matrix works well in this case • Can work on one row/column (e.g., figure out who X is married to. • Can work one fact at a time. • In this case, we will get pretty far. But we’ll be left with a 2 by 2 box for Henry/Al and Jane/Sue. How do we break it? • We need to relate two facts to infer that Diego, Henry, Jane are all siblings.

  20. Coins Example Three boys, Joey, Jimmy, and Pete, have between them nine quarters and a total of $2.55 in quarters and nickels. Joey has three nickels, and Jimmy has the same number of quarters. Jimmy has one coin more than Joey, who has four coins. How many nickels each do Jimmy and Pete have?

  21. Coins Clicker Choices • Jimmy has 3 nickels and Pete has 2 nickels • Jimmy has 2 nickels and Pete has 3 nickels • Jimmy has 1 nickel and Pete has 2 nickels • Jimmy has 2 nickels and Pete has 1 nickel

  22. General Problem Solving Strategies • diagraming/externalizing ideas • rewriting in symbols • divide and conquer • enumerate possibilities • top down/bottom up • solve a simpler problem • solve a similar problem • look for special cases • look for a pattern

  23. Hand-Shaking Problem An anthropologist and her husband attended a party with four other married couples. Whenever two people shook hands, the woman recorded that each of the two people shook hands one time. In that way, for all of them (including herself and her husband), she obtained the total number of times that each person shook hands. She noted that one did not shake hands with one’s own spouse, that is each person did not shake hands with their respective spouse. Then she observed: if she didn’t count herself in the final tally, the other nine people all shook hands a different number of times. That is, one person didn’t shake any hands, one shook only once, up to one person shaking hands of all eight of the others. Q: How many times did her husband shake hands? (For the anthropologist, her number of handshakes Xequals somebody else’s X )

  24. Hand-Shaking Problem • This one is difficult. Its tough to engage. • But there are things that can be figured out. You need to play with it awhile.

  25. Hand-Shaking Problem • This one is difficult. Its tough to engage. • But there are things that can be figured out. You need to play with it awhile. • Hint: People who had zero and maximum possible number of handshakes are “special”.

  26. Hand-Shaking Problem Bigger hint: Can they be a husband and wife? 26

  27. Hand-Shaking Problem Yet another hint: draw the right kind of diagram to show handshakes. Solve a simpler version: just 3 pairs of people. Place H&W next to each other. Draw handshakes. See the pattern. 0 4 27

  28. Hand-Shaking Problem Start building the handshake graph, from the special pair. Next, the person who shook hands 3 times. Next 2. But you must have 2 of those! 0 1 4 3 2 2 28

  29. Hand-Shaking Problem Now let’s build the graph of husband-wife pairs: 4-0 3-1 2-2 0 1 4 3 Anthropologist and Husband 2 2 29

  30. Hand-Shaking Problem So, the the non-unique number occurs half-way between 0 and 4, at 2. You can now guess the answer when the max = 8. It is 4. 0 1 4 3 2 2 30

  31. Definition • heuristic (adj)- involving or serving as an aid to learning, discovery, or problem-solving by experimental and especially trial-and-error methods;- of or relating to exploratory problem-solving techniques that utilize self- educating techniques (as the evaluation of feedback) to improve performance • heuristic (noun) -  the study or practice of heuristic procedure -  a heuristic method or procedure www.merriam-webster.com

  32. Handshaking Problem • Table Approach Adapted from 2011-12 Shaffer & McQuain CS 2104

  33. Hand-shaking Problem Basic Facts Let's arbitrarily let couple #1 be the anthropologist and her husband. No one shakes hands with his/her spouse or herself/himself., so mark those cells with X's. i.e., we make an assumption that has no effect on the nature or existence of a solution Adapted from 2011-12 Shaffer & McQuain CS 2104

  34. HS Problem: Case 8 shakes Suppose the anthropologist's husband shakes hands with 8 people: Mark cells indicating each of those handshakes… … but now we clearly see it's not possible for anyone (excluding the anthropologist) to shake hands with 0 people. Adapted from 2011-12 Shaffer & McQuain CS 2104

  35. HS Problem: Case 7 shakes Suppose the anthropologist's husband shakes hands with 7 people; arbitrarily suppose he does not shake hands with C2H2: Adapted from 2011-12 Shaffer & McQuain CS 2104

  36. HS Problem: Case 7 shakes Then C2H2 is the only eligible person who can shake hands with no one: Adapted from 2011-12 Shaffer & McQuain CS 2104

  37. HS Problem: Case 7 shakes But then, C2W2 is the only person who could have shaken hands with 8 people: But now, no eligible person could shake hands with only one person… Adapted from 2011-12 Shaffer & McQuain CS 2104

  38. HS Problem Continue in like fashion, assuming the anthropologist 's husband shook hands with 6 people, then 5 people, until you find a case that does not lead to a contradiction. Of course, you should also ask whether more than one case might avoid a contradiction… Adapted from 2011-12 Shaffer & McQuain CS 2104

  39. Handshaking in Computer Science Termshttp://www.thenetworkencyclopedia.com/entry/handshaking/ The process that establishes communication between two networking devices. For example, when two computers first connect with each other through modems, the handshaking process determines which protocols, speeds, compression, and error-correction schemes will be used during the communication session. Handshaking is necessary at the start of each session because typically the modems differ in their vendor, model, or hardware/software configuration. The handshake ensures that communication is possible despite these differences. Adapted from 2011-12 Shaffer & McQuain CS 2104

More Related