Everyone gets excited when its summer time because it means no more school for a while. We get to do different things and visit family. Every day is a new activity. But during the school period you do the same thing every week day, especially in the mornings. If you write down everything you do in the morning in the order that you do them, that is called an algorithm. You can also call the series of steps you take to solve a math problem an algorithm.
Explore our app and discover over 50 million learning materials for free.
Lerne mit deinen Freunden und bleibe auf dem richtigen Kurs mit deinen persönlichen Lernstatistiken
Jetzt kostenlos anmeldenNie wieder prokastinieren mit unseren Lernerinnerungen.
Jetzt kostenlos anmeldenEveryone gets excited when its summer time because it means no more school for a while. We get to do different things and visit family. Every day is a new activity. But during the school period you do the same thing every week day, especially in the mornings. If you write down everything you do in the morning in the order that you do them, that is called an algorithm. You can also call the series of steps you take to solve a math problem an algorithm.
In this article, we will learn about algorithms, their properties and their applications.
An algorithm shows the order in which a process should be followed for an event to occur or for a problem (a mathematical problem) to be solved.
Almost every activity you can think of has an algorithm. Your morning routine has an algorithm. The recipe for your food and how you prepare it has an algorithm. The process of building a house has an algorithm. Basically, anything you can think of that involves a series of processes has an algorithm. For example if you want to make a cup of tea in the morning you'll probably follow the steps below.
Step 1 - Boil water in a kettle
Step 2 - Put a tea bag in a cup
Step 3 - Pour the boiled water into the cup
Step 4 - Add milk to the tea
Step 5 - Add sugar to the tea
Step 6 - Stir the tea
Step 7 - Drink the tea
The above steps make up an algorithm for preparing a cup of tea.
An algorithm should contain an input, the process to be carried out and the desired output. Apart from your everyday activities, algorithms also help in problem-solving. When the process for solving a problem is properly outlined in the correct order, the problem will be more easily solved.
Algorithms are very essential, especially for mathematicians, computer scientists and programmers. Before they attempt to solve any problem, they must, first of all, write down the steps to be taken to solve the problem in the correct order. This helps to solve the problem quickly because there is a clear path to follow.
The steps that makes up an algorithm can also be represented in other forms like in a flow chart. To see what a flow chart looks like and to know more about it, check out the article on Charts and diagrams.
There are many properties of algorithms but the general ones are below.
Mathematical problems can be solved using an algorithm like adding and subtracting numbers, finding the squares of numbers, calculating the areas of shapes, and many more. Let's take some examples to illustrate this.
Write an algorithm to add two numbers \( a \), \( b\) and \( c\).
Solution.
This algorithm will have three parts. The input, the process for addition, and the output. Here, there are two inputs \( a\) and \( b\). Below is the algorithm.
Step 1 - Place \( a \), \( b\) and \( c\) on top of each other according to their place values forming columns.
Step 2 - Add the numbers from the right taking note of their place values.
Step 3 - If you add the numbers in the right column and the number exceeds \( 9\), carry over the tens unit of the number to the next column.
Step 4 - Write the sum of the numbers.
This algorithm is correct because it satisfies the properties of an algorithm. It has an input and output, it has a finite number of steps, each step of the algorithm is complete and easy to understand and the algorithm is able to perform the task that it is written for.
Let's take another example.
Write an algorithm to find out if a number is an odd number.
Solution.
Step 1 - Divide the number by \( 2\)
Step 2 - If after division there is a remainder, then the number is odd. Otherwise, it is not.
This algorithm is clear and complete. It has a finite number of steps and can give the desired result. It posses the properties of a good algorithm
Let's see some other examples.
Write an algorithm to calculate the area of a triangle.
Solution.
When calculating the area of a triangle, you consider the base and the height. Having this in mind, let's write the algorithm.
Step 1 - Note the value of the base \( b\) of the triangle.
Step 2 - Note the value of the height \( h\) of the triangle.
Step 3 - Multiply the value for the base and height of the triangle (\( b \cdot h \)).
Step 4 - Divide the result from the multiplication by \( 2\) to get the area \( \left( \frac {b \cdot h} {2} \right) \).
The algorithm above is a good one. You can identify the inputs as \(b\) and \(h\), and the output as the area of the triangle. It has a finite number of steps and each step is complete and precise. The algorithm can do what its meant to do.
Let's take another example.
Which of these is the correct algorithm for finding the perimeter of the shape below.
Step 2 - Add \( c\), \( d\) and \( e\) .
Step 3 - The sum is the perimeter.
B. Step 1 - Count the number of sides of the shape.
Step 2 - Add.
Step 3 - The sum is the perimeter.
C. Step 1 - Note the value of the sides of the shape - \( a\), \( b\), \( c\), \( d\) and \( e\).
Step 2 - Add the values \( a\), \( b\), \( c\), \( d\) and \( e\) to get the perimeter.
D. Step 1 - Note the value of the sides of the shape - \( a\), \( b\), \( c\), \( d\) and \( e\).
Step 2 - Add the values \( a\), \( b\), \( c\), \( d\) and \( e\).
Step 3 - Divide the sum by \( 5\) to get the perimeter.
Solution
The answer is option C. All other options do not possess the properties of an algorithm. They are ineffective and ambiguous.
Here's why the other options are wrong.
Option A is not effective. Following those steps will not give you the perimeter of the shape.
Option B is ineffective and ambiguous. You will not get the perimeter following the steps and the second step has no meaning.
Option D is a wrong algorithm. Its Step 3 says to divide by 5. You do not get the perimeter of a shape by dividing by anything. It is ineffective.
Let's see another type of example.
A friend has given you the following algorithm to look over. Explain why or why not this is an algorithm.
The Algorithm
Step 1 - Pick it up.
Step 2 - Walk to the bin.
Step 3 - Throw it away.
Solution
You should first examine each step of the algorithm to see what is wrong and what is write.
Step 1 says to ''pick it up''. What exactly should be picked up? It doesn't say what to pick up or where to pick it up from. There is no clarity and it doesn't make much sense. This goes against the definiteness property of an algorithm.
Step 2 says to ''walk to the bin''. It is an instruction to take an action. It makes sense on its own but because you do not know what step 1 is communicating, step 2 won't make as much sense as it should. This also goes against the definiteness property of an algorithm.
Step 3 says to ''Throw it away''. Again, throw what away? We do not know what we are to throw away. So this goes against the definiteness property of an algorithm.
The problem with this algorithm is that it doesn't have a clear meaning. It is incomplete and not easy to understand. That means you can go ahead to let your friend know that this is not an algorithm.
Let's see some more examples.
Which of the following is the correct sequence for an algorithm for brushing your teeth.
Solution
The correct option is D. It is the correct order of steps for brushing your teeth.
Let's take the last example.
Write an algorithm to solve \( 2 + 5 \times 4 \).
Solution
To write the correct algorithm for this, you need to have know about BODMAS. (To know more about BODMAS, check out the article on Structure and Calculation)
The algorithm is as follows.
Step 1 - Multiply 5 and 4
Step 2 - Add the result from the previous step to 2 to get the answer.
This algorithm can give the result it is supposed to give, The steps are clear and complete and it has a finite number of steps. Hence, it is a good algorithm.
As we've seen every activity we carry out and problem we try to solve has an algorithm. Let's look at some applications of algorithms.
An algorithm shows the order in which a process should be followed for an event to occur or for a mathematical problem to be solved.
An example of an algorithm is the steps taken to add two numbers.
Algorithms are used for problem solving and they are used to help carry out activities.
Properties of algorithms are below.
Some types of algorithms are:
What are algorithms?
An algorithm shows the order in which a process should be followed for an event to occur or for a problem to be solved.
List the properties of algorithms
How or where can algorithms be applied?
An algorithm can have more than one input.
TRUE OR FALSE
True
An algorithm can have more than one output.
TRUE OR FALSE
False
An algorithm can have zero input.
TRUE OR FALSE
True
Already have an account? Log in
Open in AppThe first learning app that truly has everything you need to ace your exams in one place
Sign up to highlight and take notes. It’s 100% free.
Save explanations to your personalised space and access them anytime, anywhere!
Sign up with Email Sign up with AppleBy signing up, you agree to the Terms and Conditions and the Privacy Policy of StudySmarter.
Already have an account? Log in
Already have an account? Log in
The first learning app that truly has everything you need to ace your exams in one place
Already have an account? Log in