#128557 - 2004-10-29 10:39 AM
Re: Kixtart Mini-putt challenge for tonight
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Cute Richard 
Does it really work as well as Rnd? I suspect they might be on par but no matter I do like your solution - it is original 
Dunno. Given that RND is not actually random this is probably just as good for this small set.
If the set was larger it wouldn't be very useful.
If you are interested in comparing the both, run for each for a couple of hundred thousand iterations and plot a histogram of the number of times that each value is returned. If the RNG is truly random then it should be a fairly flat line.
I suspect that in a tight loop like this there is a posibility of getting into a repeating sequence. In the real world where other stuff will be going on which will take a variable amount of time to complete it probably isn't an issue.
The obvious big differences are
- My code is much, much slower because of the need to intoduce the small sleeps to peturb the algorithm.
- As my code does not have a seed you cannot guarantee to repeat the sequence.
- There is chance that the significant bits of @TICKS and @MSECS will repeat causing a repeating sequence where the loop is very tight.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1226 anonymous users online.
|
|
|