WEBVTT

00:00:00.000 --> 00:00:02.520
Welcome to the Deep Dive. I'm really glad you're

00:00:02.520 --> 00:00:04.160
joining us today because we are looking at something

00:00:04.160 --> 00:00:06.599
that is going to fundamentally change the way

00:00:06.599 --> 00:00:08.259
you look at a simple string of numbers. Yeah,

00:00:08.279 --> 00:00:10.500
it really shifts your entire perspective. It

00:00:10.500 --> 00:00:13.599
does. Today we're exploring a single remarkably

00:00:13.599 --> 00:00:16.539
dense source that you shared with us. It's a

00:00:16.539 --> 00:00:19.480
comprehensive overview of a concept called Polish

00:00:19.480 --> 00:00:22.199
notation. Which is just a brilliant piece of

00:00:22.199 --> 00:00:24.640
history. Right. And our mission for this deep

00:00:24.640 --> 00:00:27.859
dive is to explore how simply, you know, rearranging

00:00:27.859 --> 00:00:29.920
the order of mathematical symbols completely

00:00:29.920 --> 00:00:33.039
eliminates the need for parentheses. We're going

00:00:33.039 --> 00:00:35.539
to look at how it revolutionized early formal

00:00:35.539 --> 00:00:39.259
logic and how it ultimately became the secret

00:00:39.259 --> 00:00:41.659
language of the computers we rely on every single

00:00:41.659 --> 00:00:43.820
day. To really understand the origins of this,

00:00:43.920 --> 00:00:46.020
you have to imagine the intellectual atmosphere

00:00:46.020 --> 00:00:50.479
of a, well, a classic 1920s European library.

00:00:50.780 --> 00:00:53.700
Oh, I love that visual. Right. Picture towering

00:00:53.700 --> 00:00:56.820
oak bookshelves, academics debating in the halls,

00:00:56.920 --> 00:00:59.340
and tables covered in these beautifully complex,

00:00:59.560 --> 00:01:03.000
dusty logic manuscripts. That was the exact environment

00:01:03.000 --> 00:01:06.239
where this concept was born. Today we are going

00:01:06.239 --> 00:01:08.840
to synthesize the history, the mechanics, and

00:01:08.840 --> 00:01:11.500
the modern applications of this notation, showing

00:01:11.500 --> 00:01:14.159
not just what it is, but why it actually matters

00:01:14.159 --> 00:01:16.590
to you. I want to set the stage for you, the

00:01:16.590 --> 00:01:18.510
listener, for a second. Think about the last

00:01:18.510 --> 00:01:20.590
time you tried to write out a really complex

00:01:20.590 --> 00:01:24.709
math problem or a dense logic puzzle. Or even

00:01:24.709 --> 00:01:28.049
just a long formula in Excel. Yes, exactly. Imagine

00:01:28.049 --> 00:01:30.510
you're typing a convoluted equation into a spreadsheet.

00:01:30.870 --> 00:01:32.730
You probably find yourself completely bogged

00:01:32.730 --> 00:01:34.829
down by brackets, parentheses, and the strict

00:01:34.829 --> 00:01:37.090
rules of the order of operations. It gets messy

00:01:37.090 --> 00:01:39.260
fast. It really does. You know the drill making.

00:01:39.379 --> 00:01:41.400
Sure, you have exactly three closed brackets

00:01:41.400 --> 00:01:43.680
at the end of your formula just to perfectly

00:01:43.680 --> 00:01:45.640
match the three open brackets at the beginning.

00:01:45.799 --> 00:01:48.359
And if you miss one? Right. A single typo breaks

00:01:48.359 --> 00:01:50.680
the entire formula. The software just yells at

00:01:50.680 --> 00:01:53.219
you. But what if there was a cleaner, completely

00:01:53.219 --> 00:01:55.079
linear way? What if you could just write the

00:01:55.079 --> 00:01:57.219
instructions straight across left to right and

00:01:57.219 --> 00:02:00.920
the math just worked? That is the exact problem

00:02:00.920 --> 00:02:03.659
Polish notation solves. It strips away all of

00:02:03.659 --> 00:02:06.599
that visual clutter and relies purely on the

00:02:06.599 --> 00:02:08.860
sequence of the information. Okay, let's unpack

00:02:08.860 --> 00:02:12.000
this. We all grew up on standard infix notation.

00:02:12.319 --> 00:02:15.180
That means the operator, the plus sign, the minus

00:02:15.180 --> 00:02:17.319
sign, the multiplication symbol, it's trapped

00:02:17.319 --> 00:02:19.639
right in the middle of the numbers it's operating

00:02:19.639 --> 00:02:22.759
on, like 1 plus 2. Right, the operator is fixed

00:02:22.759 --> 00:02:25.719
in the center. Exactly. But Polish notation...

00:02:25.949 --> 00:02:28.469
which is also called prefix notation, rips that

00:02:28.469 --> 00:02:31.330
operator out and puts it at the very front. So

00:02:31.330 --> 00:02:33.770
it becomes plus 1, 2. And while putting the plus

00:02:33.770 --> 00:02:35.710
sign before the numbers might look a little strange

00:02:35.710 --> 00:02:38.509
for simple addition, its true power reveals itself

00:02:38.509 --> 00:02:40.509
when the equations become layered and highly

00:02:40.509 --> 00:02:43.610
complex. Right. Let's look at a harder problem.

00:02:43.750 --> 00:02:46.129
Let's challenge you, the listener, to visualize

00:02:46.129 --> 00:02:49.349
this expression, open parenthesis, 5 minus 6,

00:02:49.590 --> 00:02:53.349
close parenthesis, multiplied by 7. So standard

00:02:53.349 --> 00:02:56.819
infix notation. Right. Because we use standard

00:02:56.819 --> 00:02:59.580
infix notation, we absolutely need those parentheses.

00:02:59.979 --> 00:03:03.199
If we drop them, the order of operations forces

00:03:03.199 --> 00:03:06.240
us to multiply the 6 and the 7 first, completely

00:03:06.240 --> 00:03:08.840
changing the math. What's fascinating here is

00:03:08.840 --> 00:03:12.080
how Polish notation elegantly bypasses that entire

00:03:12.080 --> 00:03:15.750
problem. In this prefix system, the operator

00:03:15.750 --> 00:03:19.310
always precedes its operands. So if I have that

00:03:19.310 --> 00:03:20.969
same equation, I'd start with the multiplication

00:03:20.969 --> 00:03:23.610
because that's the outermost operation. I write

00:03:23.610 --> 00:03:26.530
the multiplication sign first. But where does

00:03:26.530 --> 00:03:29.310
the subtraction go if I just write multiply 5

00:03:29.310 --> 00:03:32.629
minus 6, 7? That just looks like a jumbled mess

00:03:32.629 --> 00:03:34.870
of characters. How does the structure actually

00:03:34.870 --> 00:03:37.080
hold together without the brackets? That's the

00:03:37.080 --> 00:03:39.819
trick. You work strictly by operations. You have

00:03:39.819 --> 00:03:42.020
your multiplication sign. It needs two operands.

00:03:42.120 --> 00:03:44.120
The first operand isn't a single number. It's

00:03:44.120 --> 00:03:46.919
the result of 5 minus 6. Oh, I see. So immediately

00:03:46.919 --> 00:03:48.620
after the multiplication sign, you write the

00:03:48.620 --> 00:03:50.620
subtraction sign, followed by the 5 and the 6.

00:03:50.819 --> 00:03:53.180
Then finally, you put the 7 at the very end.

00:03:53.219 --> 00:03:55.580
The sequence becomes multiply minus 5, 6, 7.

00:03:55.960 --> 00:03:58.659
And because every operator has a strict rule

00:03:58.659 --> 00:04:01.240
about how many numbers it needs, the brackets

00:04:01.240 --> 00:04:04.849
just vanish. Precisely. That property is called

00:04:04.849 --> 00:04:07.710
its arity. A subtraction sign has an arity of

00:04:07.710 --> 00:04:10.409
two. It always needs exactly two numbers following

00:04:10.409 --> 00:04:13.210
it. A multiplication sign also has an arity of

00:04:13.210 --> 00:04:16.750
two. The structure regulates itself. No arbitrary

00:04:16.750 --> 00:04:19.930
order operations to memorize and no hunting for

00:04:19.930 --> 00:04:22.290
missing parentheses. But wait, what about order?

00:04:22.730 --> 00:04:24.269
If I'm multiplying, it doesn't really matter

00:04:24.269 --> 00:04:27.649
if I say 3 times 4 or 4 times 3, but division

00:04:27.649 --> 00:04:30.250
and subtraction are noncommutative. The order

00:04:30.250 --> 00:04:32.629
matters immensely. Does shifting everything to

00:04:32.629 --> 00:04:35.269
a linear line create confusion there? Not at

00:04:35.269 --> 00:04:37.730
all. The source provides clear examples to ensure

00:04:37.730 --> 00:04:40.709
there is zero ambiguity. When dealing with noncommutative

00:04:40.709 --> 00:04:42.769
operations, the sequence of the operands directly

00:04:42.769 --> 00:04:44.990
follows how the operator takes its arguments,

00:04:45.189 --> 00:04:47.410
moving strictly left to right. So the order is

