DOC PREVIEW
PSU METBD 050 - Problem Solving Notes

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

METBD 050Problem Solving With A ComputerMETBD 050 Problem Solving With A ComputerWe are concerned with solving problems using a computer. This class of problems are generally well stated – they provide enough information so that the problem can be solved. Sometimes, assumptions have to be made by the problem solver.A well-stated problem describes the current or initial state that is to be transformed into some other state, which is the solution or results.Given and Results - information is usually pretty straight forward.- Normally descriptive – nouns and adjectivesTransformations:- The process involved in going from the given to the results.- Obvious information or things that can be reasonably assumed are often not given.- May not be straightforward- May be left up to the inventiveness and ingenuity of the problem solver- Usually stated in verbs and adverbsConcept:“What must be done to change (action, verb) what is given (descriptive, noun) into what is required (descriptive, noun)?”Example: Express the temperature 85 degrees Fahrenheit (F) in degrees centigrade (C).Initial Situation: the temperature is 85°FFinal Situation: want the temperature in degrees centigradeTransformations: The only verb is express – doesn’t give a clue to how to make the transformation. Upon reflection, we see that the action is really “convert” though the how is unspecified and left up to the solver. We need to determine a tool to use:Conversion chartAlgebraic equationAssume we find the formula 932F5C)( . If we further assume that the operation of this tool is known – we have the necessary skills to evaluate the expression, we can create this diagram of our problem solution:INPUT TRANSFORMATION OUTPUTTi = 85°F 1. Get initial temperature, Ti2. Compute degrees centigrade: C = 5 * (Ti – 32) / 93. Output the solutionTemp. in Degrees Centigrade, CWhen developing transformations, it is important to work from a very broad and general statement of the transformations to a detailed and very specific statement of the PROCESS. Testing for correctness by hand can occur at any time that seems appropriate, but it must certainly be done with the “final” process. If an HO-050-ProblemSolvingNotes.doc Page 1 of 41/19/05TRANSFORMATIONRequired Situation RESULTS or OUTPUTInitial Situation GIVEN or INPUTerror is found, the process must, of course, be corrected. If a process appears to be without error, it may be accepted as final, though, it may still contain errors.The flowchart for the preceding example could be:The process, or Algorithm, is the set of detailed, unambiguous, and ordered instructions developed to describe the transformations necessary to go from the initial (given) situation to the final (required) situation. The following are required properties of an algorithm:1. It must be sufficiently detailed to describe the transformations necessary to solve the problem.2. It must be unambiguous, so that anyone can perform the transformations correctly every time.3. It must always give the same results for the same initial conditions.4. It must give correct results in all cases. A process must meet these criteria to be considered an algorithm. In computer programming, the process used to solve the problem must be an algorithm. An algorithm can be thought of as a series of one or more well-known operations. In order for an operation to be well known, it must meet the requirements of an algorithm. Example: The problem is to find the sum of two numbers.INPUT TRANSFORMATION OUTPUTTwo numbers Get the numbersADD the first to the secondDisplay the resultsSumOur operation is ADD. Is ADD a well known operation?1. Is ADD sufficiently detailed to describe the necessary transformations? Yes. We know how to add.2. Is it unambiquous? Yes.3. Does it always give the same results? Yes.4. Does it give the correct result? Yes. (we assume that the addition is done correctly.)Add can be considered to be a well-known operation. The distinction between an algorithm and an well-known operation depends on the user’s knowledge. To a child, ADD must be described in simpler operations, such as counting. HO-050-ProblemSolvingNotes.doc Page 2 of 41/19/05StartEndGet Temp, TiC = 5 * (Ti – 32) / 9Display Temp, C5 Things a Computer Can Do:Algorithms that are to be performed by a computer must be stated in terms well known to computers. One must, therefore, become familiar with the few operations that computers can perform. Five of these operations are:1. Perform arithmetic: add, subtract, multiply, and divide numbers.2. Compare two pieces of information and select one of two alternative actions, depending on the outcome of the comparison.3. Receive and put out information.4. Repeat any group of operations.5. Save any piece of information for later use.Any algorithm to be used on a computer must be stated in terms of the five well-known computer operations.(Taken from: Program Design with Pseudocode by T.E. Bailey and Kris Lundgaard, Brooks/Cole Publishing Co., Monterey, CA, 1983.)Excel Example:Convert the temperature example from earlier to Excel:1. Worksheets should have a description of what they do at the top.2. You may want to organize your worksheet by identifying what is given, what is to be found, what the computations are, and what the results are.3. Often, the contents of a cell are identified by text in adjacent cells which we call labels. Examples are in A5 and A8.4. Note that the typical units are included in C5 and C8 to guide the user to input the proper values.5. The final solution is usually highlighted in some way. In this case, the solution is bold.6. All worksheets should be checked using hand-calculations on engineering calculation paper.CHECKSC4429932855932F5C  .)()(7. Does our worksheet work for all temperatures given in degrees Fahrenheit?8. Expand the solution of this problem to also convert the temperature to degrees Kelvin and degrees Rankine. These are temperatures measured on the absolute scales (defined by the absolute minimum possible temperature) with respect to °C and °F respectively.For general information:Degrees Kelvin = degrees C + 273.2Degrees Rankin = Degrees F + 459.7HO-050-ProblemSolvingNotes.doc Page 3 of 41/19/05A B C D1 This worksheet converts temperatures given in °F2 to temperatures in °C.34 Given:5 Temperature = 85.00 °F67 Results:8 Temperature = 29.44 °C9Note: The degree symbol is obtained


View Full Document

PSU METBD 050 - Problem Solving Notes

Download Problem Solving Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Problem Solving Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Problem Solving Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?