| credit this |
05-09-2007 12:28 PM |
Pseudorandom
Quote:
Originally posted by Hank Chinaski
Quote:
Originally posted by Credit This
Pseudorandom generators are not "pseudorandom" because of rounding issues, nor because they repeat individual elements. They are pseudorandom because the whole sequence of numbers they generate is predetermined based upon some numeric algorithm.
|
Which is effectively random. I was only trying to tell Burger iPods are not really random, and can't be.
|
Huh? The most random thing here is trying to figure out what you're trying to tell anyone when you say "random" in one sentence and "not really random" in the next.
Quote:
Originally posted by Hank Chinaski
Of course my knowledge base is limited to preparing about a dozen extremely complex patent applications on the rolling codes for producing "random" numbers in car remote keyless entry systems. I'm sure you have greater expertise.
|
Apparently so, since I'm right and you're wrong. :)
Seriously, my experience is limited to amateur coding mostly in jr. high and HS when I had time on my hands, but I do remember how it works.
Quote:
Originally posted by Hank Chinaski
And since I try patent cases, I know to try to "dumb" down an explaination.
|
Not to mention spelling.
Usually the goal when simplifying by example is to pick an accurate example.
Quote:
Originally posted by Hank Chinaski
My "rounding" example is an accurate problem, but was meant more as something these sheep could understand.
|
By "accurate" you mean "not accurate," right? Baa.
Quote:
Originally posted by Hank Chinaski
Quote:
Originally posted by Credit This
2) It is odd in the extreme to suggest there would be some difficulty in "picking" how to round 49.5 (or any other number with 1/2 as the fractional part). The convention that 1/2 rounds up to 1 is for all intents and purposes universally accepted.
3) Having a convention such as rounding up or down is not a "bias" that affects the apparent randomness of a pseudorandom number algorithm unless the algorithm is incorrectly designed.
|
There is no difficulty in so picking, but it makes the process non-random.
|
No, it doesn't, unless you screw up the algorithm.
Quote:
Originally posted by Hank Chinaski
If you always round .5 up which, integer has a greater liklihood of being picked, 0 or 1?
|
They have equal frequency if the numbers that you are rounding are uniformly distributed in the range [0,1). More generally, they have equal frequency in any algorithm that properly maps any uniform distribution range onto a range that is equally distributed around 0.5.
Quote:
Originally posted by Hank Chinaski
The real problem with zero would be no -.5, -.4, etc.
|
I never said it was impossible to design a faulty algorithm. Congratulations. My point was that it is easy to write a working algorithm. If, as I think you are suggesting, you have mapped a random number range onto a floating-point range such as [0, 50) then you would simply use a floor function (int()) rather than rounding to map back onto an integer range with the proper uniform distribution.
|