00:04:47.410 --> 00:04:49.819
logged in. Exactly. If you write the division

00:04:49.819 --> 00:04:52.379
symbol followed by 10 and then 5, it strictly

00:04:52.379 --> 00:04:55.259
means 10 divided by 5. If you write the minus

00:04:55.259 --> 00:04:58.199
sign followed by 7 and then 6, it strictly means

00:04:58.199 --> 00:05:01.399
you subtract 6 from 7. The action word dictates

00:05:01.399 --> 00:05:03.420
exactly what happens to the sequence that follows.

00:05:03.639 --> 00:05:05.779
Imagine writing out instructions in your daily

00:05:05.779 --> 00:05:08.339
life where the action always dictates exactly

00:05:08.339 --> 00:05:11.740
what follows, eliminating any ambiguity. You

00:05:11.740 --> 00:05:14.810
never have to... backtrack or second guess which

00:05:14.810 --> 00:05:16.709
part of the instruction takes precedence. It's

00:05:16.709 --> 00:05:20.029
just a pure, linear flow of logic. It is incredibly

00:05:20.029 --> 00:05:22.610
elegant. And to understand where this pursuit

00:05:22.610 --> 00:05:24.709
of pure logic came from, we have to travel back

00:05:24.709 --> 00:05:28.110
to the vibrant intellectual era of 1920s Poland.

00:05:28.430 --> 00:05:31.389
The history here is fascinating. The Polish in

00:05:31.389 --> 00:05:33.589
Polish notation refers to the nationality of

00:05:33.589 --> 00:05:36.430
its inventor, a Leducian named Jan Łukasiewicz.

00:05:36.610 --> 00:05:38.889
He invented this parenthesis -free notation in

00:05:38.889 --> 00:05:41.829
1924. Right. He actually mentioned it in a lithograph

00:05:41.829 --> 00:05:45.009
report in Polish in 1929 and then formally detailed

00:05:45.009 --> 00:05:48.610
it in a 1931 paper. It's gone by a few names

00:05:48.610 --> 00:05:50.449
over the years. You'll hear it called Normal

00:05:50.449 --> 00:05:53.009
Polish Notation or NPN. Sometimes it's called

00:05:53.009 --> 00:05:55.569
Warsaw Notation or Eastern Notation. We should

00:05:55.569 --> 00:05:58.250
provide a bit of historical context, too. While

00:05:58.250 --> 00:06:01.089
Ukaziewicz created the first linearly written

00:06:01.089 --> 00:06:03.730
parenthesis -free notation, he wasn't the only

00:06:03.730 --> 00:06:06.989
one chasing this kind of logical purity. Moses

00:06:06.989 --> 00:06:09.310
Schoenfinkel, whose work was edited by Heinrich

00:06:09.310 --> 00:06:12.430
Behmann in 1924, had the idea of eliminating

00:06:12.430 --> 00:06:14.850
parentheses in logic formulas. Oh, true story.

00:06:15.029 --> 00:06:18.529
Yeah, and even further back, in 1879, Gottlob

00:06:18.529 --> 00:06:21.689
Friege proposed a visual parenthesis -free notation

00:06:21.689 --> 00:06:24.490
called Bigriff's Rift. But Friege's system was

00:06:24.490 --> 00:06:26.829
visual, right? It relied on two -dimensional

00:06:26.829 --> 00:06:29.689
lines and trees, which made it an absolute nightmare

00:06:29.689 --> 00:06:32.310
to actually typeset and print in a book. Oh,

00:06:32.350 --> 00:06:34.490
completely impractical for mass printing. Yeah.

00:06:35.600 --> 00:06:37.360
version struck a chord because it was linear.

00:06:37.480 --> 00:06:39.639
It solved the typesetting problem for logic.

00:06:39.920 --> 00:06:42.899
Exactly. It was so impactful that Alonzo Church,

00:06:43.139 --> 00:06:46.459
an absolute giant in mathematical logic, specifically

00:06:46.459 --> 00:06:49.300
praised Ukasiewicz's parenthesis -free notation

00:06:49.300 --> 00:06:53.019
in his classic 1944 book. Church called it worthy

00:06:53.019 --> 00:06:55.420
of remark, contrasting its elegance directly

00:06:55.420 --> 00:06:57.579
against the heavyweights of the time, Alfred

00:06:57.579 --> 00:06:59.779
North Whitehead and Bertrand Russell, and their

00:06:59.779 --> 00:07:02.980
notoriously dense masterwork, Principia Mathematica.

00:07:03.240 --> 00:07:06.060
That is a huge endorsement. Principia Mathematica

00:07:06.060 --> 00:07:09.220
is famous for taking hundreds of pages of incredibly

