Hacker News new | ask | show | jobs
by ohnoitsahuman 665 days ago
Counterpoint: Pick a random number between 0 and Infinity.

What set of infinite numbers are you more likely to wind up with?

Do this a million times.

Therefore 1 to Infinity is significantly larger than 0 to 1

7 comments

That may feel like an intuitive declaration, but that's not how it works in standard mathematics. In standard set theory, the cardinality of the reals is equal to the cardinality of any non-degenerate interval of reals. Wikipedia quotes this fact without proof (https://en.wikipedia.org/wiki/Cardinality_of_the_continuum#S...).

Here's one hand-wavy proof of why the cardinality of the real interval P=[0,1] is the same as the cardinality of the real interval Q=[0, infinity]: The function f(x) = 1/x-1 is a bijective function that maps the P interval onto the Q interval, which also proves the cardinality of the two sets is equal. (https://en.wikipedia.org/wiki/Bijection#Cardinality).

If you're not comfortable with 1/0 = infinity as a general matter, then simply replace the f(x) I gave with an explicit piecewise function f(x) = { 0 if x = ∞, else (1/x-1) } and the proof still works.

There are several other objections posted, but only one that really refutes the heart of your claim.

To judge what set of numbers you're more likely to end up with, you need to specify a probability distribution. Without any specific information to prefer one number over another, you want the highest entropy distribution. It turns out that the most "natural" probability distribution for x extending between 0 and infinity is not uniform over x, but over its logarithm; therefore, by symmetry arguments, the probability is actually more like 50% that you draw a number between 0 and 1.

And it turns out that floating point numbers more or less respect this property.

Pick a random number according to which distribution?

You sound like you want a uniform distribution (i.e., P(x in [a, b]) = b - a / total support of D), but when you have an infinite support, the denominator is infinity - 0 = infinity, so the probability that x is in any finite interval in that set is 0. I've never taken real analysis, so my knowledge here is quite shaky, but I'm not even certain that the resulting probability distribution function is well-defined as a probability distribution function in the first place.

Real analysis, aka, real numbers (and consequently infinite sets) are far weirder than you ever expected them to be.

Yes, you can't define a uniform distribution on the reals at all, there's no way to make it to sum up to 1, which is required. Either it's 0 everywhere and the cumulative probability is 0, or it's a positive constant everywhere and the integral diverges, or it's not uniform.
Not in floating point, which is the whole point here. Floats can only represent a finite subset of the real numbers (there are only 2^32 or 2^64 possible bit patterns, after all). They can represent lots of small numbers close together around 0, and lots of big numbers with increasingly large gaps between them, and there's an infinitely large gap between ~10^308 and inf. They are designed so that the possible floating point numbers are among the most useful numbers for most human calculations.

Even ignoring the realities of floating point, your argument depends on sampling uniformly from an infinite interval, which is not possible: https://math.stackexchange.com/questions/14777/why-isnt-ther...

That's not how cardinality is measured. The very first class on an introduction to set theory course will teach you that bijections are used to measure the size of a set.

Consider the tan function. When you give it a number between 0 and pi/2, it gives you a number between 0 and infinity, and it does so in a bijective way. Therefore there are equal numbers between 0 and pi/2 as compared to 0 to infinity. Now consider a simple linear function that multiplies its input by pi/2. From here we know that there are equal numbers between 0 and 1 as compared to 0 and pi/2.

Allow me to offer a brief proof of the contrary.

You may select any real number between zero and infinity. We will call this R.

I will give you 1/R, which is between zero and one.

QED.

I believe you're conflating range, where it is trivially true that [0,∞] is of greater extent than (0,1), with quantity, where it is not the case that there exists a greater quantity of values in the former range than in the latter.

> You may select any real number between zero and infinity.

Should that have been “between one and infinity”? Otherwise you cannot claim that 1/R is between zero and one.

You got me on that one.

I would prefer, given the domain, to amend to "given an R between 0 and infinity, I will return R for all R < 1, or 1/R otherwise". But yes, the proof was flawed.

I like the approach, but infinities can be counter intuitive. See Cantor, Dedekind. The problem is your experiment. We don't say "there are N reals between 0 and 1", we talk about cardinality. The sets (0,1] and (1,3] in R1 don't have "the same number of items" in them; they have the same cardinality.