Originally posted by ravenspoint
random numbers..
Collapse
X
-
Granted.Originally posted by r035198xI'd say the right tool for the right job. the standard generator is for testing small programs and writting school assignments. If you use it for a lotto system however, you better be loaded with cash.
However, most coding jobs fall between these extremes. Quick and dirty solutions to small problems some-one is prepared to pay a hundred bucks to fix.
Coding for a lottery system would be a grand job.Comment
-
Some of these "small" things also differentiate between a good programmer and one who only cares about this month's salary.Originally posted by ravenspointGranted.
However, most coding jobs fall between these extremes. Quick and dirty solutions to small problems some-one is prepared to pay a hundred bucks to fix.
Coding for a lottery system would be a grand job.Comment
-
No it wouldn't; it would just take a fairly good pseudo random number generator,Originally posted by ravenspointCoding for a lottery system would be a grand job.
capable of generating a reasonable length series of uniform distributed pseudo
random numbers. The 'standard' rand() isn't one of them but that's all.
JosComment
-
The last three posts in this thread have been deleted as they had turned into a personal conflict and hijacked the thread. This does not in any way help the original poster and is not allowed in the development forums.
Please remember the OP when discussing solutions in a thread.
ADMINComment
-
If you have any kind of serious numerical application, such as Monte-Carlo Integration or Stochastic Differential Equations to name two, then the standard generator is hopelessly inadequate. This is because these processes usually require a specific type of random number. Physical processes modelled by SDEs have solutions based on gaussian random variables. To determine the price of a stock option at any given time one must use log-normal random variables. While these are specialised applications they are areas where random numbers are used heavily in practice and that standard generator is not used because of the necessity to continuously re-seed.Originally posted by ravenspointThat is so harsh!
In fact the standard generator is free, widely available and well understood. These are important benefits not shared by a home brewed generator. They are so important benefits, that I would suggest using the standard generator, unless someone can show a very good reason why it would be the wrong choice.
If you routinely reseed the generator from the least significant digits of the system clock, then the standard generator serves perfectly for a huge number of the common purposes.
The queuing times for many systems can be modelled very accurately with Poisson statistics. I am not saying that you should use "obscure" random variables for the sake of it. I am saying that certain applications require certain types of random variables and in those cases an application specific random number generator is required.Originally posted by ravenspointThe classic example is selecting a wait time before again requesting a shared resource that is currently busy. It is does not matter what wait time is selected, just that it be 'random'. Obscure flaws in the statistical behaviour of the standard generator over long runs are irrelevant - if you have to back-off more than 2 - 3 times your system has problems that will not be solved with a 'better' generator.Comment
Comment