I wrote a small program that copies itself. When the program doubles itself it executes itself twice. The code that doubles itself is now doubled. The second time you run it you will get 8 times its original copy. The following time it’s going to double 8 copies of itself 8 times. Afterwards it doubles 2048 copies of itself 2048 times — that I can’t run because it would overwhelm the universe 5 times!

# Category Archives: Logic

# Simon’s Halting Problem Gist

You can easily turn every statement into a program. If the program stops, or “halts”, then the statement is true, and if it never stops, or “loops”, the statement is false.

Like, for example, the following program corresponds to the statement: “There’s at least one even number that cannot be expressed as the sum of two primes” (this is the negation of the so-called “Goldbach Conjecture”):

So, if we can figure out if any program will halt or not halt, we can prove everything! Can we do that, though?

# Grandfather Paradox on a Möbius strip

The famous Grandfather Paradox (you travel to the past and kill your grandfather, which prevents the your existence) on a Möbius strip. Simon’s inspiration comes from the “Solution to the Grandfather Paradox” video by

Minutephysics.

# The three ages or 1-input 1-output logic gates

After a whole night working on my writing and not feeling very fresh in the morning, I told Simon about the three ages of life: the young age is when one can party all night long and the next morning feel like one has been sleeping like a rose, the middle age is when one parties all night long and the next morning feels like one had been partying all night long, and the old age is when has been sleeping all night long and the next morning feels like one has been partying all night long. He immediately drew these pictures, telling me it’s just like *1-input 1-output logic gates*, but the only one that makes sense is the *OR*.

# Brilliant’s Daily Challenges

Simon is doing an increasing load of Brilliant’s daily challenges.

Some more recent challenges:

# Simon’s graph theory thoughts about the overpopulation problem

In a complete binary tree, every node has two children (except for the bottom nodes that don’t have any children at all). This means one mind-blowing thing: that the bottom row always has more nodes than the number of nodes in the entire rest of the tree! Example: if there’s one node at the top of the tree, two nodes in the second row, four nodes in the third row and eight nodes in the bottom row, the bottom row has more nodes (8) than the remaining part of tree (7). I’ve been thinking about this, and I applied this to the real world:

The average number of children a parent has in the world is 2.23 (I’ve used an arithmetic mean, which is oversimplistic, should have probably used the harmonic mean). Does this mean that currently, the number of children exceeds the number of parents? The definition of “children” I’m using are people who don’t have children, so the last row of nodes so to speak. By “parents” I’m counting all generations. If you just want to talk about now, the parents living now, then you have to trim the top rows (the already dead generations). If the average number of children is 2 or more, are there going to be more children in the world than parents?

Well, in this model, I’m ignoring crossover. This means we should consider every node in our tree for 2 people*. So, now, if the average number of children is **4** or more, there’re going to be more children than parents. So, what I said earlier was wrong. The average number of people *doesn’t* exceed 4, so there aren’t more children than parents. But the number of children today may still exceed the number of parent generations still alive.

# Mind Your Decisions

For over a month, Simon has been fascinated by Presh Talwalkar’s channel Mind Your Decisions. The channel is full of short videos on famous math problems, logic riddles, proofs and mental math tricks. Simon has also ordered a compilation of Talwalkar’s five most interesting books, including “The Joy of Game Theory: An Introduction to Strategic Thinking”, that we are currently very much enjoying together, and four more, that Simon is reading on his own: “40 Paradoxes in Logic, Probability, and Game Theory”, “The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias”, “The Best Mental Math Tricks”, and “Multiply Numbers By Drawing Lines”.

This one became Simon’s favourite brain teaser. It sounds like it’s filled with irrelevant information, but somewhat counterintuitively, every little bit of information in this puzzle helps! Here is the puzzle: *A mathematician tells a census taker he has 3 children. The product of their ages is 72 and the sum of their ages is the house number. The census taker tries to figure it out but explains he still does not know. The mathematician says, “Of course not. I forgot to tell you my oldest child loves chocolate chip cookies.” Now the census taker figures it out. What are the ages of the children?*

Simon has also picked up many nifty tricks and beautiful magic squares, both from the book and from the YouTube channel.

Multiplication by drawing lines has been a huge hit, Simon has also taught this method to his sister and a friend in Amsterdam:

# Learning to See. On Machine Learning and learning in general.

December was all about computer science and machine learning. Simon endlessly watched Welch Labs fantastic but freakishly challenging series Learning to See and even showed me all the 15 episodes, patiently explaining every concept as we went along (like underfitting and overfitting, recall, precision and accuracy, bias and variance). Below is the table of contents he made of the series:

While watching the series, he also calculated the solutions to some of the problems that Welch Labs presented, like the question about the number of possible rules (= grains of sand) for a simple ML problem if memorisation is applied. His answer was that the grains of sand would cover all land on earth:

Simon loved the historical/philosophical part of the course, too. Especially the juxtaposition of memorising vs. learning, the importance of learning to make assumptions, futility of bias-free learning, and the beautiful quotes from Richard Feynman!

I have since then found another Feynman quote that fits Simon’s learning style perfectly (and I believe is the recipe to anyone’s successful learning as opposed to teaching to the test): “Study hard what interests you the most in the most undisciplined, irreverent and original manner possible.” We have discussed the possibilities of continuing at the university again. I have also asked Simon how he sees himself applying his knowledge down the road, trying to understand what academic or career goals he may have set for himself, if any. Does he have a picture of himself in five years from now, where does he want to be by then? He got very upset, just like when asked to sum himself up in one sentence for an interview last spring. “Mom, I’m just having fun!”

A beautiful humbling lesson for me.

# Simon continues practicing Digital Computer Electronics

Reading the Digital Computer Electronics eBook (third edition):

# Too Many Twos Solution Proof

Simon has come up with an equation to solve the Too many Twos, the puzzle mode of the Add ‘Em Up game:

xis the number of twos I used to clear out just a single two at a time

yis the number of twos I used to clear out six twos at once.

We have two pieces of information. At the beginning, the twos are arranged in a pattern with 40 twos in it. And the number of twos I can use to clear out the whole grid is 25.

x + 6y = 40

x + y = 25

We thought we solved it, but no! The reason why is because of the way the twos are arranged there were spots where there were exactly 6 twos neighbouring an empty cell. And there was only one spot where there wee more than 6. Our equation says that there must be 3 of those. the way I solved this problem was by considering a third variable,

z= the number of twos that I place without clearing any twos in the grid. So now our two equations look like this:

x + 6y – z = 40

x + y + z = 25

With a little bit of cleverness though, we know that these are all integers. You don’t have 2.7 twos! That doesn’t exist! Which means that we can use some number theory to narrow it doen. After solving these equations we get: x = 25 – y – z and y = 3 + 2z/5

We’ve got a fraction. We need to carefully choose the

zfor this to result in an integer! This is only true ifzis divisible by 5.

I don’t want to check infinitely many solutions. Luckily, we know one more quite obvious thing: all of our variables must be positive. So if

zgets too large,xwill become negative. How large? Let’s just be lazy and use trial and error. Let’s draw a table. In our table we now only have four solutions that we need to check. The first one, with 0z‘s, clearly doesn’t work.