problem solving methods
DESCRIPTION
Problem Solving Methods. Learning Objectives. Define an algorithm Know what is meant by "decomposition" of a problem Learn how to write algorithms using flowcharts and pseudocodes Know what is meant by "top-down" design method. General Problem Solving Method Define and understand problem - PowerPoint PPT PresentationTRANSCRIPT
Problem Solving Methods
Learning Objectives Define an algorithm Know what is meant by
"decomposition" of a problem Learn how to write algorithms using
flowcharts and pseudocodes Know what is meant by "top-down"
design method
Problem Solving Process
General Problem Solving Method1. Define and understand problem2. Sketch the problem3. Gather information4. Generate and evaluate potential solutions
Use applicable theories and assumptions
5. Refine and implement solution6. Verify and test solution
Exercise Turn off your monitors.
don’t turn on until instructed As an INDIVIDUAL, take 2 MINUTES
to write your definition of an algorithm
As a TEAM, take 2 minutes to combine your answers
Algorithms Algorithm: “a step-by-step
procedure for solving a problem or accomplishing an end” (Webster)
Algorithms can be described by Pseudocode Flowcharts
Pseudocode(you can turn on your monitors now)
English-like description of each step of algorithm
Not computer code Example - take out trash barrels
while there are more barrels
take barrel to street
return to garage
end
Flowcharts Graphical description of algorithm Standard symbols used for specific
operations
Input/Output
Start/Stop
Branch Test
Process Step
Process Flow
Flowchart ExampleDefine theproblem
Readinput
Solve theproblem
Can Isolve this?
Outputresults
What do I needto know?
Ask formore input
Begin
Can Isolve this?
End
yes
no
yes
no
Top Down Design State problem clearly Sketch problem Describe input/output (I/O) Work problem by hand Algorithm: pseudocode or flowchart
Decomposition - break problem into steps
Stepwise refinement - solve each step Test the algorithm/check your work!!
Example (Team exercise, 15 min) State problem clearly:
Given ax2 + bx + c = 0, find x. Describe I/O:
Input: a, b, c Output: x
Example (cont.) Hand example:
a=1, b=4, c=4 equation? (See Chapter 6,
Mathematics Supplement) x=?
Example (cont.) Algorithm development
write an algorithm in pseudocode to take any set of coefficients (i.e., a, b, c) and give the value of x for each set
Test your algorithm a,b,c = 1,4,4 a,b,c = 1,1,-6 a,b,c = 1,0,1 other good test cases?
Example (cont.) CHECK YOUR WORK!!
DO YOUR RESULTS MAKE PHYSICAL SENSE?!?
Getting It Right The problem solving process may
be an iterative process. If at first you don’t succeed (i.e., if the
algorithm test fails), try again… The more thorough you are at
each step of the problem solving process, the more likely you are to get it right the first time!!
VCR Problem Revisited You own a VCR that has two recording and
playback speeds: 1) standard play (SP) and 2) extended play (EP). The speed in the EP mode is 1/3 the speed in the SP mode. At the SP setting, the video tapes you own can be used to record exactly 120 minutes of video. Develop an algorithm that specifies how long to record at SP speed, and how long to record at EP speed, given a program of known length.
Exercise As a TEAM, take 15 MINUTES to
solve the VCR problem by developing a flowchart algorithm.
The flowchart algorithm will be handed in.
Think-Pair-Share In the next 1 minute as an individual...
Identify three topics that we have covered so far (including today) that are still unclear
Now take 2 minutes to merge your list with the person sitting next to you AND add 1 new item to the list.
In the next 5 minutes, share the results with the other half of your team, delete questions that you can answer for each other, AND prioritize the remaining questions in your list.