Live data from Hacker News

How to generate uniformly random points on n-spheres and in n-balls

extremelearning.com.au

11–20 of 87 posts

Re: How to generate uniformly random points on n-spheres and in n-balls

#11
post #2

I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

There are plenty of things that are random, that are not uniformly random. The hardware RNGs that are used for physically based RNG are not uniform, including the great lava lamp wall or geiger counters, etc.

The problem is if you are doing something that requires uniform random values, and your random source is not uniform, then things will go wrong.

Re: How to generate uniformly random points on n-spheres and in n-balls

#12
post #2

I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

[deleted]

Re: How to generate uniformly random points on n-spheres and in n-balls

#13
post #2

I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

[deleted]

Re: How to generate uniformly random points on n-spheres and in n-balls

#14
post #2

I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

By that criteria, wouldn't a discrete distribution with infinite support be even more random?

Finite support somehow seems less random because you can still say something interesting about its mean and bounds in the same way you can say something about the mean and variance of a normal distribution.

Re: How to generate uniformly random points on n-spheres and in n-balls

#15
post #2

I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

Random (in statistics) means you cannot conclude the next value ahead of time. That's different than saying the next value is uniformly likely to be any value and the two concepts are actually orthogonal. E.g. If I had a bag with 99 red balls and 1 blue ball then randomly selected one you may assume there is a high chance there will be a red ball, based on the odds, but you aren't able to actually know which ball will be next until it's drawn.

Re: How to generate uniformly random points on n-spheres and in n-balls

#18

I actually needed this at work once! We needed to fuzz peoples address in a mapped view for analytics, without revealing PII. It ended up never being shipped, but we needed to fuzz geographic data and the thinking was like: 1. Truncate your lat longs to some arbitrary decimal place (this is very very stupid, you end up with grid lines [1]) 2. The above method ^^ but everyone tries basically doing like random angle +…

The rejection method smells pretty good to me, in the sense that it should be pretty obvious to anybody with, like, middle school level math I think (right?).

It might fail for higher dimensions, but lots of programs only run on a 3D sphere of a planet, haha!

Re: How to generate uniformly random points on n-spheres and in n-balls

#19
post #7

I was always surprised at how easily you get biased sampling when generating random points despite all input - something I often saw students do was essentially normalize({2 rand() - 1, 2 rand() - 1, 2 rand() - 1}) or variations of that (where rand() is "good" not the literal rand(3)), and there are numerous other ways that are more subtly wrong. IIRC the nominally correct way for a sphere specifically is something l…

I used to think “normal distributions are everywhere” but the more math and science I watch on YouTube the more the central limit theorem pops up. It’s the CLT that’s everywhere, it just brings normal distribution as it’s +1.

Re: How to generate uniformly random points on n-spheres and in n-balls

#20

Earlier quoted context omitted.

No. I would go so far as to say, if it’s not uniformly random, it isn’t random. My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, bu…

Random (in statistics) means you cannot conclude the next value ahead of time. That's different than saying the next value is uniformly likely to be any value and the two concepts are actually orthogonal. E.g. If I had a bag with 99 red balls and 1 blue ball then randomly selected one you may assume there is a high chance there will be a red ball, based on the odds, but you aren't able to actually know which ball wil…

But if you’re given a double or nothing bet option on each draw, you know there’s a range of strategies that vary from maximum winnings, to most likely winnings. You want a good story you go for max. You need a few thousand to head off a problem with your car, you bet a different way.
Post reply on HN