📘 Day 3 – Multiple Classifiers & Boolean Logic

ABHISHEK UBABHISHEK UB
4 min read

(from the book Make Your Own Neural Network)

Today’s topic was a very interesting one — we’re starting to get into multiple classifiers.
Till now we were working with simple predictors, classifiers, parameters — all those were working pretty well. But now it starts getting complicated when the neural network has multiple parameters to train on.
This is also one of the most important concepts to understand.


🧠 Boolean Logic Gates – AND, OR, NOT, XOR

We started off by talking about Boolean logic gates.
These are basic logical operations — like AND, OR, and so on — and they work with simple true/false (1/0) inputs.

Let’s take an example of the AND function:
Say “You can have your pudding only if you’ve eaten your vegetables AND if you’re still hungry.”
This means both the inputs have to be true for you to get pudding.
So — if you’re hungry but haven’t eaten your vegetables — then sorry, no pudding.
This is a simple Boolean AND gate.

Now take another example — an OR gate:
“You can play in the park if it’s the weekend OR you’re on annual leave.”
Here, any one input being true is enough for the output to be true.
So if it’s not a weekend, but you're on leave — still you can go to the park.

One more way to understand it —
Let’s say we have two conditions, and the rule is:

  • It’s not true if only one of them is true.
    So if I’m hungry, but haven’t eaten my vegetables — I can’t have pudding.
    Both must be true for the result to be true — that’s AND.

But if any one is enough, then it's OR.


🧮 Structure – 2 Inputs, 1 Output

These gates basically follow a simple structure:
Two inputs → processing (based on the logic gate) → One output.

And most of the linear algebra used in neural networks is just based on these simple Boolean logic functions.

Now when you plot these logic gates on a graph:

  • If we use the AND function, the graph will look like a clear separation where only one region gives “true”.

  • If we use OR, the graph shows more area where the output is true — since it’s easier to satisfy OR condition.


Exclusive OR (XOR) – The Twister Gate

Now we come to a more interesting logic gate — XOR (Exclusive OR).

XOR is kind of similar to OR, but with one big twist:

  • If both inputs are the same — either 0,0 or 1,1 — the output is false.

  • Only when the inputs are different1,0 or 0,1 — the output is true.

So XOR behaves like this:

Input AInput BOutput
000
110
011
101

Now here’s the problem:

If you try to plot XOR on a graph, it becomes super hard to separate the true and false outputs using a straight line.
Why? Because the true values are on opposite corners of the graph — they’re not linearly separable.

This means a simple linear classifier can’t solve XOR.

This is where the need for multiple classifiers comes in.


🧱 Why We Need Multiple Classifiers

Since a single linear classifier can’t deal with XOR, we solve it by introducing two classifiers.

Each one focuses on a different part of the data — and together, they’re able to separate XOR-type logic correctly.

So the idea is:
If one classifier can’t solve it alone, stack multiple simple ones and break the problem down into smaller pieces.

This is the main key point:

A simple linear classifier can’t separate data if that data isn’t governed by a single straight dividing line.
But the solution is simple — just use multiple linear classifiers.

So basically, if the data is governed by something like XOR (which has a non-linear pattern), we divide the problem into smaller parts — and then solve each with a linear function.

This is also how neural networks are able to solve complex problems — not by using magic, but by layering simple solutions.


🧠 Final Takeaways from Today:

  • Boolean logic gates like AND, OR, and XOR are super important in understanding how machines think.

  • XOR is special because it’s not linearly separable.

  • A single classifier is not enough for such problems.

  • But with multiple classifiers, even complex gates like XOR can be handled easily.

That’s it for Day 3. I’m hyped to keep going.

0
Subscribe to my newsletter

Read articles from ABHISHEK UB directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

ABHISHEK UB
ABHISHEK UB

Aspiring AI Engineer | Fullstack Developer in progress | Growing passion for Data Science & building impactful tech.