Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about software that simulates randomness

4 views
Skip to first unread message

Skylamar

unread,
Jan 29, 2012, 3:34:01 AM1/29/12
to
I wasn't sure what to use for the Subject of this message.

I'm curious if there is a program that helps run a lottery. I'm not
talking about software that predicts numbers. I'm looking for a program
that will allow me to enter the names of people and then have the
software randomally generate a winner. I can't seem to find anything
with a Google Search. But there must be something because it must take
a very simple program to do.

Message has been deleted

Mark Storkamp

unread,
Jan 29, 2012, 8:13:48 AM1/29/12
to
In article <2012012900340176664-nothingtoseehere@movealongnet>,
The random number generators built in to most programming languages are
generally quite poor, and most programmers don't know which of the
available functions are best for their applications. If you are serious
about picking a truly random winner, check out the url:
http://www.random.org

Matthew Lybanon

unread,
Jan 29, 2012, 10:39:38 AM1/29/12
to
In article <0001HW.CB4A807E...@news.astraweb.com>,
Nelson <nel...@nowhere.com> wrote:

> On Sun, 29 Jan 2012 03:34:01 -0500, Skylamar wrote
> (in article <2012012900340176664-nothingtoseehere@movealongnet>):
> Almost every programming language has a random (actually pseudorandom)
> number generator function. Assign every participant a number and the
> function will pick one.
>
> This AppleScript will will pick a random number between 1 and x:
>
> random number x
>
> For example if you have 1000 entrants, open the AppleScript Editor (in
> the Utilities folder), type in "random number 1000", and hit the "run"
> button.
>
> Excel, Filemaker, and similar apps also have random number functions
> built in.

The procedure suggested by one poster--put the names in a list and let a
random number generator pick the index of the winning name--is a simple
way to do what you want. Another poster pointed out that the random
number generators ("pseudorandom" is more accurate; they use a
deterministic algorithm, so the sequence of numbers one of these
generators produces is not truly random) are not very good. You can
find plenty of "random" number generators in the literature, and you can
run tests to see if they are close enough to random for your purpose.

I understand you wanted a simple answer. But it isn't really a simple
question. (There is a further generalization, designed to produce
better results in "Monte Carlo simulations," that I won't even get into.)

dorayme

unread,
Jan 29, 2012, 11:54:04 AM1/29/12
to
In article
<mstorkamp-F1028...@news.eternal-september.org>,
People tend to overthink this sort of thing in this sort of context.
The various ideas of what *truly random* means have no real relevance
to the practical situation. The random generators in programming
languages are fine.

On the subject, however, of what "truly random" means, I would say the
best and most rigorous idea is that a number is truly random if no
possible observers could have predicted it no matter what their
information.

--
dorayme

Wes Groleau

unread,
Jan 29, 2012, 12:35:57 PM1/29/12
to
On 01-29-2012 03:34, Skylamar wrote:
> I'm curious if there is a program that helps run a lottery. I'm not
> talking about software that predicts numbers. I'm looking for a program
> that will allow me to enter the names of people and then have the
> software randomally generate a winner. I can't seem to find anything

Note the caveats of the other posters, but here's two things I use a lot
in the shell:

1. For just a number,

echo $RANDOM # random integer, range 0 .. 32767
echo $(($RANDOM/1000+5)) # random integer, range 5 .. 37

2. (program) | PickOne # (program) outputs a list;
# PickOne outputs one line from list

to randomly get one photo from my collection to work on,
open $(ls <photo-dir> | PickOne)

to randomly get one name from a file,
cat Lottery_Entrans.txt | PickOne

PickOne is a perl script:
--------- Starts after this line --------
#!/usr/bin/perl

@words = <STDIN>;

$new_word = $words[rand(@words)];

chomp ($new_word);

print ("$new_word\n");
--------- ends before this line --------

--
Wes Groleau

Words of the Wild Wes
http://Ideas.Lang-Learn.us/WWW

0 new messages