random picks from a list

Manuel Garcia news at manuelmgarcia.com
Thu Jun 12 19:36:59 EDT 2003


On Thu, 12 Jun 2003 21:00:18 +0100, "Rogue9" <rogue9 at ntlworld.com>
wrote:

>I´m working on a program for lottery analysing and need to generate
>random numbers from a filtered list of numbers i.e. I have reduced the
>likely ¨winning¨ numbers to a smaller pool and have them in a list.

Actually, you may not want to do this.  If you pick your numbers from
a list of 'likely winning' numbers, or even if you try to 'juke' the
game and pick your numbers from a list of 'unlikely winning' numbers,
you are competing against people who are trying exactly the same
strategy, or a similar strategy.  So if you do win, you will be more
likely to have to share your winnings.

(Not that the problem of 'sharing your lottery winnings' is a very
common or worrisome problem... ;-)

You can read more about it from The Straight Dope:

http://www.straightdope.com/classics/a4_119.html

Just pick your numbers completely randomly, and the chances of having
to share lottery winnings will be made as small as possible.  Python's
random number generator has been 'beefed-up' to the Mersenne Twister
generator in Python 2.3 (currently in beta), so you can rest assured
that your random numbers are just as good as anyone else's (except
professional cryptographers, who get their random numbers from fancy
hardware).

Manuel

(address for mailing any winnings given out on request ;-)




More information about the Python-list mailing list