00:07:09.220 --> 00:07:12.399
dense, bracket -heavy notation just to prove

00:07:12.399 --> 00:07:14.860
that 1 plus 1 equals 2. It's infamous for it.

00:07:14.980 --> 00:07:18.300
Yeah. To have Church point to Ukasiewicz's linear

00:07:18.300 --> 00:07:20.279
string and say, look at how much cleaner this

00:07:20.279 --> 00:07:23.899
is, speaks volumes. It does. And we should note

00:07:23.899 --> 00:07:26.379
that Ukasiewicz didn't just use this notation

00:07:26.379 --> 00:07:29.759
for standard arithmetic. His primary focus was

00:07:29.759 --> 00:07:32.699
using it for complex formal logic. If you were

00:07:32.699 --> 00:07:34.879
to look at his original chalkboards, you wouldn't

00:07:34.879 --> 00:07:37.459
see math symbols. You'd see capital letters based

00:07:37.459 --> 00:07:39.420
on Polish words. Let's break those down because

00:07:39.420 --> 00:07:40.920
the language connection is really interesting.

00:07:41.060 --> 00:07:44.220
For the concept of negation, like saying not

00:07:44.220 --> 00:07:47.240
true, he used the letter N, which stands for

00:07:47.240 --> 00:07:49.699
the Polish word negacja. Makes perfect sense.

00:07:49.939 --> 00:07:51.779
Right. For the material conditional, which is

00:07:51.779 --> 00:07:55.060
an if -then statement, he used C for implicacja.

00:07:55.470 --> 00:07:59.569
For disjunction, or or, he used a for alternativa.

00:07:59.689 --> 00:08:02.810
And for conjunction, meaning and, he used k for

00:08:02.810 --> 00:08:05.930
konimcha. So you could write out massive, sprawling

00:08:05.930 --> 00:08:08.370
logical arguments just using strings of letters

00:08:08.370 --> 00:08:11.129
and variables with zero punctuation. But that

00:08:11.129 --> 00:08:13.649
inevitably leads to some academic friction, doesn't

00:08:13.649 --> 00:08:16.430
it? When you start claiming letters for specific

00:08:16.430 --> 00:08:19.209
logical functions, what happens when someone

00:08:19.209 --> 00:08:21.589
else wants to expand the system? This is where

00:08:21.589 --> 00:08:24.730
we run into a wonderfully quirky historical contradiction.

00:08:25.329 --> 00:08:27.790
Another logician by the name of Bocheski came

00:08:27.790 --> 00:08:31.629
along and expanded Ukasevich's system. He wanted

00:08:31.629 --> 00:08:34.629
to include all 16 binary connectives for classical

00:08:34.629 --> 00:08:38.389
propositional logic. But in doing so, his notation

00:08:38.389 --> 00:08:41.470
clashed horribly with Ukasevich's work in a different

00:08:41.470 --> 00:08:43.970
area called modal logic. Because they were both

00:08:43.970 --> 00:08:46.090
trying to use the same letters for entirely different

00:08:46.090 --> 00:08:48.240
things. You can see if it was using the letter

00:08:48.240 --> 00:08:51.039
M to mean possibility from the Polish word, we

00:08:51.039 --> 00:08:52.919
leave Osh and the letter L to mean necessity

00:08:52.919 --> 00:08:57.159
from Koneczny precisely. But Bocheski, building

00:08:57.159 --> 00:08:59.980
his own massive extension of the very same parenthesis

00:08:59.980 --> 00:09:02.860
free notation, decided to use M and L for completely

00:09:02.860 --> 00:09:04.659
different things, specifically non implication

00:09:04.659 --> 00:09:07.379
and converse non implication in classical logic.

00:09:07.600 --> 00:09:10.620
You had these two brilliant minds working in

00:09:10.620 --> 00:09:13.620
the exact same ecosystem, using the exact same

00:09:13.620 --> 00:09:16.610
letters to mean entirely different logical. concepts.

00:09:16.690 --> 00:09:19.970
It highlights just how specialized and dense

00:09:19.970 --> 00:09:22.590
this field of study was becoming. Here's where

00:09:22.590 --> 00:09:24.710
it gets really interesting, though, because despite

00:09:24.710 --> 00:09:27.730
this being such a beautifully pure system, such

00:09:27.730 --> 00:09:29.970
an elegant way to write out logic without any

00:09:29.970 --> 00:09:33.529
brackets, human beings actually ended up hating

00:09:33.529 --> 00:09:36.879
Polish notation. It is the ultimate irony. The

00:09:36.879 --> 00:09:39.379
system was designed by a human mind to make human

00:09:39.379 --> 00:09:42.299
logic more streamlined, but the human brain just

00:09:42.299 --> 00:09:44.559
doesn't process information that way very well.

00:09:44.720 --> 00:09:46.860
It's fascinating because researchers later found

00:09:46.860 --> 00:09:49.379
that humans actually strongly prefer visual formatting.

00:09:49.820 --> 00:09:53.039
A 2011 paper by Martinez -Nava, highlighted in

00:09:53.039 --> 00:09:55.080
the materials, points out that Polish notation

00:09:55.080 --> 00:09:58.539
fell into disuse, precisely because of how hostile

00:09:58.539 --> 00:10:01.399
it is for human reading. Our eyes naturally want

00:10:01.399 --> 00:10:03.379
to look at a spatial relationship. We want that

00:10:03.379 --> 00:10:05.720
visual balance. Yes, we want to see a number,

00:10:05.820 --> 00:10:07.399
an operator in the middle, and another number.

00:10:07.519 --> 00:10:09.860
That's how we balance concepts in our head. Reading

00:10:09.860 --> 00:10:12.220
a string of prefix commands requires you to hold

00:10:12.220 --> 00:10:14.519
a tremendous amount of abstract information in

00:10:14.519 --> 00:10:17.000
your short -term memory. You have to stack all

00:10:17.000 --> 00:10:19.059
the operations in your mind before you ever get

00:10:19.059 --> 00:10:22.250
to the numbers they apply to. The research specifically

00:10:22.250 --> 00:10:24.509
highlights how incredibly difficult this makes

00:10:24.509 --> 00:10:27.289
reading for individuals with dyslexia. Right.

00:10:27.409 --> 00:10:29.889
It removes all visual anchors. But you know what

00:10:29.889 --> 00:10:32.870
doesn't need visual anchors? A microchip. If

00:10:32.870 --> 00:10:35.450
we connect this to the bigger picture, this failure

00:10:35.450 --> 00:10:37.870
in the realm of human cognition paved the way

00:10:37.870 --> 00:10:40.509
for its greatest triumph. While humans struggled

00:10:40.509 --> 00:10:43.269
immensely to read a sequential, parenthesis -free

00:10:43.269 --> 00:10:46.330
stream of logic, computers absolutely loved it.

00:10:46.549 --> 00:10:49.580
Humans need spatial cues. The computer processor

00:10:49.580 --> 00:10:51.759
just wants a line of instructions it can chew

00:10:51.759 --> 00:10:54.480
through one by one. The material details what's

00:10:54.480 --> 00:10:57.019
called the evaluation algorithm. And this is

00:10:57.019 --> 00:11:00.009
where Polish notation becomes a superpower. Let

00:11:00.009 --> 00:11:02.049
me explain how this algorithm works, as it is

00:11:02.049 --> 00:11:05.230
foundational to modern computing. Prefix expressions

00:11:05.230 --> 00:11:07.750
can be evaluated by a computer moving left to

00:11:07.750 --> 00:11:10.230
right or right to left using something called

00:11:10.230 --> 00:11:13.490
a stack or a push -down store. Imagine a spring

00:11:13.490 --> 00:11:16.190
-loaded stack of cafeteria trays. Okay, I like

00:11:16.190 --> 00:11:18.590
that. You push a new tray down onto the top,

00:11:18.710 --> 00:11:21.090
and when you need one, you pop the top one off.

00:11:21.230 --> 00:11:23.289
Okay, I can picture that, but how does the computer

00:11:23.289 --> 00:11:25.649
actually use that tray dispenser to do math?

00:11:25.929 --> 00:11:29.100
The computer... reads the input string token

00:11:29.100 --> 00:11:32.980
by token, a token being either an operator like

00:11:32.980 --> 00:11:36.019
a plus sign or an operand like a number. Let's

00:11:36.019 --> 00:11:39.700
say it is evaluating from left to right. It pushes

00:11:39.700 --> 00:11:42.399
these tokens onto the stack one by one. It keeps

00:11:42.399 --> 00:11:44.379
pushing them down until it realizes that the

00:11:44.379 --> 00:11:46.840
top entries of the stack perfectly match the

00:11:46.840 --> 00:11:49.080
requirements, the arity of the operator sitting

00:11:49.080 --> 00:11:52.259
just below them. So if the computer pushes down

00:11:52.259 --> 00:11:54.600
a multiplication sign, it knows it needs two

00:11:54.600 --> 00:11:57.299
numbers. It pushes down a five. It pushes down

00:11:57.299 --> 00:11:59.940
a six. Suddenly it says, wait, I have an operator

00:11:59.940 --> 00:12:02.779
and the exact number of operands it needs. Exactly.

00:12:02.960 --> 00:12:05.779
Boom. It executes the multiplication right then

00:12:05.779 --> 00:12:07.840
and there, takes the 5, the 6, and the multiplication

00:12:07.840 --> 00:12:10.200
sign off the stack, and replaces them with the

00:12:10.200 --> 00:12:12.200
result 30. Then it just keeps reading the rest

00:12:12.200 --> 00:12:14.259
of the string. But wait, that makes sense for

00:12:14.259 --> 00:12:16.419
simple math, but what happens when the computer

00:12:16.419 --> 00:12:19.460
hits a massive nested equation? Doesn't the stack

00:12:19.460 --> 00:12:21.580
get overloaded, holding all those operators waiting

00:12:21.580 --> 00:12:24.139
for numbers? That's the brilliance of it. It

00:12:24.139 --> 00:12:26.299
doesn't overload because the moment any local

00:12:26.299 --> 00:12:29.200
condition is met, it collapses the data into

00:12:29.200 --> 00:12:31.639
a single result. The computer doesn't need to

00:12:31.639 --> 00:12:33.740
scan back and forth across a massive equation

00:12:33.740 --> 00:12:36.059
looking for brackets to figure out what to do

00:12:36.059 --> 00:12:38.679
first. It just acts immediately. Yes. It doesn't

00:12:38.679 --> 00:12:40.919
need the capability of arbitrary stack inspection.

00:12:41.080 --> 00:12:44.679
It just reads sequentially, pushes data onto

00:12:44.679 --> 00:12:47.379
the stack, and executes the moment the already

00:12:47.379 --> 00:12:49.659
conditions are met. It is incredibly efficient.

00:12:50.169 --> 00:12:52.210
This is why for programming language interpreters,

00:12:52.250 --> 00:12:55.049
Polish notation is effortlessly parsed into abstract

00:12:55.049 --> 00:12:58.289
syntax trees. Yes. An abstract syntax tree, or

00:12:58.289 --> 00:13:01.809
AST, is how a compiler understands code. It builds

00:13:01.809 --> 00:13:04.070
a tree where the operator is the root and the

00:13:04.070 --> 00:13:06.769
numbers are the branches. With normal human math,

00:13:06.929 --> 00:13:08.870
building that tree is computationally expensive.

00:13:09.330 --> 00:13:12.370
You have to program complex rules for precedence

00:13:12.370 --> 00:13:14.090
and parentheses. Which takes time and memory.

00:13:14.289 --> 00:13:16.649
Right. But Polish notation essentially is the

00:13:16.649 --> 00:13:20.120
tree just written on a single line. perfect one

00:13:20.120 --> 00:13:22.419
-to -one mathematical representation of the code

00:13:22.419 --> 00:13:25.200
structure. It strips away all the ambiguity of

00:13:25.200 --> 00:13:28.120
human language, leaving only the pure, executable

00:13:28.120 --> 00:13:30.419
logic. Which brings us to where we are today.

00:13:31.039 --> 00:13:33.879
I want to ask you, the listener, have you ever

00:13:33.879 --> 00:13:36.440
tinkered with coding? Have you ever written a

00:13:36.440 --> 00:13:39.919
script to automate a task or used a highly advanced

00:13:39.919 --> 00:13:42.639
engineering calculator? Because if you have,

00:13:42.759 --> 00:13:45.399
you have interacted with the ghost of Jan Ukasiewicz.

00:13:45.960 --> 00:13:48.580
Polish notation didn't die out. It just went

00:13:48.580 --> 00:13:50.580
behind the scenes. The modern implementations

00:13:50.580 --> 00:13:53.500
are vast, and they show just how integral this

00:13:53.500 --> 00:13:56.120
logic remains. Prefix notation is still heavily

00:13:56.120 --> 00:13:58.840
used in Lisp programming with its S expressions.

00:13:59.440 --> 00:14:02.379
Now, it's worth noting that Lisp does use parentheses,

00:14:02.659 --> 00:14:05.100
which seems counterintuitive to what we've been

00:14:05.100 --> 00:14:06.820
discussing. A bit of a paradox, yeah. But that's

00:14:06.820 --> 00:14:09.340
a unique case because Lisp functions are treated

00:14:09.340 --> 00:14:12.559
as first -class data. and are variatic, meaning

00:14:12.559 --> 00:14:14.500
they can take a variable number of arguments.

00:14:14.759 --> 00:14:17.620
The parentheses just help group them. But the

00:14:17.620 --> 00:14:20.360
core structural logic is still entirely prefix.

00:14:20.679 --> 00:14:22.620
And we see it in data querying as well. If you

00:14:22.620 --> 00:14:24.820
work in IT, you are likely familiar with LDD

