Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

May be the case that it was coded with one version of a programming language and upgraded later and the newer version changed the handerling of rounding. Believe python from 2.0>3.0 had some difference along those lines and whilst on the surface may not mean much they can add bias into what you get dropped as rounding and somebody adding .5 will never get the low value with some rounding as it will always round 0.5 or > to 1 as apposed to some which demand at least be > than 0.5 . Yes there are standards, but they advance and evolve over time and we all know intergers are completely different from floats.

Last thought, if there was a truely random number generator then why do fruitmachines have control systems to monitor the distribution and with that what is paid out to maintain that x% payout to comply with laws that say x% of money taken has to be payed out. Mostly 70-80%, but does vary and whilst the legal min may be say 70%, some casino's and the like will generaly have a higher % payout in a promenant place, just so people think it's even higher.



> Last thought, if there was a truely random number generator then why do fruitmachines have control systems to monitor the distribution and with that what is paid out to maintain that x% payout to comply with laws that say x% of money taken has to be payed out.

That's easy to answer -- to comply with rules that require a certain outcome some x percentage of the time, one need only take a truly random generator's output and filter it by x:

outcome = (rn * 100 <= x);

If rn is a float, lies between 0 and 1 and is truly random, then the above trivial filter will produce the required distribution in the long term.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: