The Mystery of Logic

👍
6 min readOct 18, 2020

When I was at school, we had a subject called, Logic — bit of a mash between problem solving, maths, philosophy and reason. Insanely boring for some, real life detective work for others — ala me.

It all started quite the while ago — the ideas and principles of logic have been around since the dawn of time, but you could say that it became more of a thing when The Greeks and Aristotle got onto it — Aristotle’s logic became the standard model, and the basis of science and maths in the west for centuries.

Logic is the science of correct reasoning.

It seemed to disappear around the time I left school, and haven’t heard of many places still teaching the subject anymore.

The class permanently tweaked something in my head, gave me a far greater insight and perspective on the world around me. It is, in essence, the pure science of programming — everything makes sense, whether you think it does or not.

It creates the necessity of sense.

I want to say that I see a problem.

The younger generations are being taught how to build a to-do list app in react-native, instead of learning logic — if programming is the physics, Logic is the mathematics that makes the physics possible. You can’t have one without the other.

Here is a fairly straightforward example of a simple (non-maths) logic question as an example:

One day a mad scientist lined up Andy, Brandy, Candy and Dandy in a row, so that each of them could see the ones in front of them but not behind. Andy was able to see everyone else while Dandy couldn’t see anyone. Then the mad scientist declared,

“There is a red hat, a blue hat, a white hat, and another hat that is either red, blue or white. I will place them on your heads, so that you can’t see the colour of your own hat. However, you can see the hat colour of anyone in front of you.”

Starting from the back (Andy first), he asked them each in turn what the colour of their hat was. To his surprise, they all were able to correctly deduce the colour of their hat based on the responses that they heard.

Which 2 people had the same colour hats?

If Andy had seen hats of 3 different colours, then he would not have been able to deduce his own hat colour. Thus, he saw 2 hats of the same colour and 1 hat of a different colour.

If Bandy had seen 2 hats of different colors, then he would not have been able to determine his own hat color. Thus, he must have seen 2 hats of the same color, and then called out the remaining color.

Thus, Candy and Dandy had hats of the same colour.

There Are The Three Fundamental Laws of Logic

  1. Law of Identity: if any statement is true, then it is true.
  2. Law of Non-Contradiction: no statement can be both true and false at the same time and in the same sense.
  3. Law of Excluded Middle: any statement is either true or false.

Or in context..

  1. If p is true, then q is true.
  2. p is true.
  3. Therefore, q is true.

This branch of deductive reasoning has many sub-branches. Computer programming is one branch of modern symbolic logic.

Inductive Reasoning is an entirely different form of reasoning from deductive reasoning. While deductive reasoning proves things for certain, inductive reasoning evaluates the evidence to determine whether an argument is probably true or false. Since it is not always possible to prove something for certain, logicians developed principles to reason from the evidence in a way that arrives at useful conclusions. We see the benefits of this scientific reasoning all around us in modern technological world.

These are six important forms of inductive reasoning:

  1. Analogy builds arguments based on similarities between two things.
  2. Generalisation reasons from one fact to all similar facts. This is the basis for all scientific reasoning.
  3. Mill’s Methods for Experimental Inquiry were developed by John Stuart Mill to investigate the causes of scientific phenomena.
  4. Hypothetical Scientific Reasoning is used when scientists form theories about the world and test their theories with experiments.
  5. Statistical Reasoning creates and interprets statistics about our world and draws conclusions from those statistics.
  6. Probability is a science closely related to statistical reasoning. It tries to predict the future based on our knowledge of past experiences.

Informal Logic

Informal logic is the technical name for what is called Critical Thinking in modern institutions. This modern branch of logic tries to take formal logic and, by intermingling it with Rhetoric, make it into something more palatable and useful.

— Language plays a fundamental role in reasoning. Understanding how language influences our reasoning is foundational to understanding reasoning itself.

— Classification is the organising of different things into separate classes according to similarities and differences. This helps us understand the relationship between things.

— Definition describes what a word means by genus, species, and differentia. Noah Webster used this in his 1828 dictionary.

— Argument can be divided into:

  1. Recognising Arguments — what you need to do before you can evaluate them critically;
  2. Argument Diagramming — a method for laying out reasoning in a visual way;
  3. Argument Evaluation, which includes general methods for analysing what other people say; and
  4. Argumentation, which includes methods for creating your own logical arguments.
  5. Problem Solving is the method for solving complex puzzles.

Logical Fallacies are common errors that we make in reasoning. Practical logicians have tried for thousands of years to teach ordinary people how to recognise these logical fallacies, but apparently to little avail. There are two types of logical fallacies: formal fallacies, which are violations of the rules of syllogisms, and informal fallacies, which are familiar forms of bad reasoning that you might hear in ordinary conversations.

On an everyday basis, the study of logical fallacies is the most useful part of logic. Some fallacies, which could be called Propaganda Techniques, such as, “Elizabeth Taylor likes this perfume, so you should, too,” are what you see on TV and hear from politicians every day.

This is all the tip of the iceberg that is Logic, which I believe should be understood before programming.

I see this as being the difference between a web developer and a software engineer — an engineer understands and uses these scientific methods, whereas a developer is pretty stuffed without StackOverflow.

So I have some advice for people wanting to get into the industry as programmers — or current ones. Stop and learn logic first, it will be the most beneficial thing you can do for your career

By no means do I claim to be an expert of anything, or know anything about writing, journalism, maths, physics, science, computers etc. apart from binge-watching some docuseries on Netflix.

April 21, 2018

--

--

👍

Creativity is the greatest rebellion in existence.