00:14:24.820 --> 00:14:27.980
filter syntax. Yes. LDAP is a great example.

00:14:28.179 --> 00:14:30.639
If you need to search a massive company database

00:14:30.639 --> 00:14:33.440
for a specific user profile, you have to group

00:14:33.440 --> 00:14:36.179
complex logic together. Find someone in marketing,

00:14:36.320 --> 00:14:40.830
ND, who is either a manager or a director. LDAP

00:14:40.830 --> 00:14:43.529
uses prefix notation to cleanly encapsulate that

00:14:43.529 --> 00:14:46.269
logic without needing arbitrary precedence rules

00:14:46.269 --> 00:14:49.669
for AND versus OR. It keeps it clean. You also

00:14:49.669 --> 00:14:51.450
see it in the TCL programming language through

00:14:51.450 --> 00:14:53.850
its MathOp library, the AMBI programming language,

00:14:54.029 --> 00:14:56.690
and even CoffeeScript, which allows prefix notation

00:14:56.690 --> 00:14:58.950
for function calls. But we also have to talk

00:14:58.950 --> 00:15:00.909
about its mirror image. While prefix notation

00:15:00.909 --> 00:15:03.350
puts the operator first, there is a variation

00:15:03.350 --> 00:15:06.470
called reverse Polish notation, or RPN. This

00:15:06.470 --> 00:15:09.210
is post -fix notation. In RPN, the operators

00:15:09.210 --> 00:15:11.220
follow... the operands. So instead of plus one

00:15:11.220 --> 00:15:13.659
two, you write one two plus. And RPN is everywhere

00:15:13.659 --> 00:15:15.539
in the hardware and stack -oriented software

00:15:15.539 --> 00:15:18.179
world. It is heavily used in stack -oriented

00:15:18.179 --> 00:15:20.259
languages like PostScript, which is the foundational

00:15:20.259 --> 00:15:22.759
language that powers modern printing, and the

00:15:22.759 --> 00:15:25.100
fourth programming language. But its most famous

00:15:25.100 --> 00:15:28.299
application is arguably in Hewlett -Packard calculators.

00:15:28.519 --> 00:15:31.259
If you have ever seen an engineer or a finance

00:15:31.259 --> 00:15:34.720
professional using a classic HP calculator, you

00:15:34.720 --> 00:15:37.460
were watching reverse Polish notation in action.

00:15:38.000 --> 00:15:40.340
They loved those machines because when you were

00:15:40.340 --> 00:15:43.220
calculating load -bearing stress or complex compound

00:15:43.220 --> 00:15:46.320
interest, you were dealing with massive formulas.

00:15:46.659 --> 00:15:48.980
You'd get lost on a normal calculator. Exactly.

00:15:49.039 --> 00:15:52.379
With a standard calculator, you need a notepad

00:15:52.379 --> 00:15:55.330
to write down intermediate results. Or you need

00:15:55.330 --> 00:15:57.789
to perfectly track eight levels of parentheses.

00:15:58.389 --> 00:16:00.769
With an RPN calculator, you just keep pushing

00:16:00.769 --> 00:16:02.610
numbers onto the stack and applying operations.

00:16:03.129 --> 00:16:06.009
It felt like you were manually driving the computer's

00:16:06.009 --> 00:16:08.649
processor. It operates at a very low level. Post

00:16:08.649 --> 00:16:10.549
-fix operators are even used by stack machines

00:16:10.549 --> 00:16:13.110
like the Burroughs Large Systems. And right toward

00:16:13.110 --> 00:16:15.669
the end of our analysis, there is an incredibly

00:16:15.669 --> 00:16:18.669
dense mathematical rule that proves why all of

00:16:18.669 --> 00:16:20.830
this works so flawlessly. It's regarding the

00:16:20.830 --> 00:16:23.509
equation of returns. Yes. It states that the

00:16:23.509 --> 00:16:25.919
number... of return values of an expression equals

00:16:25.919 --> 00:16:27.840
the difference between the number of operands

00:16:27.840 --> 00:16:30.620
and the total arity of the operators minus the

00:16:30.620 --> 00:16:32.860
total number of return values of the operators.

00:16:33.159 --> 00:16:35.960
So what does this all mean? That is a very dense

00:16:35.960 --> 00:16:38.919
sentence to process audibly. Let's actually test

00:16:38.919 --> 00:16:41.940
that to give you, the listener, a concrete idea

00:16:41.940 --> 00:16:43.580
of what's happening under the hood. Let's track

00:16:43.580 --> 00:16:46.559
it in real time using our earlier example. Multiply

00:16:46.559 --> 00:16:50.299
minus 5, 6, 7. First we count the operands, the

