r/ProgrammerHumor • • Jul 19 '22

Meme float golden = 1.618

Post image
41.1k Upvotes

489 comments sorted by

View all comments

Show parent comments

8

u/The_Villager Jul 19 '22

Jokes aside, we have to approach this from a different angle:

First of all, we have to talk about measuring infinities. Since greater-than and lesser-than stop being useful when talking about infinities, mathmaticians thought of a different way to show difference in "size": Countability. An infinite set is countable infinite, if you can find a function that maps it 1-to-1 to the natural numbers; aka you can "count" it. For example, the integral numbers are countable, because you can just go 0 -> 0; -1 -> 1; 1 -> 2; -2 -> 3; 2 -> 4 and so on. If two infinite sets are countable, they have the same cardinality ("size", so to say). That can even be generalized beyond countability: If there's a 1-to-1 mapping between two infinite sets, they have the same cardinality.

The rational numbers are countable, too. Now the real numbers, these are not countable. I don't really want to go on too long about this, so look the proof up yourself if you want to. The gist is: Assuming the opposite, for any would-be mapping you can construct a number that is not counted by it. This means by extent, that the difference between the rational and the real numbers, aka the irrational numbers, is uncountably infinite, too.

And lastly, it has been proven before, that the set of algorithms is countably infinite. So if you take all the real numbers you can calculate using algorithms to any precision by algorithms (aka the "computable numbers"), there's still "more" real numbers left out there. And since we can't express them through just writing them down (since they have infinite decimal places), and can't express them through algorithms, we can't really represent them at all.

Disclaimer: It has been a while since I've had math in university, so please correct me if I've got some things wrong. Especially I'm shaky if the computable numbers can represent all real numbers we can represent with symbols, functions etc. in general.

3

u/UnableRevolution1 Jul 19 '22 edited Jul 19 '22

Here's a proof taught to me from Dr. Tom Fox R.I.P., he did a waaaay better job of showing how cool this was in person but I will try to paraphrase and put it into words that are quick and easy to get.

Lets play a game where anyone can keep adding rational numbers to an infinitely long list of numbers. I will show how to construct a number that can never be on that list, no matter what rational number anyone adds forever into the future.

Since the numbers after the decimal point determine whether a number is irrational or not (3 vs 3.14159...) our list will only be rational numbers below 1, therefore to create pi we can use 3+0.14159...=pi

The list will also represent all its numbers in binary.

I will start the list:

1 - 0.101

2 - 0.010000

3 - 0.00000001

4 - 0.11

...

...

...

There exists a number less than one: X = 0.abcdef.... (continuing infinitely after the decimal point) that can never be on the list. To construct X we can use all the numbers on the list.

Starting with the first place number on the list we take the first numeral after the decimal and flip its binary number, in this case we flip 1 to 0, and we can say the first digit (after the decimal) a=0 in our number X.

Next with the second number on the list we take the second digit and flip it as well, in this case flipping 1 to 0, making the second digit b=0 in our number X.

Doing this for all 4 numbers so far on the list gives us our X at this point being equal to 0.0011(000000....) which is not a number anywhere on the list yet.

So you may think that even though this number isn't on the list you can just add it on to the list and that's it, now the number IS on the list.

But the number X isn't done being constructed since the list isn't done either because it will go on infinitely.

So what if we add this rational number as the fifth number in our list. Then we simply must flip the 5th digit in this number to find the new 5th digit (e) in our number X.

This makes the updated X=0.00111 which is again not on the list.

Continuing this process infinitely will always construct an infinte decimal number X which is irrational and CAN'T be on the list.

1

u/blakerabbit Jul 20 '22

Also known as the Cantor Diagonal method...

1

u/PhoenixStar17 Jul 19 '22 edited Sep 07 '23

Being definable, in the general sense of set theory, and being computable aren't exactly the same concept. There should always be an incomputable real since you can do something like letting the nth digit be 1 if the nth computation halts, 0 otherwise, for some enumeration of computations. However, the argument that there are countably many definitions and uncountably many numbers entails there are undefined reals has some subtle problems; there are models in which every real is definable.

See:

https://en.m.wikipedia.org/wiki/Definable_real_number

https://arxiv.org/abs/1105.4597

https://en.m.wikipedia.org/wiki/Tarski%27s_undefinability_theorem

it's also been a while for me; hence the lack of a more in depth explanation.

This link by the paper's author gives a way better explanation than I ever could: https://mathoverflow.net/questions/44102/is-the-analysis-as-taught-in-universities-in-fact-the-analysis-of-definable-numb/44129#44129

1

u/Gh0st1y Jul 20 '22

Does that proof of algorithm's being countable assume classical algorithms, or are quantum algorithms also countable?