MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

A Table-dimensioning problem


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



  • Prev by Date: second order linear PDE
  • Next by Date: CONFERENCE Notebook wich doesn't work
  • Previous by thread: second order linear PDE
  • Next by thread: Re: A Table-dimensioning problem