It is fascinating what computers can do; it is even more fascinating that we can program them to do more cool stuff. In programming, you usually have a problem you can break into steps, and then you implement an algorithm (a step-by-step approach) to solve it. This requires that you know the rules of the system you want to build and that you can hard-code them.

Take, for example, you want to build a simple tax calculator program. The rule can be as simple as this:

“If a customer buys an item in Nigeria, add exactly 7.5% VAT to the price.”

We can translate this into code as:

total_price = item_price * 1.075

If there are additional rules, such as different VAT percentages for different product categories, we can also translate them into code as well.

In general, traditional software works like this: you have some input data and some rules that guide the transformation of the inputs to the desired output.

Traditional SE

Input + Rules = Output

Where Hard-Coding Rules Don’t Work Link to heading

Case 1: Too many (combinations of) rules Link to heading

If all the problems we are interested in had simple and finite rules, the lives of software engineers would be much easier. But there are some problems where we know the rules, but there are just too many configurations for a human to hard-code.

Take the game of chess, for example: the rules are pretty simple and finite; however, the number of possible moves and board positions is larger than the number of atoms in the universe. Whew!. A programmer cannot write an if-then statement for every possible board state.

Chessboard

This visualization of the chess game tree illustrates why hard-coding traditional ‘if-then’ rules fails: the exponential explosion of possibilities quickly creates more board states than can ever be pre-programmed (Image credits: Gemini).

Case 2: The “Inexhaustible Rules” Problem Link to heading

There are also problems where the rules are fluid, subjective, or constantly evolving, meaning a complete list of rules can never truly exist. For example, can we hard-code rules for recognizing a “cat”? Let’s attempt to come up with such a rule:

“If it has triangles for ears and a round face, it is a cat.”

Will this work? What if the cat is facing away? What if it is a cartoon? What if it is missing an ear?

There are so many visual variations that we cannot exhaust. It is impossible to come up with rules that will cover every case.

Cat Images

Could we write a rule for “cat” that covers every scenario shown in this grid of images? The different lighting, poses, environments, and even interactions with other animals? (Image credits: Roboflow)

The “Unconscious Knowledge” Paradox Link to heading

There is also something else that can make it hard for us to hard-code rules: “We know more than we can tell,” (known as Polanyi’s Paradox). For example, as humans, we know instantly if a face looks “sad” or “happy”. Some people have the superpower of being able to detect the most subtle sarcasm in language.

However, we cannot explain exactly how we do these things, which means we cannot hard-code them into a computer.

What is Artificial Intelligence? Link to heading

Unless you are living under a rock or you are not in the computer science space, you know we now have solutions that tackle some of the examples given above. For example, you can search on Google by uploading an image of a cat, and it will return visually similar images of cats in different poses, lighting, and environments!

SearchResult

A Google search result of searching by an image of a cat: how is Google able to identify that I uploaded a cat image and then match it to other similar cat images?

How is this done? How are we able to give computers capabilities that used to be available only to humans (or other intelligent animals)?

Artificial Intelligence is a scientific and engineering field that aims to build machines that are capable of mimicking human cognitive functions. It tries to answer the question: can we build machines that are intelligent? The next natural question is, what constitutes “intelligence”?

What is Intelligence? Link to heading

If you ask ten computer scientists, cognitive psychologists, and philosophers to define “intelligence,” you will likely get ten different answers. A universally accepted definition remains elusive, and for our purposes, we don’t need to solve that philosophical debate.

We just need to understand that with Artificial Intelligence, the goal is to enable machines to have specific functional capabilities that require human-like perception and reasoning. This isn’t about simulating consciousness; it is about building systems that can perform the complex tasks humans rely on their brains for: things like understanding and translating spoken language, instantly recognizing a specific human face or object within a messy photograph, or even making complex strategic decisions, such as navigating a self-driving car through heavy traffic.

In short, AI focuses on automating the outputs of intelligence, rather than replicating the internal processes of the mind itself. Fantabulous!

Expert systems: Rules for intelligence? Link to heading

Historically, early AI systems relied on writing massive databases of interconnected rules, often referred to as expert systems or rule-based software.

