Main course page
  • General

  • TOPIC 1: INTRODUCTION TO PROBLEM SOLVING

    LEARNING OUTCOMES

    By the end of this topics, you will be able to:

    1.      Explain the essence of computational problem solving

    2.     Explain what a computer algorithm is

    3.     Describe about program development life cycle




    1.0 ALGORITHMIC PROBLEM SOLVING

    Algorithms, building blocks of algorithms (statements, state, control flow, functions),  notation (pseudo code, flow chart, programming language), algorithmic problem solving,  simple strategies for developing algorithms (iteration, recursion). Illustrative problems: find  minimum in a list, insert a card in a list of sorted cards, guess an integer number in a  range, Towers of Hanoi.

     

    1.1  Algorithms

    What is algorithm?

    An algorithm is a collection of well-defined, unambiguous and effectively computable instructions ,if execute it will return the proper output.

    well-defined- The instructions given in an algorithm should be simple and defined well.

    Unambiguous- The instructions should be clear,there should not be ambiguity .

    Effectively computable- The instructions should be written step by step ,which helps  computer to understand the control flow .

    We often use algorithm in our day-to-day life,but when and how?

    Our cooking receipe

    Our daily routine as a student

    When we buy something

    When we go outing

    Our class routine

    How it helps?


    How an algorithm should be?

    It should be in simple English,what a programmer wants to say. It has a start,a middle  and an end. Probably an algorithm should have,

    Start

    1.       In the middle it should have set of tasks that computer wants to do and it should be in  simple English and clear.

    2.       To avoid ambiguous should give no for each step.

    Stop

     

    1.2 PROGRAM DEVELOPMENT LIFE CYCLE

    When we want to develop a program using any programming language, we follow a sequence of steps. These steps are called phases in program development. The program development life cycle is a set of steps or phases that are used to develop a program in any programming language.

    Generally, the program development life cycle contains 6 phases, they are as follows:

    • Problem Definition
    • Problem Analysis
    • Algorithm Development
    • Coding & Documentation
    • Testing & Debugging
    • Maintenance

                                                                                         

                                                                         
    Summary

    In this topic, you have learnt that on how to solving a problem.

    When solving a computational problem, either suitable existing algorithms may be found or new algorithms must be developed. Example, for the Traveling Salesman problem, there are various (nontrivial) algorithms that can be utilized, as mentioned, for solving problems with tens of thousands of cities. Finally, for the game of chess, since it is infeasible to look ahead at the final outcomes of every possible move, there are algorithms that make a best guess at which moves to make. Algorithms that work well in general but are not guaranteed to give the correct result for each specific problem are called heuristic algorithms.


    Program Implementation

    Then, you are able to design decisions provide general details of the data representation and the algorithmic approaches for solving a problem. The details, however, do not specify which programming language to use, or how to implement the program. That is a decision for the implementation phase. Since we are programming in Python, the implementation needs to be expressed in a syntactically correct and appropriate way, using the instructions and features available in Python.


    Program Testing

    As humans, we have abilities that far exceed the capabilities of any machine, such as using common sense reasoning, or reading the expressions of another person. However, one thing that we are not very good at is dealing with detail, which computer programming demands. Therefore, while we are enticed by the existence of increasingly capable computing devices that unfailingly and speedily execute whatever instructions we give them, writing computer programs is difficult and challenging. As a result, programming errors are pervasive, persistent and inevitable. However, the sense of accomplishment of developing software that can be of benefit to hundreds, thousands, or even millions of people can be extremely gratifying. If it were easy to do, the satisfaction would not be as great.

     

    Given this fact, software testing is a crucial part of software development. Testing is done incrementally as a program is being developed, when the program is complete, and when the program needs to be updated.

      By refer to this video lecture, you will get better understanding in this topic.

    Duration: 1 hour

    • Self-Check 1.1: Test Yourself(Duration 2 hours) Quiz
      Restricted Not available unless: The activity Topic 1- Video Lecture (1 hour) is marked complete
    • Restricted Not available unless: The activity Self-Check 1.1: Test Yourself(Duration 2 hours) is marked complete
REFERENCES