• Random Numbers (Acc2k SR1)

    Author
    Topic
    #357928

    Anyone any good at statistics?.

    I’ve set up a database which picks a prize winner each month using a Random Number generator, which I randomize each time before use.

    As I was concerned about the true randomness, I set up a test, and ran the selector 250,000 times (I know, but it seemed like a good idea), to select a number between 1 & 211 (current membership).

    The results showed an average of each number winning 1184.83 times which is what I would expect. However the highest was 1269, and the lowest 1086 (I don’t really know enough about Standard Deviations, but the result was 34.878.

    I must admit I was rather surprised at how wide the spread was, and assumed that as I had picked such a large number, the Max and Min would be much closer to the average (but I know nothing about stats). But it shows in this case that 1 number was selected 16% more than the lowest.

    Is this in line with what would be expected statistically.

    Since the monthly prize is reasonably large, I need to be confident that the selection is fair.

    Viewing 0 reply threads
    Author
    Replies
    • #532837

      I’ve done some work with random numbers, and there is some material on my website relating thereto. The majority of my use is for modeling physical properties, rather than ‘people.’

      However, if you want to be fair, then the only fair distribution of prizes is to list all of your members, and choose them each in turn.

      • #532858

        Hi

        Thanks for the comments.

        I took a look at the site, but its well beyond my capabilities.

        Interesting thought tho to allocate in turn. Kinda takes the fun away.

        • #532859

          I posted this same message on a Statistics site, and got the response below as an answer, which seems to confirm my figures are indeed random.

          Your approach actually was excellent. Most people take for granted that what a computer gives them is valid, but you should be commended for your approach to checking it.

          Here’s what you can do to see if your results depart from what can be attributed to chance (I assume you did this in Excel).

          For each “bin” result (i.e., the number of occurrences for each of the possible 211 outcomes), subtract the mean from it, square this result, then divide it by the mean. Then add up all of these quantities. Basically the formula looks like this:

          ((O-E)^2 / E)

          where E is the expected, or mean frequency, and O is the observed frequency. You are running a chi-square test on your frequencies to see if they are close enough to a “random” outcome.

          Now run the Excel function CHIDIST, with the two arguments for the function:

          – the sum of all the ((O-E)^2 / E) quantities
          – degrees of freedom = 210, which is the number of bins minus 1

          Generally, if the return value or answer for the function is .05 or greater, than you can call your results “random.”

          Remember, however, that computer-generated random numbers are actually “pseudo-random,” meaning that they are determined by a computer algorithm, and they actually have a periodicity to them (the pattern will eventually go back to the beginning and repeat itself). However, this periodicity is usually in the billions, and will probably never occur under normal circumstances.

        • #532869

          ‘fun’ has to be interpreted by everyone involved as ‘fair’. Otherwise, you run the risk of a game perceived to be ‘fixed.’

          Perhaps an array of integers from 1..211, in random order is fun enough, and guaranteed that everyone wins over ~4 years, which is imminently fair.

          • #532937

            I hope that most people who join a lottery understand that there is no guarantee that they will win. They also accept that someone may win twice, three or even more before they themselves win.

            The whole point is that it should be random, and therefore someone can win for example in consecutive months. What I hoped to show was that over the long term, the selection was fair, and it seems to have done so.

    Viewing 0 reply threads
    Reply To: Random Numbers (Acc2k SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: