- Dr. Timothy Smith

# What Is an Algorithm?

* Photo Source: **Pexels*

Now more than ever, the word ‘algorithm’ flies freely about in the news, advertising, and conversation. Google Ngram tracks the usage of words in books over time starting with books published hundreds of years ago through the present day. Ngram demonstrates the increase in popularity of the word ‘algorithm’ in books starting in the early 1960s and continuing to increase through today. Even more explosive growth in the usage of ‘algorithm’ appears in Google searches when combined with other terms such as Tinder, Instagram, or Bitcoin. Google Trends, which tracks what people search on the internet, shows huge increases in searches containing the word ‘algorithm,’ but what does the word really mean? In short, algorithm stands for a set of step by step instructions designed to do something.

The word algorithm comes from the name of the Persian Muslim scholar, philosopher and mathematician Muhammad ibn Musa al-Khwarizmi who lived from ~780-850 CE (www-history.mcs.st-andrews.ac.uk). He wrote great books on mathematics, and he introduced the decimal to the Western World through a translation of his works. The translation Latinized his name to Algoritmi. We often hear the term algorithm associated with computers, but algorithms do not only exist in computers. People use step by step instructions all the time to solve a problem or get something done. For example, to roll the change accumulated in a change jar, a person will first separate all the coins by type—pennies with pennies, nickels with nickels… After sorting the change by type, the coins must be stacked into the amounts for each roll such as 50 pennies or 40 quarters per roll. Once the stacks of coins have the correct number, the coins must be placed in the proper paper rolls such as pennies in the penny rolls. The process of rolling coins uses an algorithm or specific steps designed to complete a particular task. Following the instructions to make bread constitutes a more complex non-computer algorithm. The baking algorithm requires the use of precisely measured, specific ingredients such as flour, yeast, salt, and water. Moreover, the bread baking algorithm requires the baker to mix and knead the ingredients, wait for the bread to leaven, and then bake the bread at a specific temperature and for a certain amount of time.

Computer algorithms also perform particular step by step tasks to achieve a specific goal. Sometimes the algorithm may be straightforward, such as finding the biggest number in a long list of numbers or counting the amount of time a particular word like ‘cat’ gets used in a document. In the first algorithm, looking for the largest number in a long list of numbers, the computer will be instructed to look at the first number in the list, call it the largest number, and compare it to the next number in the list. If the next number that comes up is larger, call that number the largest number. The algorithm will fly through the entire list very quickly and read out the largest number it found in the end. For the word counting example, the algorithm starts with a zero for the number of times it finds ‘cat.’ It will search from front to back through the document looking for the word “cat,” and every time it finds cat, it will add one to the number count. Such algorithms sound simple, but they can save so much time and can be very accurate. Other algorithms perform more complex tasks such as the search algorithm that made Google the world’s largest internet search engine. Google developed and patented PageRank. PageRank helps Google provide the best search results when searching through the trillions of web pages on the World Wide Web. Basically, to do this, PageRank looks at the search words you type into Google and finds all the pages containing your search. Next, PageRank searches through the pages it found and chooses the ones that have the most links connected them. PageRank uses the idea that good quality internet pages will have more links to them than other pages with low-quality information. The highest scoring pages will be at the top of the Google search results. Using the PageRank algorithm, Google solved the problem of finding the best search results across trillions of pages in a stepwise manner.

The great Persian mathematician, Muhammad ibn Musa al-Khwarizmi, provided the basis for the word algorithm. Although “algorithm” sounds hard to interpret, it stands for a step by step process designed to solve a problem. People use algorithms in their everyday lives without touching a computer. Baking bread, sorting laundry or coins employ algorithms. Computers use algorithms to solve particular problems such as counting words or returning the best search results. Computers surround us today, and therefore algorithms large and small bring us our email, route our phone calls, make our Facebook pages work and in other words support many of the things we do every day.