00:16:50.299 --> 00:16:53.690
numbers. We have 5. Six and seven. That's three

00:16:53.690 --> 00:16:56.129
operands. Okay, three operands. And then we look

00:16:56.129 --> 00:16:58.429
at the total arity of our operators. We have

00:16:58.429 --> 00:17:00.570
a multiplication sign and a subtraction sign.

00:17:00.809 --> 00:17:03.309
They each require two inputs, so the total arity

00:17:03.309 --> 00:17:05.890
is four. Exactly. And those two operators will

00:17:05.890 --> 00:17:08.769
eventually spit out two outputs or two return

00:17:08.769 --> 00:17:12.170
values total. What that complex formula essentially

00:17:12.170 --> 00:17:14.710
proves is that when you map all those input requirements

00:17:14.710 --> 00:17:16.690
and output values together against the starting

00:17:16.690 --> 00:17:19.849
numbers, the entire sequence perfectly collapses

00:17:19.849 --> 00:17:22.690
to exactly one final answer. It mathematically

00:17:22.690 --> 00:17:25.650
balances out. There are no dangling numbers left

00:17:25.650 --> 00:17:27.750
on the stack, and there are no missing variables

00:17:27.750 --> 00:17:31.150
causing a crash. It is a perfect, unbreakable

00:17:31.150 --> 00:17:34.279
mathematical loop. apparently verifies itself

00:17:34.279 --> 00:17:36.759
without needing any outside punctuation to hold

00:17:36.759 --> 00:17:39.119
it together. It is the ultimate expression of

00:17:39.119 --> 00:17:41.720
logical self -sufficiency. And that brings us

00:17:41.720 --> 00:17:44.019
to the end of this journey. To summarize our

00:17:44.019 --> 00:17:46.059
deep drive today, we explored the brilliant,

00:17:46.119 --> 00:17:50.000
elegant concept of Polish notation. Born from

00:17:50.000 --> 00:17:53.819
the mind of Jan Ukasiewicz in 1920s Poland as

00:17:53.819 --> 00:17:56.960
a way to simplify and purify formal logic, it

00:17:56.960 --> 00:17:59.339
proved to be a bit too alien for the spatial

00:17:59.339 --> 00:18:01.799
processing brains of human beings. It just didn't

00:18:01.799 --> 00:18:04.119
catch on for everyday writing. Right. It was

00:18:04.119 --> 00:18:06.299
largely abandoned as a written language because

00:18:06.299 --> 00:18:08.380
it was just too hostile to human reading habits.

00:18:08.839 --> 00:18:11.859
But its pure, parenthesis -free, linear structure

00:18:11.859 --> 00:18:14.839
turned out to be the exact perfect match for

00:18:14.839 --> 00:18:17.359
the way computer processors operate, making it

00:18:17.359 --> 00:18:20.119
the foundational high - efficient logic language

00:18:20.119 --> 00:18:23.299
that quietly powers modern computer parsing,

00:18:23.319 --> 00:18:26.279
algorithmic stacks, and engineering calculators

00:18:26.279 --> 00:18:28.619
to this day. It is a remarkable testament to

00:18:28.619 --> 00:18:30.480
the idea that just because a system doesn't work

00:18:30.480 --> 00:18:32.480
well for human eyes doesn't mean it lacks intrinsic

00:18:32.480 --> 00:18:35.259
perfection. I want to thank you, the listener,

00:18:35.380 --> 00:18:37.539
for coming along with us on this deep dive. And

00:18:37.539 --> 00:18:39.539
as we conclude, I want to leave you with a final

00:18:39.539 --> 00:18:41.880
thought to mull over. This raises an important

00:18:41.880 --> 00:18:44.819
question. Today, we've seen how standard mathematical

00:18:44.819 --> 00:18:47.519
notation, with all its messy parentheses and

00:18:47.519 --> 00:18:50.019
precedence rules, is actually less efficient

00:18:50.019 --> 00:18:52.980
and less logical than a parenthesis -free linear

00:18:52.980 --> 00:18:56.039
string. We only use infix notation because it

00:18:56.039 --> 00:18:58.119
is what we are used to. It caters to our visual

00:18:58.119 --> 00:19:01.099
habits. So if we are still clinging to a less

00:19:01.099 --> 00:19:03.759
efficient math notation out of sheer habit, what

00:19:03.759 --> 00:19:05.960
other foundational systems in our daily lives

00:19:05.960 --> 00:19:08.490
or workplace... or our communication are we stubbornly

00:19:08.490 --> 00:19:11.289
holding onto out of comfort long after a vastly

00:19:11.289 --> 00:19:13.109
more logical alternative has been discovered.
