Algorithms Explained: What you didn't know about Algorithms and AI

A Pinch of Algorithm in our Daily Lives

Algorithms Explained: What you didn't know about Algorithms and AI

Introduction

In the digital sphere, algorithms are everywhere. They’re the key component of any computer program, built into operating systems to ensure our devices adhere to the correct commands and deliver the right results on request. Much of what we do in our day-to-day lives comprises an algorithm

Understanding Algorithms

An algorithm must be seen to be believed. – Donald Knuth

  1. An algorithm is a coded formula written into software that, when triggered, prompts the tech to take relevant action to solve a problem.
  2. A sequence of step-by-step instructions geared to garner results.

Computer algorithms work via input and output. Input is when data is entered, the system analyses the information given and executes the correct commands to produce the desired result, the output. For example, a search algorithm responds to our search query by working to retrieve the relevant information stored within the data structure. That is, you key in your search, say "programming", algorithms get to work and goes over all the data within it's structure to bring all relevant results containing the word "programming"

Algorithm Constructs

Constructs could simply be refered to as "building blocks". There are three constructs to an algorithm;

Linear sequence : The algorithm progresses through tasks or statements, one after the other.

Conditional : The algorithm makes a decision between two courses of action, based on the conditions set, i.e. if x is equal to 10 then do y .

Loop : The algorithm is made up of a sequence of statements that are repeated a number of times.

NOTE : The purpose of any algorithm is to eliminate human error and to arrive at the best solution, time and time again, as quickly and efficiently as possible.
This is useful for tech users, but essential for data scientists, developers, analysts and statisticians, whose work rely on the extraction, organisation and application of complex data sets.

Types of Algorithm

Brute force algorithm

Direct and straight to the point, the brute force algorithm is the simplest but the most applicable, eliminating incorrect solutions based on trial and error.

Recursive algorithm

Recursive algorithms repeat the same steps until the problem is solved.

Backtracking algorithm

Using a combination of the brute force and recursive approach, a backtracking algorithm builds a data set of all possible solutions incrementally. As the name suggests, when a roadblock is reached, the algorithm retraces or ‘undoes’ its last step and pursues other pathways until a satisfactory result is reached.

Greedy algorithm

All about getting more juice for the squeeze, greedy algorithms are employed to source and select the optimal solution to a problem. They typically extract the most obvious and immediate information in minimum time, enabling devices to sort through data quickly and efficiently. This algorithm is great for organising complex workflows, schedules or events programmes, for example.

Dynamic programming algorithm

A dynamic programming algorithm remembers the outcome of a previous run, and uses this information to arrive at new results. Applicable to more complex problems, the algorithm solves multiple smaller subproblems first, storing the solutions for future reference.

Divide and conquer algorithm

Similar to dynamic programming, this algorithm divides the problem into smaller parts. When the subproblems are solved, their solutions are considered together and combined to produce a final result.

Algorithms and Artificial Intelligence

istock-966248982-1-1053310-1637562644.jpg Algorithms define the process of decision-making, whereas artificial intelligence uses data to actually make a decision.

While a computer algorithm is simply a strand of coded instructions for completing a task or solving a problem, artificial intelligence is more of a complex web; comprising groups of algorithms and advancing this automation even more.
AI Continuously learn from the accumulated data, and is able to improve, modify and create further algorithms to produce other unique solutions and strengthen the result.
The output is not defined, as with algorithms, but designated. In this way, AI enables machines to mimic the complex problem-solving abilities of the human mind.

AI algorithms are what determine your Netflix recommendations, TikTok and Instagram explore, and help you recognise your friends on Facebook.
As a result, AI algorithms are also called learning algorithms , and typically fall into three types: supervised learning, unsupervised learning and reinforcement learning

Supervised learning algorithms

In this instance, programmers feed training data (or ‘structured’ data sets) into the computer, complete with input and predictors, and show the machine the correct answers. The system learns to recognise the relational patterns and deduce the right results automatically, based on previous outcomes.

Unsupervised learning algorithms

This is where machine learning starts to speak for itself. A computer is trained with ‘raw’(or unlabeled) input data, and learns to mine for rules, detect patterns and summarise and group data points to help better describe the data to users. The algorithm is used to derive meaningful insights from the data, even if the human expert doesn’t know what they’re looking for.

Reinforcement learning algorithms

This branch of algorithm learns from interactions with the environment, utilising these observations to take actions that either maximise the reward or minimise the risk. Reinforcement learning algorithms allow machines to automatically determine the ideal behaviour within a specific context, in order to maximise its performance.

Artificial Intelligence Algorithms in Action

From artificial intelligence powered smartphone apps to autonomous vehicles, artificial intelligence is embedded into our digital reality in a multitude of big and small ways including;

  • Facial recognition software, which enables you to log in to your device in the first place, while apps such as Google Maps and Uber analyse location-based data to map routes, calculate journey times and fares and predict traffic incidents.
  • Targeted ads and personalized shopping, all employ artificial intelligence algorithms to optimize online experiences.Future applications will see the installation of self-driving cars and artificial intelligence autopilots.

Unmasking the Secrets of Data Science

data-science-EN-Content-Page-Mobile.jpg

Data is being collected at unprecedented speed and scale, becoming an ever-increasing part of modern life.
‘Big data’, on the other hand, applies to big businesses. Big data is of little use without big insight .
The skills required to develop such insight are in short supply, and the expertise needed to extract information and value from today’s data couldn’t be more in demand. Data Science bridges this gap, and brings in models that help monitor all this data to come up with valid conclusions.

Bonus fact : You can come up with an algorithm for absolutely anything! But there is no algorithm for humor.

Thanks for reading! You now understand algorithms, and you are able to incorporate it while coding or programming. Feel free to drop a like, question, a general comment, or share this article with your geeky friends.

You may click here to see my detailed article on Introduction to Python for beginners.