04:44
@DavidG.Stork David, first let me say that I realize I'm ratholing on a philosophical question. I don't think it's particularly profound, and once seen it's kind of obvious, but I do find it to be just a fascinating consequence of... math. With that out of the way...
@DavidG.Stork "I COULD state if it is positive." No, you couldn't. In order to say it's positive, you'd need some way to compare an arbitrary irrational to zero. How would one do that? One would need to depend on either (1) some actual representation of the irrational number, e.g. a sequence of digits, or (2) a sufficient semantic that allows you to make deductions about the number in question.
Since we're sampling at random (which is what I'm talking about even though I know that's impossible with a computer and I also know is unlikely to be the OP's actual question) we don't have (2). There's simply no way we would be able to deduce any computational semantic for a randomly selected irrational.
But we also don't have (1), because any representation would be finite, and therefore not irrational. You can't say, "here is a randomly selected irrational that starts 137.89877....", because that doesn't actually specify a unique irrational. If the (theoretically impossible) irrational sampler could give us a way to uniquely identify an irrational, it would have to be on a semantic, but again, that is vanishingly rare.
If our irrational sampler told us, "the irrational I've randomly selected can be defined as the ratio of a circle's circumference to its diameter", then we'd know that the selection wasn't random. Likewise for "the ratio of a square's diagonal to its side"--can't possibly be a random selection.
@MichaelE2 Michael, I don't have enough confidence in my math knowledge nor in my knowledge of Mathematica's implementation details to be definitive, so take my comments with that in mind--I'm just using my best analysis and feel free to correct me with concrete explanations. With that said...
It would seem to me that RandomReal
does indeed sample rationals. I don't see how it can do it perfectly "fairly", i.e. while we think of it as uniform it probably isn't uniform and it can't possibly cover all of the rationals, but what it samples must be rationals, mustn't it? But I certainly agree that it doesn't samples reals. I've been making the point this whole time that that's impossible.
As for "the irrationals in [0,1] is a measurable set, so I think one can define a random variable over it, theoretically. And do math with it", I can imagine that there's some truth to this. Your knowledge that you've sampled an irrational might allow you to do some math at the level of the distribution itself. I don't know what that would look like, but I suppose at that level of generality and abstraction, something might be possible.
However, what I'm arguing is that you can't actually know anything about any one specific sample from that distribution.
Like, sure, I assume we could compute things like expected value and whatever other aggregate type of statistics. I mean, in some sense this whole thing explains why we do integration (at least such as it was in my high school) and such over intervals. At any given value the integral would be zero, and the probability of choosing any pre-specified value from a continuous distribution would be zero. And yet the total probability is 1 and the total integral has a definite value. I get that.
I guess I'm assuming that RandomReal is approximately fair. I.e. anything you can say about a perfect rational number sampler you can also say about RandomReal with a tolerable level of accuracy, except of course for complete coverage of the full infinite set of rationals.
E.g. for our perfect rational sample we'd expect over many trials for about one quarter of our samples to fall in the range [0,1/4] (I assume that statement can be made rigorous). For RandomReal, there will probably be some error with regard to that expectation, but the error is small enough for us to ignore it in practice.
So, turning to irrationals, we'd want to be able to say the same things about any "practical" irrational sampler and a perfect one. Which takes us back to the OP's question and David's answer, David's algorithm certainly does not lead to a distribution that mimic's a perfect irrational sampler with any reasonable accuracy. David's implied sampler is incredibly biased by the "seed" irrational and the number of discrete values in the distribution.
So, while I'm tempted to just dismiss the OP's request as obviously impossible, I was trying to leave room for someone to demonstrate a "practical" or "adequate" way to mimic the theoretically perfect sampler.
And then I realized that even a mimic is impossible (I believe, still can't claim 100% certainty). The reason it's impossible is that one thing we'd expect is that it isn't biased toward irrationals that we already "understand". But we can't even represent irrationals that we don't understand, so, it's all a no go.
@xzczd If you're the one that moved the comments to this discussion room, I'd like to know how you did that. I've tried before to do that, but the only way I've been successful is if I respond to the automated prompt that says extended discussions should be moved to chat and that has a link to do so. I've been able to create chat rooms, but I can't figure out how to link them to the original question. And when I invite other users, it's not clear to me that they actually get an invitation.