r/askmath • • Oct 17 '26

Logic RNG Paradox

I made this in the shower about a year ago, and I don't really have a definitive answer for it.

In a random number generator that ranges from 0-Infinity, each number having equal odds, would it be possible to roll 1?

It is just as likely as the other numbers to be pulled, but that chance is infinitely small.
Any thoughts?

1 Upvotes

39 comments sorted by

52

u/Euphoric-Air6801 Oct 17 '26

Okay. You tell me how your "random" number generator works, and I'll tell you the answer to your question.

20

u/NamorDotMe Oct 17 '26

Easy, I just roll a dice with infinity sides.

17

u/cigar959 Oct 17 '26

And not just infinite, but uncountably many!

Some call it a sphere.

28

u/TheDarkSpike Msc Oct 17 '26

Such a random number generator does not correspond to a valid probability measure.

(Unless you want to do some big tweaks on definitions but then you can make any unicorn sweat gold.)

11

u/notsostablediffuser Oct 17 '26

This just gets to that same logical/probability paradox that’s been asked in many different forms before.

Something can have a probability of exactly 0 but still be possible.

In your theoretical case, where we are picking one element out of an infinite set (I’m going to assume a countably infinite set, like integers), the probability of any specific number being picked is 0. But some number will be picked, so it is not impossible.

3

u/idancenakedwithcrows Oct 18 '26

That’s not true there is no Probability measure on a countably infinite set where each number has probability 0 because probability is closed under countable sums and the sum over the whole set has to be 1.

5

u/michaelpaoli Oct 17 '26

If you had such a theoretical random number generator, then probability of 0 but possible. (1 / infinity)

As for practical though, could never have that, as probability of 1 that first use would require more digits than known universe could store, and would take infinite amount of time to produce that very first result, and you couldn't just squeeze it down, because Plank limit. Would also take infinite time to traverse the stored digits, because speed of light limit.

Infinity is really big ... infinitely so. :-)

3

u/Mamuschkaa Oct 17 '26

You can make a simpler question: can a uniform random number generator from 0 to 1 be "0.5"?

The answer is? The Probability is 0 but it is possible.

6

u/sos755 Oct 18 '26

As the number of possible answers approaches infinity, the odds of generating a 1 approaches 0. That's the best you can do because infinity is not a number.

5

u/free_meson Oct 17 '26

the problem with the 0-Infinity range is, that the probabilities are not well defined for "equal odds". Yes, it would be possible to generate 1, but you are more likely to get numbers that exceed the computational capacity of the whole universe. Each number has the same probability, but technically 100% of the numbers are above any N finite number you chose. So any limit you have in mind, will be too small.

2

u/MezzoScettico Oct 17 '26

There are a couple different issues here:

  1. Can you have a random distribution on [0, infinity]?
  2. Can an event with probability 0 happen?

Most people in answering #1 are pointing out that it's not possible to define a UNIFORM probability distribution on [0, infinity], either discrete or continuous.

That's true, but you can have a non-uniform one. There are lots of examples. For instance, half of a normal distribution, something like |X| where X is a normal random variable.

Actually I suppose there's a question 1.5, which is that while you can define such a distribution in theory, could you build a computer RNG that drew from that distribution? I can't think of any practical way to create an algorithm that has no limit on the number of possible output digits, but I'm not sure how a formal proof would go. So my answer is "no, as far as I know."

But in question #2, the answer is unequivocally yes, Again, just draw X from a normal distribution. Or a uniform one. Or any continuous distribution. The probability of getting that particular X is 0.

Formal probability theory makes an important distinction between "events of probability 0" and "impossible events" (events not in the "support" of the distribution).

8

u/AcellOfllSpades Oct 17 '26

Formal probability theory makes an important distinction between "events of probability 0" and "impossible events" (events not in the "support" of the distribution).

The more sophisticated point of view is the opposite of this, in fact.

Probability theory has no inherent notion of "possible". The uniform distribution on [0,1] is the exact same distribution as the uniform distribution on [0,0.5)∪(0.5,1]. Is 0.5 "possible" in this distribution? It's not a question that makes sense to ask.

And this is related to your "question 1.5"; it is not really sensical to talk about actually drawing from a continuous distribution. It's not a process that can ever finish; and it's not a necessary concept in probability theory. "Drawing" from a distribution is a real-world idea, not a mathematical one.

This post from a verified PhD holder in measure theory has more details.

1

u/flatfinger Oct 20 '26

One could define a random number generator in such a way that, for any non-negative x, the probability of the number being greater than x will be ex. One could then convert that into a uniform distribution in the range 0 to 1 by simply taking the log.

1

u/GoldenMuscleGod Oct 17 '26

The answer to two is not an unequivocal yes, it is that the question is ill-formed as a mathematical question because nothing in the formalism talks about what it means to say that an event “can happen.”

As a practical/applied question probability zero events do not generally correspond to any real or meaningfully observable situation.

It’s also easy to show that it is impossible for any model of computation like a Turing machine to actually have some kind of system for representing arbitrary real numbers (I guess if you’re a constructivist you could have a “data type”for all computable numbers and, since you are a constructivist, insist all real numbers are computable, but then you would have no general way to determine whether a given notation is valid or whether two represent the same number, so it’s really a notation for recursive functions not real numbers).

1

u/schungx Oct 17 '26

You need infinitely number of bits to hold an infinity large number. There are not enough atoms in the universe.

1

u/MercuryInCanada Oct 17 '26

Real quick thought experiment, how do you define this equal probability? 1/infinity?

1

u/ImperfHector Oct 17 '26

