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:

MET 107 Problem Solving With A ComputerMET 107 Problem Solving With A Computer We 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. Initial Situation GIVERequired Situation RESULTS oTRANSFORMATION N o INPUT OUTPUTr r Given and Results • information is usually pretty straight forward. • Normally descriptive – nouns and adjectives Transformations: • 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 adverbs Concept: “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°F Final Situation: want the temperature in degrees centigrade Transformations: 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 chart Algebraic equation Assume 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 OUTPUT Ti = 85°F 1. Get initial temperature, Ti 2. Compute degrees centigrade: C = 5 * (Ti – 32) / 9 3. Output the solution Temp. in Degrees Centigrade, C When 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 107-ProblemSolvingNotes.docx Page 1 of 4 1/19/05, 9/7/07error 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: Start Get Temp, Ti C = 5 * (Ti – 32) / 9 Display Tem p, C End 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 OUTPUT Two numbers Get the numbers ADD the first to the second Display the results Sum Our 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. 107-ProblemSolvingNotes.docx Page 2 of 4 1/19/05, 9/7/075 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: 107-ProblemSolvingNotes.docx Page 3 of 4 1/19/05, 9/7/07 ABC1 This worksheet converts temperatures given in °F2 to temperatures in °C.34Given:5 Temperature = 85.00 °F67Results:8 Temperature = 29.44°C9DCell Formula, B8: = 5 * (B5 – 32) / 9Note: The degree symbol is obtained by: 1. Press and hold down the Alt key. 2. Using the keypad, type the number 248. 3. Release the Alt key to display the symbol. Or On the Insert Tab, select Symbol from the Text group. Select the “Symbol” font to find the degree symbol. 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.


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?