Problem Solving Methods. CSCE 1062 Outline Problem Solving Methods Problem solving steps The analytical method The algorithmic method The software engineering.

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

Chapter 2: Problem Solving
Problem Solving Concepts
Chapter 1 - An Introduction to Computers and Problem Solving
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
INTRODUCTION TO PROGRAMMING
Algorithm –History Muhammad ibn Musa Al-Khwarizmi www -groups.dcs.st-andrews.ac.uk/~history/Mathematicians/Al- Khwarizmi.html Book on arithmetic:
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with.
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
Algorithm & Flowchart.
COS120 Software Development Using C++ AUBG Fall semester 2010
Programming is instructing a computer to perform a task for you with the help of a programming language.
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Chapter 2: Problem Solving
หลักการโปรแกรม เพื่อแก้ปัญหาโดยใช้คอมพิวเตอร์
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Software Life Cycle What Requirements Gathering, Problem definition
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Looping II (for statement). CSCE 1062 Outline  for statement  Nested loops  Compound assignment operators  Increment and decrement operators.
Value and Reference Parameters. CSCE 1062 Outline  Summary of value parameters  Summary of reference parameters  Argument/Parameter list correspondence.
Design & Analysis of Algorithms Lecture 1 Introduction.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
An Axiomatic Basis for Computer Programming Robert Stewart.
1. Introduction Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Algorithm:a finite set of instructions.
CS-303 Introduction to Programming
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
Algorithms and Pseudocode
Programming Fundamentals Introduction to Problem Solving  Programming is a problem solving activity. When you write a program, you are actually writing.
ICS124 Session 9 Flowcharting 1. By the end of this section the student will be able to:  Name the three structures of the Structure Theorem  Identify.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
CMSC 104, L041 Algorithms, Part 1 of 3 Topics Definition of an Algorithm Example: The Euclidean Algorithm Syntax versus Semantics Reading Sections 3.1.
Algorithms and Flowcharts
Chapter I: Introduction to Computer Science. Computer: is a machine that accepts input data, processes the data and creates output data. This is a specific-purpose.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
Advanced Algorithms Analysis and Design
Algorithms and Problem Solving
INTRODUCTION TO PROBLEM SOLVING
Unit 3: ALGORITHMS AND FLOWCHARTS
DDC 1023 – Programming Technique
Lecture 2 Introduction to Programming
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
Introduction to Computer Programming
Objective of This Course
Chapter 1 Introduction(1.1)
Algorithms and Problem Solving
Basic Concepts of Algorithm
Presentation transcript:

Problem Solving Methods

CSCE 1062 Outline Problem Solving Methods Problem solving steps The analytical method The algorithmic method The software engineering method Exercise - applying software engineering method Flow chart symbols I

CSCE 1063 Problem Solving Methods There is no perfect method for solving all problems. There is no problem-solving computer to which we could simply describe a given problem and wait for it to provide the solution. Problem solving is a creative act and cannot be completely explained. However, we can still use certain accepted procedures to structure our thinking and help us solve problems. Three methods of problem solving are prominent: 1.Analytic Method. 2.Algorithmic Method. 3.Software Engineering Method.

CSCE 1064 Problem Solving Steps Each method has four basic components: 1. Problem: the problem presents the situation that requires a solution. 2. Reasoning: this implies a true comprehension of the problem. 3. Solution: this is the process that we develop to solve the problem. 4. Testing: this is the checking process we use to confirm that the solution is correct.

CSCE 1065 The Analytic Method Analytic problem solving has roots in mathematics, physics, engineering, chemistry, and a host of other areas in science and technology. Example: Problem The sum of two numbers is s and their product is p. Find the 2 numbers. Reasoning Let us call the first number x and the second one y. Therefore, x + y = s and x * y = p. From the first equation we get: y = s - x. Substituting y from the first equation into the second equation, we get: x * (s - x) = p or x 2 - sx + p = 0.

