What exactly is an algorithm, and why are they secretly controlling modern life? Posted on 23/06/2020

what exactly is an algorithm?

You'll often hear the word 'algorithm' when someone refers to social media content, but what exactly is an algorithm? Why are they secretly controlling modern life?

Our Systems Analyst, Reg Harsley, gives a brief overview of what an algorithm is, and explains how algorithms are being used in a recent project.

What is an algorithm?

The idea of an algorithm dates well before the conception of a computer. 

Technopedia describes an algorithm as a step by step method of solving a problem, commonly used for data processing, calculation, and other related computer and mathematical operations. 

At its core, an algorithm is a set of instructions to do something like ‘how to make pasta’.

A user-friendly definition, or day-to-day example, of an algorithm is following a recipe to cook pasta:

  • Boil water
  • Add pasta to boiling water
  • Wait 10 minutes
  • Drain pasta
  • Eat.

How an algorithm works

At a more technical level, we explain how algorithms are used to solve mathematical equations by using the Newton-Raphson method as an example. Newton’s method  is used to calculate  what input, x, into a mathematical function gives an output, y, of zero.

If you think of the function as a curve, the Newton-Raphson method starts at one point on the below graph, our initial guess at where it will equal 0, and makes a straight line that matches the original function at that point.





Using algorithms to detect a heartbeat

A recent i4pd project involved creating an Android application that detected heart beats from electronic measurements. 

The algorithm used in the application had to be robust to normal noise, but also should not have been affected by the user moving around.

blog3.jpeg (1)

As a human looking at the signal, it seems straightforward to pick out the big peaks of the signal, corresponding to the heart beats, and ignore the noise that is present throughout. However, there are a lot of processes going on that we take for granted, and don’t necessarily realise until we have to write an algorithm to pick out the heart beats.

The basis of the algorithm focussed on working out if the curve changed direction: if the measurement at one time instance was greater than the previous value, but less than the next value, we know that this could be a peak. However, this doesn’t just happen for a heartbeat, it can also be seen in the noisy squiggles that we can never completely get rid of. We can ignore these smaller peaks by telling the algorithm to ignore any peaks smaller than a particular value. When the measurement device is moved or knocked by the user, this causes peaks that are significantly larger than those from heartbeats. These can be ignored by setting an upper threshold of what can be classed as a heartbeat. With a bit of tweaking and patience, we can select the parameters that lead to an algorithm that can accurately predict where heartbeats occur in the signal.

The human in the algorithm

Algorithms are not entirely objective tools used by inanimate computers, they are ultimately artefacts of human design and have their own biases based on decisions made by their creators. In the case of the heartbeat detection algorithm above, a decision was made to classify a heartbeat based on the height of the peak. This is an innocuous decision that does not result in unintended consequences, but does highlight how human decisions can come into the design of an algorithm.

Now consider a tool that translates ancient texts (a familiar concept for those who have used a translation app), using a dictionary that substitutes words from one language to another and applies appropriate grammar rules. These types of applications tend to give us the impression that the translation is a one-to-one mapping between the two languages, but this is not the case. For example, the ancient Greek word for “unpleasant” can also be translated into “impure”. This may seem like a small difference but in the study of ancient religion the distinction between pleasure and purity can be important. This highlights how following an algorithm could either lead to incorrect conclusions or missed opportunities. 

As computer algorithms are spreading into different sectors, we need to think about the decisions that go into their design as they can have a huge impact on people’s lives: your job could depend on an algorithm’s assessment of your productivity or you could be imprisoned due to an insensitive criminal risk assessment algorithm. This is not to say that algorithms are bad but we need to treat them with respect, as we would with tools in an engineering workshop. As designers we need to think about what the impact our algorithms can have on the wider world, and perform as wide spread testing beyond the initial use cases to try to minimise any unwanted results

Writing algorithms for product development 

Algorithms are already a large part of modern life and powerful algorithms can be implemented on mobile phones and small microprocessors. At i4pd, we bridge the gap between mechanical, electronic, and software development to help you develop algorithms for your product that can make it run more reliably or which can enhance the user experience.


Book a discovery call today

Schedule Zoom call

Related design & engineering articles

View all