I attended the workshop Me and the Algorithmic 'Other' at this years tech-festival in Copenhagen, and though I did enjoy the workshop, I can not stop thinking about the fact that they consistently used the (very broad) term algorithms when they specifically meant digital personification system. I did not correct them, as I thought it would be rude - but I regret that decision now. I think information technology and environmental issues are going to be among the most important global topics the next few decades. I believe a key element to a productive debate is a common understanding of the topic and that starts with terminology.

Definition of Algorithm

The formal definition (Oxford dictionaries) of an algorithm is "A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer." - which sounds fancy, but it is really quite simple. It is just a recipe / guide / manual of simple steps to follow in order to achieve some goal.

The Simple Example - Cake!

Imagine a table with pieces of cake on a long line. You are the first one there and want to make sure you get the largest piece. Just follow these instructions:

Look at the piece of cake in front of you on the table. Compare it to the one on your plate. If it is larger than the one on your plate put back the piece already on your plate and take the piece of cake in front of you instead. Move to the right and repeat from step 1 if there is a piece of cake in front of you.

Following these steps will assure you end up with the largest piece of cake when you reach the end of the table. That is an algorithm. A weird algorithm that might break some social norms about not touching all the cakes, but an algorithm none the least. This algorithm actually works for picking the maximum element of any finite set with a bit of abstraction. It is so common and fundamental in computing that I am not even sure it has a name.

The Useful Example - Book pages!

Look at page 241 in the book! Now one way to find that page is to turn one page at a time until you reach the intended page (241) - but that takes quite a lot of time. Here is a better algorithm for finding the page you are looking for. Hold a hand on each side of the book.

Take your thumbs and split the pages between your hands exactly in the middle (granted, this is a bit easier to do on a computer...) Look at the page number. If it is larger than the page number you were looking for, move your right hand to where your thumb so that you now hold half of pages you held before between your hands. If the number is smaller than the page number, move your left hand instead. Repeat from step 1 until you reach the page you were looking for.

This is quite similar to how you would normally find a page in a book right? Most people split a bit arbitrary instead of doing perfect splits and maybe even switch to simply turning pages one by one when there is only a few pages left, but the concept is the same. Reduce the problem space and continue until the problem is manageable.

This is also an algorithm - a quite clever, but still fairly fundamental one. It is known as binary search (or half-interval search). It allows us to find an element in a sorted set in logarithm time. If we have 1024 pages it will at most take us 10 iterations to find the one we are looking for. It scales really well, we can search through the entire English Wikipedia from 2015 in printed form (approximately 5.231.100 pages) in just 23 iterations.

The Scary Example - Customer Segmentation

This one is a bit more advanced, but stay with me. We want to do some customer segmentation - and decide to use the data we have on them; age and average purchase value.

We plot this in a coordinate system and now all we have to do is find groups of dots. Our marketing department can handle four campaigns simultaneously. We follow these steps:

Place some (in this case four) crosses arbitrarily. Assign each data-point to the nearest (euclidean distance) cross. Calculate the mean x and y value of each cluster and move the cross to that position. Repeat from step two, until the cross moves 'very little' each time.

Source: David Sheehan, read his informative article about clustering

Now, that was a bit more complex - especially if extended to multi-dimensional coordinate systems, but that is partially irrelevant. The point is all it really does is group dots. Each axis could however represent something important - like political stances on different topics ranging from -100 (against) and 100 (in favor of). Such a coordinate system combined with clustering would make targeted politics ads quite easy to construct in such a way that the receiver often agrees with the message of the ad. But how would you ever collect the data to construct this imaginary coordinate system? Well... we could look at what you like, share and otherwise interact with on social media and base our system on the assumption that you interact with things you have a positive attitude towards. That could be scary - but it is not the fact that we can group arbitrary dots into groups that is scary, it is the way we use it.

Conclusion