problem solving methods

17
Problem Solving Methods

Upload: taipa

Post on 07-Jan-2016

35 views

Category:

Documents


3 download

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 Presentation

TRANSCRIPT

Page 1: Problem Solving Methods

Problem Solving Methods

Page 2: 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

Page 3: Problem Solving Methods

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

Page 4: Problem Solving Methods

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

Page 5: Problem Solving Methods

Algorithms Algorithm: “a step-by-step

procedure for solving a problem or accomplishing an end” (Webster)

Algorithms can be described by Pseudocode Flowcharts

Page 6: Problem Solving Methods

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

Page 7: Problem Solving Methods

Flowcharts Graphical description of algorithm Standard symbols used for specific

operations

Input/Output

Start/Stop

Branch Test

Process Step

Process Flow

Page 8: Problem Solving Methods

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

Page 9: Problem Solving Methods

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!!

Page 10: Problem Solving Methods

Example (Team exercise, 15 min) State problem clearly:

Given ax2 + bx + c = 0, find x. Describe I/O:

Input: a, b, c Output: x

Page 11: Problem Solving Methods

Example (cont.) Hand example:

a=1, b=4, c=4 equation? (See Chapter 6,

Mathematics Supplement) x=?

Page 12: Problem Solving Methods

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?

Page 13: Problem Solving Methods

Example (cont.) CHECK YOUR WORK!!

DO YOUR RESULTS MAKE PHYSICAL SENSE?!?

Page 14: Problem Solving Methods

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!!

Page 15: Problem Solving Methods

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.

Page 16: Problem Solving Methods

Exercise As a TEAM, take 15 MINUTES to

solve the VCR problem by developing a flowchart algorithm.

The flowchart algorithm will be handed in.

Page 17: Problem Solving Methods

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.