You are on page 1of 9

Algorithms

Story
Characteristics
Parts
Phases

By Maria Carnal Bernal 9C


Story of an algorithm
The word algorithm comes from the name Abu Addullah Muhammad,
a mathematician who lived between the 8th and 9th centuries.
His books were easy to read so he did not want to create new
theorems or new methods of thinking, but wanted to put the basic
mathematical thinking so that it could be understood by a large
number of people.
I explain that through a clear explanation of how to calculate
systematically it was possible to create algorithms that were used in
devices, to which also said that the number of steps could be reduced
to make a calculation.
In the 19th century, the first algorithm for a computer was created,
created by Ada Bryon.
This idea was put in place since ancient times, David Hilberts wanted
to discover the algorithm of algorithms and thanks to other thinkers it is
known that every problem has a computable part so these algorithms
can be essential today as we are surrounded by problems and we live
in a world of electronic devices where technology is essential.
Characteristics of the
algorithm
1. Finiteness: An algorithm always have to finish in a exact number of
steps.

2.Definiteness: Each step of an algorithm must be precisely defined;


the actions to be carried out must be explained and in order.
Different steps must carried to the same solution.

3. Effectiveness: All of the operations to be performed in the algorithm


must be sufficiently basic, so people can do with facility in a finite
length of time.
Parts of an algorithm
1. Input: An algorithm has one or more inputs, those are the quantities
which are given to it initially before the algorithm begins.

2. Process. An algorithms always have a process that are the


different steps or procedure to resolve a problem.

3. Output: An algorithm has one or more outputs, those are the


possible results when we finish doing the algorithm.
Phases of an algorithm
1. Definition of Problem: The problem must be defined and must be
understood easily so that it can be analyzed in detail.

2. Problem Analysis: The purpose of the analysis is to help the


programmer to come to a certain understanding of the problem. The
problem must be well defined if a satisfactory solution is to be reached.

3. Algorithm Design: Determines the steps of the algorithm in the


logical order of execution depends on the way the entire program is
developed.

4. Coding: Known as the programming language.

5. Debugging: It is viewed and re-analyzed so that there is no error and


a solution can be reached.

6. Compilation: Look that the grammar is fine, transcribe everything


again and finally it is passed to a USB.

7. Maintenance: It takes place after finishing the program when it is


detected that we must make a change to complement that work.
Example of algorithm
An algorithm to fill a glass of water:
1- Take the glass.
2- Open the tap.
3- Place the glass under the tap.
4- Wait for the glass to fill.
5- Remove the glass.
6- Turn off the tap.

An algorithm to wash our hands:


1. Open the water tap.
2. Wet your hands.
3. Apply soap.
4. Rinse hands.
5. Turn off the water tap.
6. Dry hands with paper.
7. Expose hands to hot air stream.

An algorithm to change the rim of a car.


1. Lift the car with the cat.
2. Loosen and remove the rim bolts.
3. Remove the rim.
4. Replace spare tire.
5. Install and tighten the bolts.
6. Lower the cat.
Examples of flowchart
A flow chart is a diagrammatic representation that illustrates the
sequence of operations that are performed to get a solution to a
problem and are normally used to follow the logical sequence of
actions in the design of computer problems and are usually drawn
before start programming the code in front of the computer and one
that draws the flow diagram, it arrives to make it easy to write the
program in any high level language (algorithm).
Examples of pseucode
The pseudocode is a way of writing the steps that a program will
perform in the way that is closest to the programming language that we
are going to use later, we write it in our native language and then pass
it to a language in such a way that it can be written and executed.
Perform the pseudocode to sprite the area of a rectangle.
Program; area
Environment: BASE, HEIGHT, AREA are integers
Write "Enter base and height"
Read BASE, HEIGHT
Calculate AREA = BASE * HEIGHT
Write "The area of the rectangle is" AREA

Perform the pseudocode that allows to enter two notes by keyboard, calculating the sum and
the product of the notes.
Program: Sumay product
Environment: NOTE1, NOTE2, SUM, PRODUCT are integers
Write "Enter the notes"
Read NOTE1, NOTE2
Calculate SUM = NOTE1 + NOTE2
Calculate PRODUCT = NOTE1 * NOTE2
Write "The sum of the two notes is:" SUM
Write "The product of the two notes is:" PRODUCT

Perform the pseudocode that lets you know if a number is greater, less than or equal to zero.
Program: Compare numbers
Environment: NUMBER is an integer
Type "Enter a number"
Read NUMBER
YES NUMBER> 0 THEN
Write "The number entered is positive"
YES NO YES NUMBER <0 THEN
Write "The number entered is negative"
IF NOT
Write "The number is zero"
Example of diagram N-S
The N-S diagrams are a mixture between the flowcharts and the
pseudocode.
Instead of the arrows are occupied rectangles placed in succession,
within each rectangle is placed the instruction in the form of
pseudocode or another set of rectangles or symbols to represent a
condition or cycle.

You might also like