Problem Solving and Algorithm Design

Slides:



Advertisements
Similar presentations
Problem Solving and Algorithms
Advertisements

Problem Solving and Algorithm Design
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Slides modified by Erin Chambers Problem Solving and Algorithm Design.
Chapter 7 Problem Solving and Algorithms. 2 Chapter Goals Describe the computer problem-solving process and relate it to Polya’s How to Solve It list.
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Problem Solving and Algorithms
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Algorithms and Problem Solving-1 Algorithms and Problem Solving Mainly based on Chapter 6: “Problem Solving and Algorithm Design” from the Book: “Computer.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Algorithms and Problem Solving-1 Algorithms and Problem Solving Mainly based on Chapter 6: “Problem Solving and Algorithm Design” from the Book: “Computer.
Algorithms and Problem Solving
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Chapter 6 Problem Solving and Algorithm Design Nell Dale John Lewis.
6-1 Problem Solving Problem solving is the act of finding a solution to a perplexing, distressing, vexing, or unsettled question.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Problem Solving and Algorithm Design
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
CPS 120: Introduction to Computer Science
Simple Program Design Third Edition A Step-by-Step Approach
Invitation to Computer Science, Java Version, Second Edition.
Problem Solving and Algorithm Design. 2 Problem Solving Problem solving The act of finding a solution to a perplexing, distressing, vexing, or unsettled.
Chapters 7, 8, & 9 Quiz 3 Review 1. 2 Algorithms Algorithm A set of unambiguous instructions for solving a problem or subproblem in a finite amount of.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
CS 1308 Computer Literacy and The Internet Software.
CPS120 Introduction to Computer Programming The Programming Process.
Chapter 6 Problem Solving and Algorithm Design Nell Dale John Lewis.
Chapter 6 Problem Solving and Algorithm Design. 2 Problem Solving Problem solving The act of finding a solution to a perplexing, distressing, vexing,
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Chapter 6 Problem Solving and Algorithm Design. 2 Chapter Goals Apply top-down design methodology to develop an algorithm to solve a problem Define the.
Lecture 13: 10/10/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
2. Program Development Intro Programming in C++ Computer Science Dept Va Tech August 2001 ©2001 Barnette ND & McQuain WD 1 Top-Down Design:A solution method.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Chapter 6 Problem Solving and Algorithm Design. 2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
Problem Solving.  Similar to Solving Math Word Problem  Read the Problem  Decide how to go about Solving the Problem  Solve the Problem  Test the.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Algorithms Sept 4, Tuesday’s Lab You developed an algorithm Input – an 8 ½ x 11 inch piece of paper Audience – Fellow classmates Process – Instructions.
Principles of Programming & Software Engineering
ICS 3UI - Introduction to Computer Science
C++ Plus Data Structures
Problem Solving and Algorithms
Computational Thinking
Problem Solving and Algorithm Design
The Programming Process
Programming We have seen various examples of programming languages
The PlayStation Example
Global Challenge Walking for Water Lesson 2.
Flowcharting & Algorithms
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Basic Concepts of Algorithm
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Presentation transcript:

Problem Solving and Algorithm Design

Problem Solving Problem solving The act of finding a solution to a perplexing, distressing, vexing, or unsettled question.

Problem Solving G. Polya wrote How to Solve It: A New Aspect of Mathematical Method His “How to Solve It” list is quite general. It’s written in the context of solving mathematical problems. With simple wording changes the list becomes applicable to all types of problems.

Ask Questions... …to understand the problem: What do I know about the problem? What is the information that I have to process in order the find the solution? What does the solution look like? What sort of special cases exist? How will I recognize that I have found the solution?

Look for Familiar Things You should never “reinvent the wheel”. In computing, you see certain problems again and again in different guises. A good programmer sees a task, or perhaps part of a task (a subtask), that has been solved before and plugs in the solution.

Divide and Conquer Break up a large problem into smaller units that can be handled more easily. Abstraction plays an important role. The divide-and-conquer approach can be applied over and over again until each subtask is manageable.

Abstraction Abstraction - A mental model that removes complex details. This is a key concept. Abstraction will reappear throughout the course – be sure you understand it! 5

Algorithms Algorithm: A set of instructions for solving a problem or subproblem in a finite amount of time using a finite amount of data. The instructions must be unambiguous.

Example of an Algorithm Preparing a Hollandaise sauce:

Pseudocode … uses a mixture of English and formatting to make the steps in the solution explicit.

Developing an Algorithm Since implementing the algorithm involves making it computer-readable, the plan must be in a suitable form. The methodology (set of working methods) used to make the plan must begin with a problem statement and conclude with a plan that can be easily coded.

Developing an Algorithm Two methodologies are currently used, both based on the divide-and-conquer strategy: Top-down design (functional decomposition) Object-oriented design (OOD)

Top-Down Design … consists of breaking the problem into a set of subproblems called modules. It creates a hierarchical structure of problems and subproblems (modules). This process continues for as many levels as it takes to expand every task to the smallest details. A step that needs to be expanded is an abstract step. A step that needs no more expansion is a concrete step.

Top-Down Design Figure 6.5 An example of top-down design

Top-Down Design Analyze the problem Write the Main Module Write the remaining modules Re-sequence and Revise as necessary

Testing the Algorithm The process itself must be tested. Testing at the algorithm development phase involves looking at each level of the top-down design.

Testing the Algorithm Desk checking: Working through a design at a desk with a pencil and paper. Walk-through: Manual simulation of the design by the team members, taking sample data values and simulating the design using the sample data. Inspection: One person (not the designer) reads the design (handed out in advance) line by line while the others point out errors.