A classic example is ELIZA (from 1966), an early chatbot designed to act like a therapist using basic keyword rules. If you mentioned “sad,” it was programmed to ask a question like, “Why do you feel sad?”

While impressive for its time, ELIZA showcased the ultimate flaw of rule-based AI: brittle logic. We simply cannot write enough lines of code to anticipate every fluid, edge-case scenario the real world throws at us.

Eliza

The illusion of understanding: An ELIZA emulator in action. By matching against basic keywords like “sad” and “happy,” ELIZA selects pre-programmed response templates, quickly exposing its limits through repetition (notice how it repeats “I am sorry to hear that you are sad.“). Contrast this brittle, rule-based system with modern models like ChatGPT, which process nuance and context rather than matching single words.

What is Machine Learning? Link to heading

If hard-coding rules for complex real-world problems is impossible, what if we stop writing the rules altogether?

This is the core philosophy of Machine Learning (ML).

With Machine Learning, instead of explicitly writing lines of code to define what a cat looks like, we flip traditional software engineering on its head:

  • Traditional Software: Data + Rules = Output
  • Machine Learning: Data + Expected Output = Discovered Rules (Patterns)

In short, we feed a machine enough examples of the input data alongside the correct outputs, and let the algorithm discover the underlying patterns for itself.

TradToML

Machine Learning vs AI Link to heading

This brings up a crucial distinction: Machine Learning is a subset of Artificial Intelligence. While AI is the broader goal of building smart systems, ML is one of the most effective, practical ways we actually achieve that today. A helpful rule of thumb to remember is that all Machine Learning is AI, but not all AI is Machine Learning.

MLvsAI

A Real-World Analogy: From Blackboards to Algorithms Link to heading

Learning is an experience we all share, which makes it easy to understand how machines learn through a human lens.

Growing up in Nigeria, where English is the official language, early primary education revolved around mastering the alphabet. Every morning, Monday through Friday, our teacher would write the letters A through Z across the blackboard. Pointing to each letter, she would have the entire class identify and read them out loud.

Day after day, we repeated this ritual:

  • The Input: Visual shapes written on the blackboard in varying chalk styles and handwriting.
  • The Expected Output: Reading the correct sound of the letter out loud (“A”, “B”, “C”).
  • The Training: Daily repetition across hundreds of examples.

Over time, our young brains didn’t just memorize specific chalk marks; we internalized the underlying patterns of the alphabet. Once we learned the pattern, we could instantly recognize the letter “A”: whether printed in a textbook, written in messy handwriting, or stylized on a street sign.

That is precisely what we aim to do with Machine Learning. We don’t teach the computer rigid geometry rules. Instead, we show it diverse examples of inputs and expected outputs, repeating the process until the “machine” learns the hidden pattern for itself. Fantabulous!

MLvsAI

Human learning (usually) relies on repeated exposure to internalize the shapes of the alphabet, the exact same intuitive process machine learning uses to extract patterns from raw data. (Image credits: Gemini)

Wrapping Up: A New Way to Solve Problems Link to heading

For decades, traditional software engineering was all about telling computers exactly how to think step-by-step: writing rigid rules for every scenario. But as the world got more complex, our code hit a wall.

Machine Learning flips the script. Instead of hand-crafting the rules, we feed the system data and expected outcomes, letting it discover patterns on its own, much like a child learning to recognize letters on a blackboard through practice and guidance.

ML isn’t magic or consciousness; it’s simply a powerful shift in how we build technology.

Consider this article just the tip of the iceberg, a light appetizer to help you rethink how we solve problems with code. We’ve covered traditional logic, its limits, and what motivates AI, but we are only getting started!

In the upcoming articles in this series, we will dive into:

  • What an ML model actually is
  • The main types of Machine Learning
  • How to build and train your very first model
  • What Deep Learning is

…and so much more. Keep an eye out!

I hope you enjoyed reading this article as much as I enjoyed writing it.

Happy learning!

References: Link to heading

  • Polanyi’s paradox - Wikipedia
  • Deep Learning with PyTorch, 3rd Edition
  • Gemini! (For bouncing ideas and improving clarity)