Re: User problem

*To*: mathgroup at smc.vnet.net*Subject*: [mg24007] Re: User problem*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Tue, 20 Jun 2000 03:07:26 -0400 (EDT)*Organization*: Universitaet Leipzig*References*: <8ihuik$lcl@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, you really change the loop variable inside a loop random *and* you are wondering that the system crashes ? What will a simple C program do when you write for(k=0; k<i;){ i=random(); randomArray[i]=i; } The system crashes because Mathematica allocate for Table[_,{i,1,n}] internal an array of length n-1. using a random number larger than n will overflow the array and write something into memory used by the system, the stack or what ever. You mean RandomTab[max_Integer:249] := Table[Random[Integer, {1, 4}], {Random[Integer, max]}] and you should write down it. Regards Jens joseph wrote: > > Can anyone help: > I am trying to contstruct a table of random integers > between 1 and 4. I'd like to vary the number of > elements in the table from time to time. The > contruction that I use in Mathematica is as follows: > > genome = Table[i = Random[Integer, {1, 4}], {i, 249}] > > The problem with this is as follows: the above > generates tables of varying length up to and including > 249 elements. However, when I try to generate any > table containing more than 249 elements, I get the > following error message on my screen: > > This program has performed an illegal operation and > will be shut down. If the problem persists please > contact the vendor. > > I have version 4 of Mathematica, and am running it on > a Windows98 platform (Dell NoteBook) > > Any assistance will be greatly appreciated. > > Joseph468 at yahoo.com > > __________________________________________________ > Do You Yahoo!? > Send instant messages with Yahoo! Messenger. > http://im.yahoo.com/