A Table-dimensioning problem
- To: mathgroup at smc.vnet.net
- Subject: [mg74446] A Table-dimensioning problem
- From: "Ray Koopman" <koopman at sfu.ca>
- Date: Wed, 21 Mar 2007 02:56:38 -0500 (EST)
While attempting to create ragged arrays in connection with a recent thread, I discovered a discontinuity in the way Table interprets a random level-2 limit. When the level-1 limit (the number of rows) is less than 250, the level-2 limit (the number of columns) is re- evaluated for each row. When the level-1 limit is 250 or greater, the level-2 limit is evaluated only once. All versions 5.x do this. I don't know about 4, but 3.0 seems to always re-evaluate the limit. In[1]:= rag[rows_,colrange_] := Table[ Random[], {rows},{Random[Integer,colrange]}] In[2]:= Length @ Union[ Length /@ rag[249,{1,99}] ] Out[2]= 90 In[3]:= Length @ Union[ Length /@ rag[250,{1,99}] ] Out[3]= 1