Re: rand() pattern in texture?
From: Phil Carmody (thefatphil_demunged_at_yahoo.co.uk)
Date: 10/14/04
- Next message: Robin Chapman: "Re: How tall is this tree?"
- Previous message: Ford Prefect: "Re: How tall is this tree?"
- In reply to: Carlos Moreno: "Re: rand() pattern in texture?"
- Next in thread: Cristiano: "Re: rand() pattern in texture?"
- Messages sorted by: [ date ] [ thread ]
Date: 14 Oct 2004 12:15:18 +0300
Carlos Moreno <moreno_at_mochima_dot_com@xx.xxx> writes:
> > Using modulo is bad only for generators like the LCG, where the low order
> > bits have a short period.
>
> Nope. Using modulo is bad even for a *true* random number
> generator.
>
> Imagine you have a *perfect*, *true* RNG (e.g., based on
> quantum-level particle measurements) that produces a uniformly
> distributed number between 0 and 9. Suppose that what you
> want is a uniformly distributed number between 0 and 3.
You need to think about this a bit more.
10 into 4 doesn't go, no matter _how_ you do it.
(Unless you are prepared to throw away samples).
> It's not a matter of avoiding the LS bits, it's a matter of
> using *all of the bits*, combined in a way that hopefully will
> take as much entropy from the whole 32-bits (or whatever amount
> of bits the LCG gives us) and convey it to our randomly-generated
> value.
It doesn't matter which bits you take in a LCG you always get
all the available entropy.
Phil
-- They no longer do my traditional winks tournament lunch - liver and bacon. It's just what you need during a winks tournament lunchtime to replace lost ... liver. -- Anthony Horton, 2004/08/27 at the Cambridge 'Long Vac.'
- Next message: Robin Chapman: "Re: How tall is this tree?"
- Previous message: Ford Prefect: "Re: How tall is this tree?"
- In reply to: Carlos Moreno: "Re: rand() pattern in texture?"
- Next in thread: Cristiano: "Re: rand() pattern in texture?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|