Understanding Algorithms By now, you may have heard a lot about what an algorithm is. Yes, algorithms are very important in the world of programming. For example, this is a trick YouTube uses to help you watch YouTube recommended videos. Pretty interesting right?
For those of you who have been involved in the world of computer engineering for a long time, you must be familiar with this term. However, for those who are new to using this device, of course it is not clear about the components, features, and purpose of using this device.
Algorithms are not only used to solve problems on computers, but can also be used to solve problems that exist in everyday life. In addition, any problem related to a procedural process or step usually requires an algorithm.
Problems are easy to solve using algorithms because we know the logical and systematic steps to take first. Therefore, many people have solved the problem using algorithms, are you one of them?
Many terms exist in the world of computing such as AI , supercomputer , machine learning , cloud , quantum computing and many more. Apart from this, there is a word that is used mainly in computer science and that is algorithm.
In the most general sense, an algorithm is a set of instructions that tells a computer how to turn a set of facts about the world into useful information.
Don’t worry, for more details about the understanding of algorithms and other components, sinaumedia has covered miscellaneous items about algorithms just for you. Come on, see more below!
Definition of Algorithm
The development of science and technology allows humans to produce increasingly sophisticated and complex works. Although computers can perform calculations faster than humans in general, computers cannot solve problems without being taught by humans through a predetermined sequence of steps (algorithms).
Besides being used to solve problems by computers, algorithms can also be applied to solve everyday problems that require a series of processes or procedural steps. To better understand what an algorithm is, let’s learn what it means from several sources.
The general understanding of an algorithm is a sequence of a number of logical and systematic steps to solve a particular problem.
Some experts consider an algorithm as a sequence of steps that must be followed in mathematics or calculations to solve other problems, especially computers.
This means that all logical arrangements are arranged in the order of a particular learning system and are used to solve a particular problem, we can say like an algorithm.
Generally, algorithms will be used to be able to perform calculations, perform automatic inference, and process data on a computer using certain software .
Apart from that, the Algorithm also contains a finite set of instructions as well as specific instructions for calculating functions which, when executed and processed, produce a certain output and then terminate at a specified termination condition.
An algorithm is a step or method that has been carefully planned so that it is ordered and well organized and is usually used to solve a problem by giving an instruction so that it becomes an action.
Meanwhile, in the Big Indonesian Dictionary (KBBI), an algorithm is a systematic procedure for solving mathematical problems in limited steps or logical decision-making sequences to solve the problem.
From this understanding it can be said that this algorithm is used to solve or solve a problem with sequential logical steps.
This is why algorithms must be used in computer electronics because with computer algorithms, computers will be able to process data, perform calculations, make automatic inferences and solve problems on computers.
When the algorithm is used on a computer, it will produce output which will then stop at its initial state. Not only on computers or in everyday life, algorithms are also used by many companies, especially those engaged in the financial sector.
Almost every area of corporate finance uses algorithms, from stock and asset trading to debt management and loan pricing. Trading using algorithms is often referred to as automated trading .
Automated trading often uses computer programs to quickly sell or buy securities, why use computer programs? This is because business transactions occur very quickly, so speed is impossible for humans to calculate.
In general, very fast trading occurs when the price of stocks, commodities, and bonds fluctuates. In simple terms, these algorithms facilitate automated trading where trading transactions take place very quickly.
So the algorithm is definitely one of the methods in which a problem can be solved easily, so that an operation or production process can continue. Furthermore, the algorithm is a method that can be learned by everyone, including yourself.
Especially in this technological era, learning algorithms is something that can be learned, just like writing articles to appear on the first page of search engines, you have to learn algorithms. Not only that, there must be a lot of people watching YouTube, the appearance of videos on that page is the result of an algorithm. The appearance of the video on the page is the result of the youtube algorithm.
At that time, Al-Khwarizmi wrote a book with the title Al Jabar wal-Muqabala, which means The Book of Restoration and Reduction . From the title of the book we also get the word “algebra” or better known as algebra.
Abu Abdullah Ibn Musa al-Khwarizmi (770- 840AD) was born in Khawarizm (Kheva), a city south of the Oxus River (now called Uzbekistan) in 770 AD. Al Khwarizmi was one of the foremost scientists of his time. There are several branches of mathematics that he discovered, including those called astronomers and geographers.
Originally, algorithm was a term that referred to useful arithmetic rules for solving problems using Arabic numerals.
In 1950, the word algorithm was first used in “Euclidean Algorithm”. Euclid, a Greek mathematician (born in 350 AD). In his Elements he writes the steps for finding the greatest common divisor (gcd) , of two integers, m and n [KNU 73] (of course Euclid didn’t call his method an algorithm, it’s only in modern times people call his method (“Euclidean algorithm”).
The greatest common divisor of two non-negative integers is the largest positive integer that divides the two numbers equally.
For example, m= 80 and n =12. All the divisor factors of 80 are 1,2,4,5,8,10,16,20,40,80
and all the divisor factors of 12 are 1,2,3,4,6,12,
then gcd (80,12) = 4.
The steps for finding gcd (80.12) with the Euclidean algorithm are as follows:
80 divided by 12 = 6, remainder 8 (or: 80 = 6.12+8)
12 divided by 8 = 1, remainder = 4 (or: 12 = 1.8+4)
8 divided by 4 = 2, remainder =0 (or:8 =4.2+0)
since the last division results in 0, the remainder of the last division before 0, which is 4, becomes gcd(80,12). So, gcd (80,12) = gcd (12,8) = gcd (8,4) = gcd (4,0)=4.
A mathematician and computer scientist named Dr. Christoph Koutschan says that there are at least 32 algorithms in computer science. However, when viewed from its function, there are only six basic algorithms, namely:
A recursive algorithm is something that will call itself over and over again so that the problem can be solved correctly. Here is some code that can find the factorial using a recursion algorithm.
If y is 0
return (y*Fact(y-1)) /* this is where the recursion happens*/
2. Divide and Conquer
Divide and Conquer will divide a big problem into many smaller problems. This type of algorithm itself actually consists of two main parts, namely:
- Breaking the problem into sub-problems that are more independent and smaller than other similar problems.
- Solving the original problem after can solve smaller problems separately.
Here is a pseudo code example of the divide and conquer algorithm :
MergeSorting(ar, l, r)
If r > l
- Find the mid-point to divide the given array into two halves:
middle m = (l+r)/2
- Call mergeSorting for the first half:
Call mergeSorting(ar, l, m)
- Call mergeSorting for the second half:
Call mergeSorting(ar, m+1, r)
- Merge the halves sorted in step 2 and 3:
Call merge(ar, l, m, r)
3. Dynamic Programming
Dynamic Programming will work by remembering the results of past processes and also using them to find new results.
From the explanation above, it means that Dynamic Programming solves complex problems by breaking them down into many simple subproblems, then solving them one by one, then saving them for future use.
An example of Dynamic Programming is composed of the Fibonacci sequence, here is an example:
Fibonacci(N) = 0 (for n=0)
= 0 (for n=1)
= Fibonacci(N-1)+ Finacci(N-2)
This type can be used to solve optimization problems. In this algorithm, we will find a more optimal solution locally without worrying about the consequences that will occur in the future and we can find a more optimal solution globally.
However, this method does not guarantee that you will get the optimal solution. There are five components contained in this algorithm, namely:
- The set of candidates whose solutions will be sought later.
- The final selection function will help select the best candidate.
- The eligibility feature can help you identify which candidates can be used to find a solution.
- The objective function is capable of assigning values to possible solutions or partial solutions.
- The solution function can tell you how long it will take to find a solution to the problem.
5. Brute Force
The concept of this algorithm is actually very simple. During this process, brute force integrates all possible solutions to find one or more possible solutions to solve the problem.
Here is an example of a sequential search performed using brute force :
Algorithm S_Search (A[0..n], X)
A[n] ← X
i ← 0
While A [i] ≠ X do
i ← i + 1
if i < n return i
else returns -1
6. Backtracking Algorithm
Backtracking is a technique that solves different problems recursively and tries them to find a solution by solving one part of the problem at the same time. If a solution fails, we can delete it and go back to looking for another solution.
This means that this algorithm will solve the sub-problem and if it fails, the algorithm will cancel the last step and start again to find a solution to the problem.
After knowing the definition and characteristics of the algorithm, you must know the function of the algorithm. Is it true that algorithms are only needed in programming?
As previously mentioned, algorithms can be applied to many paths of life. It’s just that the application of algorithms is more often discussed in computer programming.
In terms of programming, programming algorithms help programming teams to solve problems. A set of solutions to this problem that a programmer can develop into a program.
Apart from that, some other functions of the algorithm are as follows:
- Help you solve certain problems in a logical and systematic way. Algorithms can be used more than once to solve the same problem.
- Algorithms can also be used to help solve complex problems more simply.
- For programmers, the algorithm will make it easier for them to track every error that appears.
- Allows programmers to easily modify programs without changing the total algorithm and without having to start from scratch.
- Programmers only need to make changes at certain times, and programs can be updated to fix problems as they arise.
5 Characteristics of the Algorithm
According to Donald E. Knuth, an algorithm must have five important characteristics that are interconnected. The criteria for this algorithm include:
1. Finiteness (Limitations)
The algorithm must stop after taking a finite number of steps, i.e. a final goal has been reached, so the program will stop when the final goal has been reached. A program that never stops indicates that it contains an incorrect algorithm.
2. Definiteness ( certainty)
Each step must be precisely defined and unambiguous. There are clear and unambiguous instructions, so there are no errors in producing the output.
3. Input (Input)
These inputs are known problems and solutions will be investigated. This algorithm has no or more inputs, which is the amount provided for the algorithm to process.
4. Output (Exit)
The algorithm has no or more output values . This output must of course be a solution or solution to a problem. The output can be a message or a quantity related to the input.
5. Effectiveness (effectiveness)
Algorithms must be efficient, each sequence or step must be as simple as possible, so that it can be implemented in reasonable time.
To better understand the algorithm, it is necessary to know that the algorithm is not only valid in programming but can be applied in everyday life.
The data provided is in the form of employee names and performance evaluation results. If the performance evaluation result is greater than or equal to 75, then the employee is declared to have achieved the KPI. Meanwhile, if the value is less than 75, the employee is declared to have failed to achieve the KPI.
An example of writing the algorithm is as follows:
The algorithm will be as follows:
read the employee name and value.
if value >= 75 then
description = successful
but if =< 75
description = did not work.
write name and description
The example above is a narrative algorithm
The declaration of the data type will be as follows:
name = string
Value = integers
Description = strings
The algorithm will be as follows:
if value >= 75 then
description = ‘successful’
description = ‘didn’t work’
The example above is a Pseudo Code algorithm
Meanwhile, other examples of algorithms can also be seen in technology, especially in search engines whose use requires the internet. To better understand examples of algorithms in technology, you can see the examples below.
- Decide what information you want to find
- Enter the information you want to find into the search engine
- Wait a moment
- Information appears as searchable articles in order
- Just choose an article that contains the right information
In general , all search engines have their own algorithms, so articles that will appear in first place are articles that deserve to be ranked first, then second articles and so on.
Therefore, if you want to create articles that appear on the first page or the first order of search engines, you must first determine the search engine algorithm.
Above are 3 examples of algorithms that exist in everyday life and algorithms related to search engine technology. Basically, there are many examples of algorithms, maybe you can give examples of algorithms. After getting to know the definitions and examples of algorithms, it seems you have started to understand algorithms or even want to apply them in everyday life.
Thus our full explanation of the algorithm. With this interpretation, it is hoped that our knowledge of algorithms will increase and can be applied in everyday life.
In this discussion, Algorithm can be said as a method or a way or procedure that can be used to solve a problem that is currently happening, both in the form of computer science and mathematics. Therefore, the algorithm can be said to include several such as reasoning, data processing, and calculations.
Source: from various sources
Author: Ziaggi Fadhil Zahran
Also read articles in sinaumedia Literacy:
Acquaintance with the Inventor of Algebra and Algorithms
Understanding Social Media Engagement to Types and How to Count!
Singular Matrix: Concepts, Formulas, and Example Problems
Data Science: Definition, Tools Used, and Its Application
The Concept of Addition Matrix, Example Problems, and Discussion