Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Pseudorandom number generator
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Counter-based RNGs == {{Main|Counter-based random number generator}} A counter-based random number generation (CBRNG, also known as a counter-based pseudo-random number generator, or CBPRNG) is a kind of PRNG that uses only an integer counter as its internal state: <math display="block">\text { output }=f(n, \text { key })</math> They are generally used for generating pseudorandom numbers for large parallel computations, such as over GPU or CPU clusters.<ref name="salmon-desres">{{Cite conference |last1=Salmon |first1=John |last2=Moraes |first2=Mark |last3=Dror |first3=Ron |last4=Shaw |first4=David |date=2011 |title=Parallel random numbers: as easy as 1, 2, 3 |doi=10.1145/2063384.2063405 |book-title=Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, Article No. 16}}</ref> They have certain advantages: * The only โstateโ needed is the counter value and the key. For a given counter and key, the output is always the same. This property makes CBRNGs reproducible. * Because each random number is computed independently of any previous outputs, they can be generated in parallel. For example, in a massively parallel application, each thread or GPU core can be assigned a range of counter values and compute random numbers without synchronization or shared state. * Since the generator does not require stepping through every intermediate state, it can โjumpโ to any point in the sequence in constant time. This is particularly useful in applications like [[Monte Carlo method|Monte Carlo simulations]] where independent streams are needed. Examples include:<ref name="salmon-desres" /> * Philox: Uses multiplication-based mixing to combine the counter and key. * Threefry: Based on a reduced-strength version of the [[Threefish]] block cipher.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)