0% found this document useful (0 votes)
3 views

CH1 General Problem Solving Concepts

Chapter 1 outlines the general concepts of problem solving, emphasizing a six-step process: identifying the problem, understanding it, identifying alternatives, selecting the best solution, listing instructions, and evaluating the solution. It distinguishes between algorithmic and heuristic solutions, noting that while computers excel at algorithmic problems, humans are better at heuristic ones. The chapter also highlights common difficulties in problem solving, such as inadequate solution steps and incorrect problem definitions.

Uploaded by

Hamza Sayes
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CH1 General Problem Solving Concepts

Chapter 1 outlines the general concepts of problem solving, emphasizing a six-step process: identifying the problem, understanding it, identifying alternatives, selecting the best solution, listing instructions, and evaluating the solution. It distinguishes between algorithmic and heuristic solutions, noting that while computers excel at algorithmic problems, humans are better at heuristic ones. The chapter also highlights common difficulties in problem solving, such as inadequate solution steps and incorrect problem definitions.

Uploaded by

Hamza Sayes
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Chapter 1: General Problem-

Solving Concepts

SW 100: Principles of Programming and Problem Solving

1
What is problem solving

Problem solving in daily life

• The six steps in problem solving


• The problem of what to do this evening

Types of the problem


Overview
Problem Solving with computers

• Terminologies

Difficulties with Problem Solving

2
• Problem solving is
the process of
transforming the
description of a
problem into the
solution of that
Problem problem by using
our knowledge of
Solving the problem domain
and by relying on
our ability to select
and use appropriate
problem-solving
strategies,
techniques, and
tools.

3
Problem solving in daily life

• People make decisions every day to solve problems that affect their
lives.

• If a bad decision is made, time and resources are wasted, so it’s


important that people know how to make decisions well.

• There are six steps to follow to ensure the best decision.

4
The six steps in problem solving

6- Evaluate the solution 1- Identify the


problem

5- List instructions

2- Understand the problem

4- Select the best way to 3- Identify alternatives


solve the problem

5
The six steps in problem solving[1-5]

• Identify the problem.


• written assignments vs problems out of a book.

•2. Understand the problem.


• Understanding the knowledge base of the person or machine for whom you are
solving the problem.

• Knowing the knowledge base is very important since you cannot use any
instructions outside this base.

6
The six steps in problem solving[2-5]

3. Identify alternative ways to solve the problem


A. This list should be as complete as possible.

B. Alternative solutions must be acceptable ones.

C. You might want to talk to other people to find other


solutions than those you have identified.

7
The six steps in problem solving[3-5]

4. Select the best way to solve the problem from the list of alternative solutions
A. Select criteria for the evaluation.

B. Identify and evaluate the pros and cons of each possible solution before selecting
the best one based on the selected criteria.

8
The six steps in problem solving[4-5]

5. List instructions that enable you to solve the problem using the selected solution.
A. These numbered, step-by-step instructions must fall within the knowledge base set
up in step 2.

B. No instruction can be used unless the individual or the machine can understand it.

9
The six steps in problem solving[5-5]

6. Evaluate the solution


A. Means check its result to see if it is correct, and to see if it satisfies the needs of
the person(s) with the problem.

B. If the result is either incorrect or unsatisfactory, then the problem solver must
review the list of instructions to see that they are correct or start the process all
over again.
• (When a person needs a piece of furniture to sleep on, buying her a cot may be a correct
solution, but it may not be very satisfactory.)

10
Problems examples

•People solve problems daily at home, or work, or wherever they go.

•At home:
• what to cook for dinner
• which movie to see this evening
• which car to buy
•At work:
• The problems might involve dealing with:
• work policies
• Management
• Customers

The better the decisions an employee can make, the more valuable that person will be to the company.
In each case, the six steps in problem solving can be followed. Most people use them without even knowing it

11
The problem of what to do this evening

1. Identify the problem:


• How do the individuals wish to spend the evening?

2. Understand the problem.


• The knowledge base of the participants must be considered.
• The only solutions that should be selected are ones that everyone involved would know how to do.
• Example?
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.

12
The problem of what to do this evening

3. Identify alternatives.
a. Watch television.
b. Invite friends over.
c. Play video games.
d. Go to the movies.
e. Play miniature golf.
f. Go to the amusement park.
g. Go to a friend’s party.

Note: The list is complete only when you can think of no more alternatives.

13
The problem of what to do this evening

4. Select the best way to solve the problem.


a. Weed out alternatives that are not acceptable, such as those that cost too much
money or do not interest one of the individuals involved.

b. Specify the pros and cons of each remaining alternative.

c. 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.

14
The problem of what to do this evening

5. Prepare a list of steps (instructions) that will result in a fun


evening.

6. Evaluate the 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.

15
Problems with …
• Algorithmic solutions:
• Solutions that can be reached with a series of actions

Types of • Example: baking a cake.


• These steps are called the algorithm.
Problems • Heuristic solutions
• Solutions that cannot be reached through a direct set
of steps
• Example: how to buy the best stock or whether to
expand the company.

16
Types of Problems

• Combination of algorithmic, heuristic solutions


• The problem solver can use the six steps for both of them.

• However, in step 6, evaluating the solution, the correctness and appropriateness of


heuristic solutions are far less certain. Why?

• Most problems require a combination of the two kinds of solutions.

17
Problem Solving with Computers

Terminologies:
• Solution  instructions followed to produce best result
• Result  outcome, computer-assisted answer
• Program  instructions for solution using computer language
• Algorithm  a step by step solution to a problem.

18
Problem Solving with Computers

People are better than


Computers are built to deal
computers at developing
with algorithmic solutions.
heuristic solutions.

The field of computers that


deals with heuristic types of
How?
problems is called artificial
intelligence.

19
• Lack of problem solving
experience
• Inadequate solution steps
Difficulties with • Incorrect problem definition

Problem Solving • Alternatives chosen incorrectly


• Invalid logic
• Incorrect solution evaluation

20
Difficulties with Problem Solving

When solving problems on the computer, one of the most difficult tasks for the problem
solver is writing the instructions.

Task:
Which number is the largest from a group of three numbers?

• Input: Take three numbers as input (let's call them num1, num2, and num3).
• Initialize: Set a variable largest to one of the numbers (for simplicity, let's assume num1 is the largest for now).
• Compare: Compare num2 with largest. If num2 is greater than largest, update largest to num2.
• Compare: Compare num3 with largest. If num3 is greater than largest, update largest to num3.
• Output: The variable largest now contains the largest number among the three.

21
End Chapter 1

22

You might also like