Problem Solving and Programming Concepts PDF

Document Details

InnocuousGraffiti

Uploaded by InnocuousGraffiti

2012

Maureen Sprankle and Jim Hubbard

Tags

problem solving programming concepts algorithmic solutions computer science

Summary

This document explains different problem-solving approaches, including algorithmic and heuristic methods. It details six common steps in solving a problem and illustrates how these steps might be applied to everyday life and programming problems.

Full Transcript

Chapter 1 General Problem Solving Concepts Problem Solving and Programming Concepts 9th Edition By Maureen Sprankle and Jim Hubbard Copyright © 2012 Pearson Education, Inc. Overview Problem Solving in Everyday Life...

Chapter 1 General Problem Solving Concepts Problem Solving and Programming Concepts 9th Edition By Maureen Sprankle and Jim Hubbard Copyright © 2012 Pearson Education, Inc. Overview Problem Solving in Everyday Life Types of Problems Problem Solving with Computers Difficulties with Problem Solving Copyright © 2012 Pearson Education, Inc. 0-2 Objectives 1. Describe difference between heuristic, algorithmic solutions. 2. List, describe problem-solving steps for algorithmic solution. 3. Use problem-solving steps to solve problem. Copyright © 2012 Pearson Education, Inc. 0-3 Problem Solving in Everyday Life 1. Identify the problem. 2. Understand the problem. 3. Identify alternative ways to solve problem. 4. Select best alternative. 5. List solution steps for alternative chosen. 6. Evaluate solution. Copyright © 2012 Pearson Education, Inc. 0-4 Problem Solving in Everyday Life 1. Identify the problem How do the individuals wish to spend the evening? Copyright © 2012 Pearson Education, Inc. 0-5 Problem Solving in Everyday Life 2. Understand the problem The knowledge of the participants must be considered. The only solutions that should be selected are ones that everyone involved would know how to do. You probably would not select as a possible solution playing a game of chess if the participants did not know how to play. Copyright © 2012 Pearson Education, Inc. 0-6 Problem Solving in Everyday Life 3. Identify alternative ways to solve problem (Possible solutions) ✓ Watch television. ✓ Invite friends over. ✓ Play video games. ✓ Go to the movies. ✓ Play miniature golf. ✓ Go to the amusement park. ✓ Go to a friend’s party. The list is complete only when you can think of no more alternatives. Copyright © 2012 Pearson Education, Inc. 0-7 Problem Solving in Everyday Life 4. Select best alternative ▪ Eliminate alternatives that are not acceptable, such as those that cost too much money or do not interest one of the individuals involved. ▪ Specify the pros and cons of each remaining alternative. ▪ Weigh the pros and cons to make the final decision. This solution will be the best alternative if all the other steps were completed well. (Filtering, Defining pros and cons, Weight pros and cons) Copyright © 2012 Pearson Education, Inc. 0-8 Problem Solving in Everyday Life 5. List solution steps for alternative chosen Prepare a list of steps (instructions) that will result in a fun evening Copyright © 2012 Pearson Education, Inc. 0-9 Problem Solving in Everyday Life 6. Evaluate solution Are we having fun yet? If nobody is having fun, then the planner needs to review the steps to have a fun evening to see whether anything can be changed, if not then the process must start again. Copyright © 2012 Pearson Education, Inc. 0-10 Types of Problems Problems with … Algorithmic solutions Heuristic solutions Combination of algorithmic, heuristic solutions Copyright © 2012 Pearson Education, Inc. 0-11 Types of Problems Problems with Algorithmic Solutions: Is a problem that can be solved with a series of actions. Example: Balancing a checkbook Once the alternatives have been eliminated, and a solution has chosen as the best among several methods of balancing the checkbook, the solution can be reached by completing the actions in steps. Copyright © 2012 Pearson Education, Inc. 0-12 Types of Problems Problems with Heuristic Solutions Solutions as buy the best stock or whether to expand the company, are not straightforward. These solutions require reasoning built on knowledge and experience, and a process of trial and error. Solutions that cannot be reached through a direct set of steps are called heuristic solutions Copyright © 2012 Pearson Education, Inc. 0-13 Types of Problems Problems with Combination of algorithmic and heuristic solutions A solution may not be correct and satisfactory at another time, so the problem solver may have to reevaluate and resolve the same problem later. For instance, the stock that did well in January may do poorly in June. Most problems require a combination of the two kinds of solutions. Copyright © 2012 Pearson Education, Inc. 0-14 Types of Problems The problem solver can use the six steps for both algorithmic and heuristic solutions. However, in step 6, evaluating the solution, the correctness and appropriateness of heuristic solutions are far less certain. Example: It’s easy to tell if your completed checkbook balance is correct and satisfactory, but it’s hard to tell if you have bought the best stock. Copyright © 2012 Pearson Education, Inc. 0-15 Problem Solving with Computers Definitions: Solution  instructions followed to produce best result (Step 5) Result  outcome, computer-assisted answer Program  instructions for solution using computer language Copyright © 2012 Pearson Education, Inc. 0-16 Problem Solving with Computers Computers are built to deal with algorithmic solutions, which are often difficult or very time consuming for humans. People are better than computers at developing heuristic solutions. Example: The problem of how to throw a ball or how to speak English is not. The difficulty lies in the programming. How can problems such as how to throw a ball or speak English be solved in a set of steps that the computer can understand? The field of computers that deals with heuristic types of problems is called Artificial Intelligence Copyright © 2012 Pearson Education, Inc. 0-17 Difficulties with Problem Solving Lack of problem solving experience Inadequate solution steps Incorrect problem definition Alternatives chosen incorrectly Invalid logic Incorrect solution evaluation Copyright © 2012 Pearson Education, Inc. 0-18 Difficulties with Problem Solving Lack of problem solving experience Afraid to make a decision for fear it will be the wrong one Inadequate solution steps Overlapping between solution steps Incorrect problem definition Incomplete knowledge about the problem Copyright © 2012 Pearson Education, Inc. 0-19 Difficulties with Problem Solving Alternatives chosen incorrectly Incomplete set of alternatives, or eliminate good alternatives Invalid logic Incorrect logical sequence of steps in their solution, or focus on details before define the solution framework Incorrect solution evaluation Wrong evaluation parameters Copyright © 2012 Pearson Education, Inc. 0-20

Use Quizgecko on...
Browser
Browser