CSCE 1066 The Analytic Method (cont’d) Solution The solution to this problem is the solution to the quadratic equation: x 2 - sx + p = 0, provided that s 2 - 4p  0. This solution is known from the field of mathematics. Testing To check the correctness of the above solution we calculate x + y and x * y.

CSCE 1067 The Algorithmic Approach An algorithm could be defined to be a set of steps that defines how a task is performed. The study of algorithms began as a subject in mathematics. The word “algorithm” is derived from the name of the Arab mathematician, Abu Ja’far Mohammed Ibn Musa Al-Khowarizmi (c. A.D. 825), who wrote a book describing procedures for calculating. Today, computer science has established itself as the science of algorithms. Algorithmic Problem An algorithmic problem is any problem whose solution can be expressed as a list of executable instructions. By executable we mean that an independent executor (human or machine) should be able to carry out the instructions in a step–by–step manner. Algorithms are not unique to the computational sciences. An algorithm is a recipe, a sequence of steps that leads from a starting point to a finished product.

CSCE 1068 An Algorithm

CSCE 1069 An Algorithm (cont’d) Examples of Algorithmic Problems:  Backing a cake.  Knitting a sweater.  Taking the sum of a finite list of numbers.  Sorting a finite list of names.  Playing Tic-Tac-Toe. An algorithm is a sequence of executable instructions with these properties: 1.There is no ambiguity in any instruction. 2.There is no ambiguity about which instruction is to be executed next. 3.The description of the algorithm is finite. 4.Execution of the algorithm concludes after a finite number of steps.

CSCE The Algorithmic Approach (cont’d) Non-Algorithmic Problems Consider the following instructions: Step1:Make a list of the odd positive integers. Step2:Compute their sum. Step3:Compute their average. Step4:Print the average. This is not an algorithm because it is impossible to make an infinite list of numbers, and the problem of finding the sum (or average) of all odd positive integers is not algorithmic.

CSCE Phases of Algorithmic Problem Solving The following loosely defined problem-solving phases were presented by the mathematician G. Poyla in the late 1940s. Phase1:Understand the problem. Phase2:Devise a plan for solving the problem. Phase3:Carry out the plan. Phase4:Evaluate the solution for accuracy and for its potential as a tool for solving other problems.

CSCE Software Engineering Method Software engineering is the area of computer science concerned with building large software systems. Windows 2000 is estimated to have 30 million lines of code. The challenge is that there are tremendous advances in hardware that have not been accompanied by comparable advances in software. Some of the software engineering goals for software are reliability, understandability, cost effectiveness, adaptability, and reusability.

CSCE Software Engineering Phases Problem Analysis - (Correct Problem)  Identify data objects  Goal to model properties  Determine Input / Output data  Constraints on the problem Design (Pseudocode/Flow Chart)  Decompose into smaller problems  Top-down design (divide and conquer)  Think of algorithm

CSCE Software Engineering Phases (cont’d) Implementation  Writing the computer algorithm (e.g. in C++) Testing  Verify the program meets requirements  System and Unit test Documentation  Key part in the development process

CSCE Exercise - Applying Software Engineering Method Problem Analyse, design and implement a C++ program to output the word “Hello!”. Analysis  Input Nothing  Output “Hello!”

CSCE Exercise (cont’d) OUTPUT “Hello!” START STOP Design Implementation (C++) #include using namespace std; void main () { cout << "Hello!"; }

CSCE Flow Chart’s Symbols I Terminals  Start or stop of the program Input/Output  Any input or output operation Flow lines  Indicate the sequence of operations STARTSTOP INPUT OUTPUT

CSCE Hello.cpp // FILE: Hello.cpp // DISPLAYS THE WORD “HELLO” TO THE USER #include using namespace std; void main () { cout << "Hello!"; }

CSCE 10619

CSCE Next lecture we will continue C++