Re: Random Trouble
- To: mathgroup at smc.vnet.net
- Subject: [mg39181] Re: [mg39178] Random Trouble
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Mon, 3 Feb 2003 01:08:13 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On Sunday, February 2, 2003, at 03:13 PM, Donald Darling wrote:
> I have a program which uses a random number in several places - the
> same
> number in a given run of the program. When I implement the program
> however
> the number changes in every new call to it. I've tried to overcome
> this
> using "Which", "Hold", "Verbatim", and others, all to no avail. Any
> help
> greatly appreciated.
>
>
>
>
>
This is what SeedRandom is for, e.g.
SeedRandom[5];Table[Random[Integer,{1,10}],{3}]
{2,3,2}
Now evaluating again:
SeedRandom[5];Table[Random[Integer,{1,10}],{3}]
{2,3,2}
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/