Computational Thinking - part 2

The Structured Approach

The structure approach is a way to improve clarity and make the program look nicer and easier to understand. Using this approach, we will need only 3 basic programming structures:

  1. Sequence - one statement after another
  2. Selection - if ... then ... else ... endif and switch ... endswitch statements
  3. Iteration - for loops

Tools for designing an algorith

There are two common tools used to design algorithms:

Pseudocode

There is no exact way to write it, just make it clear.

Flowchart

Draw an algorith in a chart like the example below, with each shape containing the next step of the program

Thinking Concurrently

Unlike parallel computing, concurrently computing takes place when several processes run at a time, like the scheduling homework we had long time ago. In short, multiple processes are ran in the same proccessor while given a slice of its time.

The benefits of concurrent programming are that it completes more tasks in a given time and it won't waste time until another input.
The drawback is when a large amount of users trying to run programs, and some of these take a lot of time, these programs will take more time to complete.

On the other side, the benefis of parallel programming are faster rendering 3D objects, be faster when there are large programs as the other processors work
on something else. It falls short as some tasks will run faster in concurrent programming.

Problem Recognition

A computable problem is one that can be solved if there is an algorithm that can solve it in a finite amount of steps. Although some problems are computable, it will take millions of years to solve, which is practically, unsolvable.

There are several methods of problem solving:

Listing all cases - Check every possibility, inefficient

Theoretical approach - Are faster and use theory to solve (the book was very vauge regarding it)

Simulation - quite simply, create a simulation of a problem using abstraction.

I assume creative solution is for the programmer to decide how he solves the problem, the book just missed it.

Strategies for problem solving

Divide and Conquer - explained terribly, used binary search as an example, said to halve the size of the problem.

Problem abstraction - simplify the problem by removing unneccessery detail, making it abstract.

Automation - creates from a scenario a mathematical model which when automated creates the automaton.

Problem Solving Methods