1 / 12

CSC 1750 Problem Solving

CSC 1750 Problem Solving. Spring 2013. References. Sprankle, Maureen and Jim Hubbard, Problem Solving and Programming Concepts , Eighth Edition, Prentice Hall, 2009. Polya, George , How to Solve It, Second Edition, Doubleday Anchor Books, 1957. Types of Problems. Algorithmic solutions

Download Presentation

CSC 1750 Problem Solving

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 1750 Problem Solving Spring 2013

  2. References • Sprankle, Maureen and Jim Hubbard, Problem Solving and Programming Concepts, Eighth Edition, Prentice Hall, 2009. • Polya, George, How to Solve It, Second Edition, Doubleday Anchor Books, 1957

  3. Types of Problems • Algorithmic solutions • Problems that can be solved with a series of actions • Balancing checkbook, baking a cake • Alphabetizing 10,000 names • Heuristic solutions • Problem solution requiring reasoning based on knowledge and experience, and a process of trial and error • Solutions cannot be reached through a direct set of steps • How to buy the best stock or expand the company • Difficult to evaluate the solution

  4. Types of Problems • People are better at solving heuristic problems • Artificial intelligence is the field of computer science that deals with heuristic problems • Computers are better at solving complicated calculus problems or alphabetizing 10,000 names • This class deals with algorithmic solutions

  5. Problem Solving Steps • Identify the problem • Understand the problem • Identify alternative ways to solve the problem • Select the best way to solve the problem from the list of alternative solutions • List instructions that enable you to solve the problem using selected solution • Evaluate the solution

  6. George Pólya's 1945, How to Solve It

  7. George Pólya's 1945, How to Solve It

  8. Problem Solving Techniques • Divide and conquer: break down a large, complex problem into smaller, solvable problems. • Hill-climbing: attempting at every step to move closer to the goal situation. • Means-end analysis: requires the setting of sub-goals based on the process of getting from the initial state to the goal state when solving the problem.

  9. Problem Solving Techniques • Trial-and-error: select a possible answer, apply it to the problem and, if it is not successful, select another possibility. Ends when a possibility yields a solution. • Brainstorming: a group technique designed to generate a large number of ideas for the solution of a problem.

  10. Software Problem Analysis • Analyze the problem to determine: • What equations will be needed • What are the variables and what are their types • What are the inputs and how will they arrive • What are the outputs and where will they be sent • Sequence of events

  11. Example Program One • Enter, compile, and run a program named SquareArea.java to compute the area of a square. The length of the sides will be entered from the keyboard each time the program is run. • Analysis • Equations • area = side2 • Variables and types • area, integer or double • side, integer or double • Inputs • side, input for keyboard • Outputs • area, output to monitor

  12. Example Program One (cont.) • Enter, compile, and run a program named SquareArea.java to compute the area of a square. The length of the sides will be entered from the keyboard each time the program is run. • Analysis • Sequence of events • Declare variables double area; double side; • Input side Declare input stream Read input from keyboard • Calculate area of square area = side * side; • Output area of square System.out.println(“The area of a square with side = “ + side + “is “ + area);

More Related