Chapter 7 Problem Solving and Algorithms
- This is probably the most important chapter of the book.
- Learning the underlying technology is nice, but not critical.
- Learning the technical skill of programming is a mechanical process.
- Learning applications is useful but not critical.
- Learning how to solve problems, so that we can use all of the above is a critical issue.
- Unfortunately, I am not sure I know how to teach this skill in class.
- I learned it by working with my Dad almost every night and weekend on projects.
- With him making fun of me when I did dumb things.... Thanks Dad!
- I learned it in Boy Scouts
- In the various challenges they threw at you as you progressed through the ranks.
- I learned it in school, again by the challenges and problems.
- The book introduces Polya
- He wrote a book called How to Solve It
- This is a great reference, and worth a read.
- Especially if you struggle as a problem solver.
- But it is aimed at math problems.
- And it is slightly strange.
- Polya's steps
- Understand the problem.
- What are you asked to do? Show? Find?
- Can you restate the problem in your own words?
- Can you draw a picture/diagram?
- Do you have enough information to find a solution?
- Do you understand all of the words/terms?
- Do you need to ask questions/seek clarification?
- Make a plan to solve the problem.
- This is not necessarily the algorithm we are discussing, but that fits.
- He lists a bunch of problem solving strategies.
- And go from general to specific.
- Cary out the plan
- If you have done a good job of planning, this should be easier.
- But you may encounter problems.
- Work through them.
- Evaluate your work
- Did your plan work, could you have done better?
- Use this to improve both your solution and your problem solving techniques.
- Some of Polya's Strategies include
- Ask questions.
- This is more to explore the problem space than anything.
- I find if you can come up with a good question, you show you understand things.
- NOT TRIVIAL QUESTIONS.
- This takes real work.
- Look for Familiar things
- We (will soon) study classical algorithms to see how people have done things in the past.
- If this applies, use it.
- Don't reinvent the wheel.
- Divide and Conquer
- We will spend a lot of time on this in the future.
- Can I break this into smaller problems? (YES)
- Solve the smaller problems leads to a solution to the bigger problem.
- The computer problem solving process
- We have looked at this before.
- Analyze the problem
- Develop and Algorithm
- Implement the Algorithm
- Maintenance.
-
- Look at my Homework Assignment for 230
- Why is each component part of this assignment?