Joined: 22 Aug 2006 Location: somewhere south of the north pole
Posted: Tue Apr 20, 2010 9:00 am Post subject:
pesodu random number generator
Subject description: Trying some stuff
I have made a pesodu random number generator.
It outputs numbers between 0 and 1000.
Now I could use some help. Is there an easy way to get statistics of how often each number apperes? Currently, it outputs all the number into a textfile in tha same dir as the exe is placed.
Also, can some of you comfirm that it doesn't start reapiting itself after 100 000 numbers?
Joined: 26 Nov 2002 Location: Algae Colony On Mars
Posted: Tue Apr 20, 2010 10:01 am Post subject:
It seems biased towards three. I suppose it depends on your definition of random. I'm guessing you'd want it to be an even distribution?
See the image I attached for the distribution of numbers. If you want to know how I did it, this is what I did in OpenOffice to get the number frequency.
graph.png
Description:
Filesize:
6.12 KB
Viewed:
1526 Time(s)
_________________
Quote:
This is sexier than what this forum was supposed to tolerate. - Banshee
Joined: 22 Aug 2006 Location: somewhere south of the north pole
Posted: Tue Apr 20, 2010 12:11 pm Post subject:
Thank you for the tip and graph! Looks like it is quite even, but as you mention, it likes 3. Have been a thing since the begining...
Again, thank you!
EDIT:
After some testing and tweaking, I fond that I can make my app generat random numbers withinn a 0.7% margin form perfect distribution. That is, as long as I set the highest number it shuld output to a primenumber minus one.
With other words: It can generate evenly distributed numbers if the highest number is to output is 4 (5-1), 6 (7-1), 10 (11-1), 12 (13-1) and so on. Any tips as to what I can do with that? _________________ This is a signature QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum