[group-organizers] book raffles?

David Christian david.christian at gmail.com
Thu May 7 23:32:55 CEST 2009


We give away books every month, but I find just doing pieces of paper
in a hat kind of boring.

Last time we used random.shuffle(), which worked okay but you had to
assign everyone a number.

I'm looking at more innovative ways to use python and random to select
the book winner...any ideas?

Here's the one I'm working on now.

Have everybody interested in the book stand up.  Then have the assign
themselves to be either a 1 or a 0.  If they're a 1, they raise their
hand, and if they're a 0, they don't.  Then we use random to pick
either a 1 or a 0, and those who are not holding the correct sign sit
down.  This gets repeated n times (for our group, maybe 5) until
there's a winner.

If you have x books to give away, you could do maybe wait until your
winner pool was less than or equal to x, and then have some sort of
ordering algorithm after that, maybe _then_ use random.shuffle to
select first, second, third place.

My only concern with this is that it might take a little longer than
I'd like.  Anyone else do anything interesting with book raffles?

Dave


More information about the Group-Organizers mailing list