Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If you pick a point along the number line at random, it’s almost guaranteed to be irrational.

I’m having a hard time grasping this one. Feels like the coastline paradox on a straight line of a known length.

Are irrational numbers even on a number line? Isn’t it definitionally impossible to pick it as a “point along the line”?



>Are irrational numbers even on a number line?

Yes, e is between 2 and 3 and Pi is between 3 and 4. There are geometrical lengths corresponding to each number.

>Isn’t it definitionally impossible to pick it as a “point along the line”?

No, it's mathematically possible to have a random process which picks a random real between 0 and n, with equal probability. Imagine it akin to throwing a dart at a line and picking the point it lands on as the number. Since there are only countably many rationals and uncountably many irrationals (i.e. not just infinitely more, but so many that you could never pair off the rationals with the irrationals, there are just too many) on any such length of the real line, chances are the number you end up with is overwhelmingly likely to be irrational.


And it’s not “overwhelmingly likely” as in there’s a 99% chance or whatever. If you choose a random point on the line, the probability of choosing a rational is zero.


Yep, exactly. I glossed over that detail a bit because explaining how a meagre set has a truly zero probability of being picked, while technically still being a possible result of a random process, is a bit messy to wrap your head around colloquially.


> If you choose a random point on the line, the probability of choosing a rational is zero.

Wat?

If a thing is in my pocket, there's an above zero probability of me picking it when I randomly take a thing out of my pocket.

What are math people doing that's different?


> If a thing is in my pocket, there's an above zero probability of me picking it when I randomly take a thing out of my pocket.

This is only true if there are only a finite number of things in your pocket, though… I think an analogy is how we always have 1/n>0 for any finite (positive) number n—and yet, 1/infinity=0.

For something more precise, I think the corresponding Wikipedia page (FWIW) is https://en.wikipedia.org/wiki/Almost_never.


> Do math people not feel the need to explain themselves when they state things that defy common sense everyone except math people agree upon? Is that part of thinking you're 'smart'?

It's a pretty basic thing covered in undergrad prob/stats classes. We don't re-explain it every time we use it for the same reason computer scientists don't re-explain the halting problem every time it comes up.


They’re working with infinity. Your pocket is not infinite. Numbers are.


I’m struggling to understand how a thrown dart could land on an irrational number. It seems definitionally that any physically realized outcome must pertain to a rational number because it is impossible to physically measure one at any level of precision.

It is possible to write a random process that returns 5 or pi with 50/50 odds so this isn’t a very compelling argument that it’s possible. I don’t feel the semantics of picking a random point along a number line is gg solved just by appealing to the existence of uncountably infinite irrationals.

By most people’s definitions of random points along the number line, including the dart throw, it seems to me the probability of getting an irrational is 0.

Invoking the number of possible outcomes has bad feeling implications. For example if your set is 1 2 3 pi 4, then the probability of getting an outcome in [3,4) is higher than [2,3) and that seems like it’s breaking the intuition of what the line represents. Like as a stupid example say we only include the irrational numbers between 9 and 10 and pick a random point between 1 and 10. If the random method uniformly sampled a point along the line by distance we would suggest a 90% chance of getting a rational number <= 9 and a 10% chance of getting an irrational number above 9.

But if we sample by naive odds you’d probably claim there’s a near 100% chance of getting an irrational number above 9 because there’s an uncountable infinity up there.

That seems dumb.


> It seems definitionally that any physically realized outcome must pertain to a rational number because it is impossible to physically measure one at any level of precision.

Sure, that's correct, but it isn't what people are talking about here.

> By most people’s definitions of random points along the number line, including the dart throw, it seems to me the probability of getting an irrational is 0.

That depends on the number line you're using. You can say that irrationals don't exist and you won't lose anything. But if your number line includes the reals, then the rationals form 0% of it.

> Invoking the number of possible outcomes has bad feeling implications.

That isn't how this is measured. You don't want to compare a count to an area. For probability, you need to compare like with like. A number line is one-dimensional, so we consider one-dimensional areas, or "lengths".

The interval from 0 to 50 has length 50. How much of that length is occupied by rationals, and how much by irrationals?

Each value is a point with no length. So, to measure the rationals, we assign to each rational point an interval that contains it. We will estimate the total length occupied by the rational numbers within the interval as being no greater than the total length of the intervals we put around each one.

