• 6 hours
  • Easy

Free online content available in this course.

course.header.alt.is_certifying

Got it!

Last updated on 1/11/24

Discover What Algorithms Are for

First things first—let’s start by finding out why learning about algorithms is useful, and what subjects this field covers.

The world of IT is full of buzzwords—AI, machine learning, cloud, quantum information, etc. One word in particular is used across the board in IT, and that’s algorithms.

Algorithms are simply a set of step-by-step instructions which are followed to do something useful or solve a problem. We could say that a cake recipe is an algorithm for making a cake, for example.

So why do we always associate this word with IT, and specifically, with computers? Simply because an algorithm is first and foremost a set of methods used by a computer program to solve a problem. In fact, once we’ve thought through the different ways of solving a problem, we can get the computer to do it for us. It’s not because we’re lazy, though—computers have superpowers that mere humans couldn’t possibly match!

One of these superpowers is that they never get bored, no matter how many repetitive actions you ask them to perform. Moving your 2,000 vacation snaps one by one? Easy! Searching a 200-page PDF for every occurrence of a certain word? A piece of cake! Imagine how boring it would be doing all this yourself…

A second reason, and an important one, is that computers work much faster than us, and that makes them more efficient. Try to work out 10 x 20 x 30 x 40 in your head, and see how long it takes you compared with your computer. You can’t beat it!

Break Down Everyday Life Into Algorithms

We use algorithms every day when we have to take several possibilities into account and make a choice. Let’s say you’re driving to visit your grandma, but alas, there is road work ahead and you have to take a different route from normal. Nowadays, you’d probably switch on your GPS, which would do a good job of telling you the quickest way to get to Grandma’s just in time to sample her famous cookies as soon as they’re out of the oven.

But what would you do without a GPS? You’d have to get out a paper map and figure out the best route, taking into account certain parameters such as the speed limit on each road, any tolls, your current position, etc. You could then choose the quickest and cheapest route, once you’d worked everything out and weighed your options.

Well done, you’ve replaced the computer! But you’ve also wasted a good few minutes thinking about it… and in the meantime, Grandma’s cookies are getting cold!

Luckily, some clever programmers designed a program that uses an algorithm and put it to work in the little box on your windshield!

Understand Algorithms in Daily Life

So, why learn algorithmics? You’ll see that these concepts open doors to many different fields, from online research, to designing video games, and much more.

Algorithmic Sorting of Websites

You’ve probably noticed that Facebook adapts your feed to your activity. It doesn’t show your friends’ latest posts, but the content Facebook considers is the most relevant for you, based on your activity.

Similarly, when you carry out a Google search, you expect the page to display the most relevant results, not the latest websites published. Google therefore needs a model to determine how to calculate the relevance of these results, taking several parameters into account, such as your search history, the number of visits to a website, the number of links leading to the website, etc.

These two examples use some very interesting machine learning methods.

Algorithms Applied to Geolocation

Your GPS is a program which uses an algorithm to enable it to find the shortest route between your current location and the place you want to get to. Similarly, online booking websites have algorithms to manage the number of free seats on trains, as well as connections and any potential problems (cancellations, for example).

Algorithms are also used in image recognition software, and even by your bank when you make payments online (for fraud detection). They’re pretty powerful!

We could find many other examples of algorithms which are part of our daily lives. They all have one thing in common—they solve a problem we encounter, using a program.

Understand Programs

A program is a set of instructions executed by a computer to respond to a problem we set it. Programs are created via a set of algorithms. For example, imagine you wanted to write a new version of the latest blockbuster. You could write all your ideas down on paper, but then how would you share them with your friends? Or what if you spilled your coffee on it, or your friend lost the manuscript? After swearing never to drink coffee or associate with humans ever again, you’d probably switch your computer on and use Microsoft Word instead.

But how does a program actually work? It’s simple—it takes a set of data entries (the input), executes some instructions, and then outputs data.

It’s a bit like how humans communicate! If my parents ask me to set the table, they’ll give me the plates (the input), I set the table, and I tell them “the table is set!” (the output). 

Going back to Microsoft Word, when you save a document by clicking “Save,” Word takes the unsaved content as the input (text, images, etc.), saves it, and outputs a confirmation message.

The actions carried out by a program are called instructions.

Instructions fall into three main categories:

  • Basic operations: addition, subtraction, multiplication, division, etc. For example, “space” + “ship” => “spaceship.” 

  • Conditional execution: if (condition), then (do this), else (do that). For example, if a user comes online, display “Hi, User!” 

  • Iteration: repeating an instruction a certain number of times. For example, displaying each photo from an album one by one.

Let’s Recap!

  • An algorithm is a set of instructions to follow to solve a problem.

  • Every computing device uses algorithms to execute its functions, whether in software or applications.

  • Algorithms take the input data and execute the instructions based on this information to generate an output.

  • A program is mainly created via a set of algorithms.

In this chapter, you’ve discovered how a program works and the role of algorithms within a program. In the next chapter, we’ll find out how to structure a program to solve a problem!

Example of certificate of achievement
Example of certificate of achievement