ELI5: Explain Like I'm 5

Boolean Pythagorean triples problem

Imagine you are playing with blocks, and you have blocks of different sizes - some are big, some are medium, and some are small. Now let's say you want to stack them on top of each other to create a triangle.

However, you also want to make sure that the sides of the triangle are all whole numbers. So you start to experiment with different combinations of blocks. You might try stacking two small blocks on top of each other, and then put a medium block next to them to create one side of the triangle. Then you might try putting a big block next to the medium block to create the other side of the triangle.

But what if you want to find all the possible combinations of blocks that will create a triangle with whole number sides? This is where the boolean Pythagorean triples problem comes in.

You see, there is a special rule in mathematics called the Pythagorean theorem. It says that in a right triangle (which is a triangle with one angle that's 90 degrees), the square of the length of the hypotenuse (which is the longest side, opposite the right angle) is equal to the sum of the squares of the lengths of the other two sides.

In math terms, this looks like this:

a^2 + b^2 = c^2

So going back to our block example, let's say you have a small block (with length 1), a medium block (with length 2), and a big block (with length 3). You could stack them like this:

- Put the small block on the bottom
- Put the medium block on top of the small block
- Put the big block on top of the medium block

This would create a triangle with sides of length 3, 4, and 5. If you plug these values into the Pythagorean theorem, you can see that it works:

1^2 + 2^2 = 5^2

So this is called a Pythagorean triple, because it works with the Pythagorean theorem.

But what if you have lots of different blocks of different sizes, and you want to find all the possible combinations that will create triangles with whole number sides? This is where the boolean Pythagorean triples problem comes in.

Basically, this problem asks you to find all the possible combinations of three whole numbers (let's call them a, b, and c) that will work with the Pythagorean theorem. In other words, you need to find all the values of a, b, and c that will satisfy this equation:

a^2 + b^2 = c^2

But there are a lot of possible combinations of numbers that you could try, so this can be a tricky problem to solve.

To make things a bit easier, people use a method called a boolean search. This means that you start by assuming that there are only two possible values for each of the numbers a, b, and c: either they are there, or they are not there.

So you make a list of all the possible ways that you could combine the values of a, b, and c using this assumption. For example, you might start with just considering the values of a and b, and assume that c is not there. Then you can check if this combination works with the Pythagorean theorem. If it does, you mark it as true. If it doesn't, you mark it as false.

Then you move on to the next possible combination - for example, a and c, assuming that b is not there. And so on, until you have checked all possible combinations.

This method can take a long time, because there are a lot of possible combinations to check. But it can help you find all the possible Pythagorean triples, which is pretty cool!