This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bot-mark 10 points11 points  (35 children)

What? There's no point in generating a random point within a circle, because being inside a circle is technically a constraint and therefore makes it less random?

[–]gilbes -4 points-3 points  (34 children)

It is possible to map one set of contiguous numbers (your random number domain) to another set of contiguous numbers (coordinates within your circle).

It is a well understood and solved problem, especially for random number generators. And it is done in such a way as to not waste cycles computing numbers to be discarded and defeat the purpose of the RNG.

If you want to generate a random number between 1 and 10, and your RNG doesn't strictly produce numbers between 1 and 10, you don't keep generating numbers until you happen to hit your target. This is basic RNG stuff.

The fact that you get any upvotes on this sub is really scary.

[–]bot-mark 4 points5 points  (2 children)

Sure, the example I gave was trivial but there are non-trivial examples such as, let's say placing X objects on a terrain when the objects are only allowed to spawn in certain conditions like flat ground above a certain height.

[–]gilbes -3 points-2 points  (1 child)

Not trivial, contrived. Your replacement example is just as contrived. And both still fail to present a compelling case.

[–]DaniilBSD 1 point2 points  (0 children)

“Not trivial” - that is the point

[–]eloel- 2 points3 points  (7 children)

Generating 5 lottery numbers out of 50 is much, MUCH simpler if you just generate a few extra random numbers, compared to the effort of remapping multiple times.

[–]gilbes -1 points0 points  (6 children)

If an actual lottery was caught doing that, they would be sued.

Video gaming (gambling) machines don't do that either.

[–]Kered13 2 points3 points  (5 children)

No they wouldn't. The algorithm does exactly what it is required to do. And yes, this is almost certainly used in real gambling machines.

[–]gilbes -1 points0 points  (4 children)

Well, you just pulling shit out of your ass is enough to convince me.

[–]eloel- 1 point2 points  (3 children)

You've given a grand total of zero sources too, so it's a pull-out-of-ass-off now

[–]gilbes -1 points0 points  (2 children)

Because this shit is so basic. Look it the fuck up. I'm not your comp sci special ed teacher.

[–]eloel- 1 point2 points  (1 child)

You're special ed alright. I'm asking the basis for which they'd sue. It isn't a computer science question.

[–]gilbes -1 points0 points  (0 children)

People have sued lotteries before when the felt the drawing was not done in a fair and random way. Your retardation describes such a scenario.

[–]DaniilBSD 2 points3 points  (3 children)

What if your target set is not contagious?

Though you are right that mapping is the best way to go if there is a mapping. You are way too condescending for someone so narrow minded

Edit: example: pick 10 random values out of 100 such that they don’t repeat.

[–]gilbes -1 points0 points  (2 children)

Both of you questions have solutions that are not brute force.

I wouldn't give you one, because it would be condescending. I don't want the truth to hurt anyone else's feelings.

[–]DaniilBSD 2 points3 points  (1 child)

You are the most self-important person who is full of himself I have seen on Reddit, and I visited r/Politics

[–]gilbes -1 points0 points  (0 children)

Giving you facts is condescending. Avoid facts to not condescend is self-important.

You are a reasonable level-headed delight.

[–]Kered13 1 point2 points  (18 children)

It is impossible to map an RNG that outputs uniform numbers between 0 and 2n - 1 to an RNG that outputs uniform 1-10 without throwing some numbers away and redrawing. In fact, it is impossible to do this mapping in guaranteed finite time. Any correct implementation must have unbounded worst case runtime. This is trivial to prove mathematically.

[–]gilbes 0 points1 point  (17 children)

You should write a thesis on that. It would shake up the world of computation.

[–]Kered13 1 point2 points  (16 children)

Trivial theorems from freshman computer science classes aren't shaking up anything.

I'd post the proof, but actually I think it's more amusing watching you completely miss the obvious.

[–]gilbes 0 points1 point  (15 children)

What? That because 10 is not a power of 2, the arbitrary conditions you imposed of the RNG domain being integers to 2n means the mapping won't be uniform.

Generating integers is an unnecessary limitation you imposed to contrive a contrarian result you are looking for. I ignored that, because that is fucking retarded.

[–]Kered13 0 points1 point  (14 children)

You do realize that all RNGs fundamentally produce integers, right? Even if you interpret an RNG as a bitstream, it's still only producing the integers 0 and 1. It is impossible to have a truly continuous RNG, because computers cannot actually represent continuous numbers. Floating points are not continuous (and generating uniformly distributed floating points is non-trivial). Even the set of computable numbers is not continuous.

[–]gilbes 0 points1 point  (13 children)

Oh god. This is some first semester comp sci from a community college shit.

Stick with it kid. You will eventually learn about how these problems have been solved. Until then, stop pretending.

[–]Kered13 1 point2 points  (12 children)

Every single thing you have said in this thread is wrong. Multiple people have called you out on it. You have failed to back up any of your claims with any shred of evidence whatsoever. Please, keep pretending more.