Using the Raised Cosine Distribution in PRNG

12182016, 01:51 AM
(This post was last modified: 12182016 04:13 AM by Namir.)
Post: #1




Using the Raised Cosine Distribution in PRNG
The Raised Cosine Distribution provides tool for a simple nonuniform PRNG. The equation for the cumulative probability function is:
CDF = [1 + xs + sin(pi*xs)/pi]/2 Where xs = (xm)/s and m is the mean and s is the spread. Choosing m = s = 0.5 makes the CDF curve map values from the range (0, 1) to values in the range (0, 1). This special mapping allows us to skip the traditional approach where we assign a uniform random number to CDF and solve for x (which requires using an iterative method). Instead we can cheat and use the above equation by assigning a uniform random number to x and calculate the CDF as the specialized random number. The distribution of the random number generated form a U shaped distribution. So to make your games interesting, test for values generated around 0.5 (say the range (0.45, 0.55)) to trigger game events. The recommended range is less likely to occur than values near 0 or 1. I know that my suggestion is heretical, but it works!! Namir 

« Next Oldest  Next Newest »

Messages In This Thread 
Using the Raised Cosine Distribution in PRNG  Namir  12182016 01:51 AM
RE: Using the Raised Cosine Distribution in PRNG  mark4flies  12212016, 01:42 PM
RE: Using the Raised Cosine Distribution in PRNG  Namir  12212016, 03:20 PM
RE: Using the Raised Cosine Distribution in PRNG  mark4flies  12252016, 12:30 PM
RE: Using the Raised Cosine Distribution in PRNG  ttw  12262016, 01:37 AM
RE: Using the Raised Cosine Distribution in PRNG  Paul Dale  12262016, 01:42 AM
RE: Using the Raised Cosine Distribution in PRNG  Namir  12262016, 02:12 AM
RE: Using the Raised Cosine Distribution in PRNG  Paul Dale  12262016, 07:39 AM
RE: Using the Raised Cosine Distribution in PRNG  Namir  12262016, 11:03 AM
RE: Using the Raised Cosine Distribution in PRNG  Dieter  12262016, 08:01 PM

User(s) browsing this thread: 1 Guest(s)