home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!husc-news.harvard.edu!tara!fry
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Seed for random numbers?
- Message-ID: <1992Aug26.185336.15134@husc3.harvard.edu>
- From: fry@tara.harvard.edu (David Fry)
- Date: 26 Aug 92 18:53:34 EDT
- References: <1992Aug26.213810.13252@reed.edu>
- Organization: Harvard Math Department
- Nntp-Posting-Host: tara.harvard.edu
- Lines: 32
-
- In article <1992Aug26.213810.13252@reed.edu> bowman@reed.edu (Eric Bowman (bobo)) writes:
- >I've written a program that used by a class here that has stochastic elements
- >to it. I've been using the seconds since 1901 deal to seed my random number
- >generator; unfortunately, when a class uses it, they get similar seeds and
- >(sometimes) near identical results on different machines. Does anyone have
- >a suggestion for how a unique seed for each machine could be created? I
- >don't know AppleTalk yet, but perhaps there is some i.d. associated with
- >each machine that could be EORed with the seed?
-
- If s1 and s2 are two seeds for the Macintosh random number generator,
- then s1 and s2 being close does not imply that the subsequent random
- sequences will be "close," whatever that means. Your phrase
- "(sometimes) near identical results" indicates to me that your
- stochastic model is just giving similar results for different
- sequences. Certainly this is not uncommon.
-
- Unless each Mac is synchronized to the second and the students start
- the programs at identical times, they should have different sequences,
- and each pair of sequences is as "different" as any other randomly
- selected pair. In other words, there's no reason to believe that
- seed=1 and seed=2 will give sequences more similar than seed=1 and
- seed=10000.
-
- If this is still unsatisfactory, you could put up a dialog box asking
- the students to enter a seed. Or you could use TickCounts(), which is
- the number of 60ths of second since the computer was turned on.
-
-
- David Fry fry@math.harvard.edu
- Division of Applied Sciences fry@huma1.bitnet
- Harvard University ...!harvard!huma1!fry
- Cambridge, MA 02138
-