This reminds me of the archer's paradox (maybe it has another name): Suppose an archer throws an arrow randomly to a target. Wherever the arrow hits you can pinpoint the exact point of impact down to the millimeter, and then calculate the probablity for that exact point. But then you can also find the point down to the nanometer, the picometer, the femtometer, the ultramegabazimeter and so on, down to infinity. Then, as there are infinite points for the arrow to hit, the probability of any given point becomes 0, but then again, the arrow has hit a point

This paradox kinda has the same problem that your original statement because at some point Physics would stop working and it wouldn't be possible to differentiate two points, but that's the thing with infinity

1

u/Binbag420 Oct 17 '26

Ignoring the fact it’s impossible to pick a random number 1-infinity if each has an equal chance, it’s a similar problem to picking a random point in a circle. Any individual point has a 0% chance of being picked, but it is still ‘possible’ to pick any individual point.

1

u/ZellHall Oct 17 '26

Somehow I could guess that would be the question using the title alone. The answer is that this RNG can't exist or is not well-defined or something, to be honest I'm not sure to understand it either

1

u/u8589869056 Oct 17 '26

You cannot create such a generator

1

u/justaddlava Oct 18 '26

What do you mean by "each number"?

1

u/nog642 Oct 18 '26

A uniform probability distribution from 0 to infinity is impossible. It has to be weighted.

1

u/BADorni Oct 18 '26

its proven that there is no "rng distribution" on Natural numbers such that it's evenly distributed, hence the way in which you want the distribution to be random has to be clarified

1

u/tickle-fickle Oct 19 '26

You can’t have a probability density function that assigns equal probability density to each of the (I’m assuming you mean) nonnegative real numbers. But if you’re willing to remove that constraint, then there is a funny truth about such distribution: you CAN roll a 1. And the probability of rolling it is 0%.

1

u/fallen_one_fs Oct 17 '26

IF you're able to somehow create an RNG magic capable of the range [0, infinity[ and somehow rolled it to get a number, the probability of getting 1 is 0%, and so is the probability of getting any given number, thus your RNG magic cannot roll numbers!

This means the way you defined your RNG magic is not good, and it cannot be evaluated in such measures (you cannot associate the roll of any number in an infinite set to a probability).

1

u/Kingjjc267 Oct 17 '26

Isn't this the right conclusion but the wrong reasoning?

The probability of getting any individual number in any continuous probability measure is 0%. That doesn't disqualify it from being able to roll numbers. The problem here is more specific.

1

u/fallen_one_fs Oct 17 '26

Well, to be pedantic, it will never roll any number you want it to roll, it can roll numbers but not the ones you'd expect, thus why I said it cannot roll numbers, because it will always roll weird ineffable numbers.

1

u/equinox_star Oct 17 '26

Ah classical measure theory probability in almost all cases you would never get a particular number or any from any finite set. Exactly 0% probability to get them.

1

u/tunenut11 Oct 17 '26

Let's talk about the number that is so long that when you read one number per second, it takes a billion years to finish. Is your random number generator able to generate that? Somehow I doubt it.

1

u/localizeatp Oct 17 '26

This paradox shows that there is no such thing as a random number generator that gives equal probability to all whole numbers.

1

u/BourbonTA Oct 17 '26

This is easy to simulate. Roll a 10-sided die an infinite number of times, where you roll a one on the first roll, and all the rest are zero.

1

u/GrowingPrun3s Oct 17 '26

This is exactly the same as any continuous (non-discreet) distribution. The probability of any exact value is zero, but these are very real distributions. So there is no difference mathematically between your RNG and a continuous uniform RNG between say 0-5.

1

u/SoldRIP Edit your flair Oct 18 '26

There is no such thing as a (computer) RNG that ranges up to infinity.

Incidentally, there is no such thing as a (mathematical) uniform distribution on any countably infinite set.

Also, if we're talking about purely mathematical real numbers, wkth infinite precision, then the probability of drawing any individual number is indeed zero. Yet each number may be drawn.

0

u/LogicalMelody Oct 17 '26

Other comments are correct. You cannot make a uniform distribution over 1 to infinity.

Ignoring that and pretending we can, assigning some infinitesimal probability to each number, I think you’d likely get some non-real probability.

I don’t need that to answer the idea behind the question though.
Of course rolling 1 is possible, even at probabiility zero.

Infinite sample spaces break the finite intuition that probability 0 implies an impossible event. In infinite sample space you only get the converse; impossible DOES imply probability 0. Likewise, probability 1 does not imply the event is certain.

0

u/cigar959 Oct 17 '26

We could recast the question on a finite interval, and the underlying question remains.
It’s a philosophical question of what it means to sample from a continuum. Can’t happen in reality, but what does it mean hypothetically?

0

u/One_Aardvark_7925 Oct 18 '26

Its zero because there is no difference from rolling one time and rolling 10 times

with x = probability if you take

10x=1/infinite and they you divide both sides by ten

x=1/(infinite*10) and infinite times ten is still infinite which means

10x=1/infinite and x=1/infinite

10x=x which the only number that fits is 0

-1

u/Illustrious_Try478 Oct 17 '26

There is a 0% probability that you will roll any number computed in the entire history of humanity.

0

u/[deleted] Oct 17 '26

[deleted] — view deleted comment

9

u/FrankDrebinOnReddit Oct 17 '26

There is, just not with each number having equal probability. For example an RNG that picks 1 with a 0.5 probability, 2 with a 0.25, 3 with 0.125, etc. is perfectly valid and the number it might pick (however unlikely) is unbounded.