Class 3'1 - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Class 3'1

Description:

Close your notes, close you laptops ... Imposing unnecessary constraints: ... World View Constraints - unstated constraints imposed by individual's world view. ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 40
Provided by: dmhwa
Category:
Tags: class | imposing | sketch

less

Transcript and Presenter's Notes

Title: Class 3'1


1
Class 3.1
  • Problem Solving Methods
  • and
  • Algorithms

2
RAT 3.1
  • Close your notes, close you laptops or turn off
    your computer monitors.
  • As an individual you have 2 minutes to answer the
    following question.
  • Name two common ways to write or describe an
    algorithm.
  • Answer Flowcharts and pseudocode

3
Learning Objectives
  • Learn to apply the problem solving process
  • Learn techniques for error-free problem solving

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

5
Difficulties in Problem Solving
  • Most common difficulty failure to use known
    information.
  • To avoid this problem
  • Write the problem in primitive form and sketch an
    accurate picture of the setup (where applicable).
  • Transform the primitive statements to simpler
    language.
  • Translate verbal problems to more abstract
    mathematical statement(s) and figures, diagrams,
    charts, etc.

6
More Difficulties in Solving Problems(AGAIN)
  • Imposing unnecessary constraints
  • Association Constraints - unstated constraints
    based on previously learned associations.
  • Function Constraints - unstated constraints based
    on previously learned functions.
  • World View Constraints - unstated constraints
    imposed by individual's world view.

7
Problem Solving Process
  • Define and understand problem
  • Gather information
  • Generate potential methods and solutions.
  • Refine and implement solution.
  • Verify and test solution.

8
Define and Understand
  • Understand what is being asked
  • Describe input/output (I/O)
  • what are you given
  • knowns
  • what are you trying to find
  • unknowns
  • Sketch the problem

9
Gather Information
  • Collect necessary data
  • List relevant equations/theories
  • State all assumptions

10
Generate Solution Methods
  • Apply theories and assumptions.
  • Typically, there is more than one approach to
    solving a problem
  • Work problem by hand using the potential solution
    methods
  • Break problem into parts scale it down etc.
  • e.g., if the problem was to calculate the average
    of 1000 numbers, work the problem by hand using,
    say, 10 numbers, in order to establish a method

11
Refine and Implement
  • Evaluate solution methods.
  • accuracy
  • ease of implementation
  • etc.
  • Implement best solution.

12
Verify and Test
  • Compare solution to the problem statement
  • Is this what you were looking for?
  • Does your answer make sense?
  • Clearly identify the solution
  • Sketch if appropriate

13
CHECK YOUR WORK!!
  • Dont stop at getting an answer!!
  • Think about whether the answer makes physical
    sense.
  • you are the instructor and you have to turn in
    final grades. In your haste, you calculate the
    average of Susies grades (100, 70, 90) to be 78
    and give Susie a C...

14
Getting It Right
  • The problem solving process may be an iterative
    process.
  • If at first you dont succeed (i.e. 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!!

15
Individual Exercise-Revisited (5 minutes)
  • Required
  • a) Sketch the problem
  • b) How many acres of land are contained by the
    cone created by her line of site?
  • c) How high would the balloon be if, using the
    same procedure, an area four times greater is
    encompassed?
  • Given A student is in a stationary hot-air
    balloon that is momentarily fixed at 1325 ft.
    above a piece of land. This pilot looks down 60o
    (from horizontal) and turns laterally 360o.

16
Solution to part A Sketch
  • Given An engineering student is in a stationary
    hot-air balloon that is momentarily fixed at 1325
    ft. above a piece of land. This pilot looks down
    60o (from horizontal) and turns laterally 360o.

17
Solution to part B Algorithm
Fundamental trigonometry relationship tan(30o)
Viewing Radius/Elevation Part a) Viewing
Radius R 1325 tan(30o) 765.0 ft Area pR2
p(765.0 ft)2 1.838 x 106 ft2 Area 1.838 x
106 ft2 (1 acre/43,560 ft2) Area 42.21 acres
18
Solution to part C Heuristic
Part b) Area f(Viewing Radius)2 Therefore
to increase the area by a factor of 4, the
viewing radius must increase by a factor of
2. Viewing Radius f(Elevation) Therefore
to increase the viewing radius by a factor of 2,
the elevation must also increase by a factor of
2. Elevation 2(1325 ft) 2650 ft
19
HOMEWORK FORMAT
  • See Homework Format 111-112.doc on ENGR 111/112
    file server
  • Use this format to solve the balloon problem.
  • Submit your solution as In-Class Assignment 3.1

20
VCR Problem Statement
  • 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. Suppose you want to use
    these tapes to record programs longer than 120
    minutes?

21
Step 1 Understand the Problem
  • You need to know how long to record at the EP
    speed and at SP speed so that the program fits
    exactly on a 120 minute tape. The EP mode does
    not have quality of resolution of the SP mode, so
    you want to record in the EP mode the minimum
    amount of time.

22
Exercise
  • Turn off your monitors or close your laptops.
  • As a TEAM, take 15 MINUTES to develop a solution
    to this problem

23
SOLUTION
  • Let
  • TSP time in SP mode (unknown)
  • TEP time in EP mode (unknown)
  • LP length of program (known)
  • LT length of tape (known)
  • Two unknowns, therefore two INDEPENDENT equations
    needed.

24
Solution
  • Equation for real time
  • TSP TEP LP 1)
  • Equation for tape time
  • TSP (1/3)TEP LT 2)
  • Solve 1) 2) simultaneously for TSP and TEP

25
Solution
  • TEP (3/2)(LP - LT) 3)
  • TSP (3/2)LT - (1/2)LP 4)
  • NOTE LT and LP are KNOWN.
  • Check
  • LT120 min. let LP300 min.
  • then TEP270, TSP30
  • Correct?

26
Develop Method
  • If LP is greater than 3LT then
  • program will not fit on the tape
  • if LP is less than or equal to LT then
  • TSP LP
  • TEP 0
  • otherwise (i.e. LP is between LT and 3LT)
  • TEP (3/2)(LP - LT)
  • TSP (3/2)LT - (1/2)LP

27
Problem Solving Process
  • General Problem Solving Method
  • Define and understand problem.
  • Sketch the problem
  • Gather information.
  • Generate and evaluate potential solutions.
  • Use applicable theories and assumptions.
  • Refine and implement solution.
  • Verify and test solution.

28
Exercise
  • Close your laptops/turn off monitors.
  • dont reopen/turn on until instructed
  • As a TEAM, take 2 minutes to list what you know
    about pseudocode and flowcharts.

29
Algorithms
  • Algorithm a step-by-step procedure for solving
    a problem or accomplishing an end (Webster)
  • Algorithms can be described by
  • Pseudocode
  • Flowcharts

30
Pseudocode
  • (you can reopen laptops/turn on 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

31
Flowcharts
  • Graphical description of algorithm
  • Standard symbols used for specific operations

32
Flowchart Example
33
Flowchart for VCR Problem
Output Program will not fit on tape.
LPgt3LT?
Input LP Input LT
Yes
Start
No
Output Record entire program in SP.
LPLT?
TEP 3/2(LP-LT) TSP 3/2(LT)1/2(LP)
No
Yes
Output TEP Output TSP
End
34
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!!

35
Getting It Right
  • The problem solving process may be an iterative
    process.
  • If at first you dont succeed (i.e. 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!!

36
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. Suppose you want to use
    these tapes to record programs longer than 120
    minutes?

37
Exercise
  • As a TEAM, take 15 MINUTES to develop an
    algorithm to hand in using a flowchart or
    pseudocode to solve the VCR problem.

38
Algorithm (Psedudocode)
  • If LP is greater than 3LT then
  • program will not fit on the tape
  • elseif LP is less than or equal to LT then
  • TSP LP
  • TEP 0
  • else (LP is greater than LT)
  • TEP (3/2)(LP - LT)
  • TSP (3/2)LT - (1/2)LP
  • end

39
Algorithm (Flowchart)
Output Program will not fit on tape.
LPgt3LT?
Input LP Input LT
Yes
Start
No
Output Record entire program in SP.
LPLT?
TEP 3/2(LP-LT) TSP 3/2(LT)1/2(LP)
No
Yes
Output TEP Output TSP
End
40
Think-Pair-Share
  • In the next 1 minute as an Individual...
  • if I only answer one question . . . specifically
    what topics that we have covered so far
    (including today) are still unclear to you at
    least 3 things
  • 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 your list

41
Assignments
  • Assignment 3
  • Due 9/24/02
  • INDIVIDUAL ASSIGNMENT
  • Foundations 3.5, 3.6, 3.12, 3.14
  • Assignment 4
  • Due 9/24/02
  • TEAM ASSIGNMENT
  • Foundations 4.5, 4.6, 4.7, plus VCR problem (if
    not completed in class)
  • YOU MAY USE FLOW CHARTS OR PSEUDOCODE
Write a Comment
User Comments (0)
About PowerShow.com