Since there are only countably many rationals, we can use an infinite series with a finite sum to restrict our total-length-of-intervals to a finite amount. (Rational number one gets an interval 3 units wide. Rational number two gets one 0.3 units wide. Number three gets one 0.03 units wide. What do all these intervals add up to? Four thirds.) We can scale those intervals however we like. We will scale them down. If our first set of intervals had total length 20, we can multiply them all by 1/400 and now they'll have total length 1/20. The limit of this process is a total length of zero, which is our upper bound on how much of the length of our interval is occupied by rational numbers.

Since zero is also a lower bound on any length, we know that the total length of the interval occupied by rational numbers is exactly equal to 0. It is then easy to calculate the probability that a randomly chosen value from this interval will be rational: it is 0 (the amount of length occupied by rationals) over 50 (the total amount of length).

> Like as a stupid example say we only include the irrational numbers between 9 and 10 and pick a random point between 1 and 10. If the random method uniformly sampled a point along the line by distance we would suggest a 90% chance of getting a rational number <= 9 and a 10% chance of getting an irrational number above 9.

This seems to be just you being confused over the concept of a uniform distribution.


> This seems to be just you being confused over the concept of a uniform distribution.

Try and follow the example again.

The distribution is all rationals 1-9 and all numbers 9-10.

Sampling uniformly such that each distance is equally likely across the line gives at least a 90% chance of choosing a rational.

Sampling uniform by elements of the set gives a 0% chance of choosing a rational.

The problem with the latter is that even though you’re claiming to be randomly sampling the _line_ you are never going to sample the first 90% of the line length because you are instead sampling the _distribution of set elements_.

You are NOT more likely to throw a dart that lands in 9+ just because you have magically introduced an infinitely tense series of irrationals in that range.


> The problem with the latter is that even though you’re claiming to be randomly sampling the _line_ you are never going to sample the first 90% of the line length because you are instead sampling the _distribution of set elements_.

This is all in your head. Who are you responding to? Where did your three claims ("sampling uniformly by distance from 0" / "sampling uniformly by element count" / "randomly sampling the line") come from? What does "sampling uniformly by distance" mean? Uniform sampling is done by count for discrete sets and by area for continua. You have yet to mention a discrete set.


It is the difference between picking a random point along a line and picking a random number from a set. A dart throw will not land in the range of [9,10) more often than [1,9) simply because we are considering irrationals in the former.

These are both uniform. But the outcome is different


You're never going to get anywhere without defining your terms.

As you originally pointed out, a physical dart can't hit a single point on a number line. It will hit an infinite number of them simultaneously. This is true whether you're worrying about rationals or reals.

But if you have a dart so sharp that its tip is zero-dimensional, one that can hit a single point on a real line, and you throw it at a composite of the rationals from [0,9] and the reals from [9,10], it will have a 10% chance of hitting an irrational number (within [9,10]), and it will have a 90% chance of missing the line entirely, striking one of the holes in the rational interval [0,9]. The chance of hitting a rational number will not improve from 0.

Do you have a model of uniform selection in mind, or do you find that it's easier to say the words without assigning them any particular meaning?


> Sampling uniformly such that each distance is equally likely across the line gives at least a 90% chance of choosing a rational.

Let's say the numbers are targets on the line. Your distribution implies the range 1-9 is less dense with targets than the range 9-10. Doesn't that mean you're less than 90% likely to hit something between 1-9?

> You are NOT more likely to throw a dart that lands in 9+ just because you have magically introduced an infinitely tense series of irrationals in that range.

If we turn this around, by forbidding a bunch of values in the 1-9 range from being hit, then won't the probabilities get skewed towards the 9-10 range?


No, because a dart throw is not a uniform draw from set elements. Is a uniform draw of length which the inclusion of irrational numbers does not affect. You are 90% likely to throw something in the first 90% of the line. It doesn’t matter if we say we will round anything in [1,2) to 1. There’s a ten percent chance of falling in that range.

Not a 0% chance because there happens to be an uncountable infinity number of options in [9,10)


> What do all these intervals add up to? Four thirds.

I'm not sure what I was thinking of; 3.3333... is obviously ten thirds.


Throw infinity into the mix, get an irrational answer.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: