MathGroup Archive 1997

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

Search the Archive

RE: A Recreational Endeavour

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8764] RE: [mg8692] A Recreational Endeavour
  • From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
  • Date: Sun, 21 Sep 1997 20:51:07 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

It looks like you have a copy of the Mathematica Book.
That is very important.

A very good move to make the next step is to get a copy of
Power Programming with Mathematica the Kernal.
by: David B. Wagner

A signifigant part of this book covers
"Programming for Performance".
In this section he covers a lot of important lessons that many other authors
do not discuss.  He also covers a lot of other very good information.

     Ted
 --------------------------------------------------------------------------
|From: "haha"@astral.magic.ca at PMDF@PAXMB1
|To: ersek ted; "mathgroup"@smc.vnet.net at PMDF@PAXMB1
|Subject: [mg8764] [mg8692] A Recreational Endeavour
|Date: Friday, September 19, 1997 4:25AM
|
|<<File Attachment: 00000000.TXT>>
|I am an amateur in both Mathematica and mathematics. Consider the following
|bit of (likely) very inefficient code:
|
|In[1]:=
|x={1};y={2,3,4};
|Do[x=Append[x,y[[n+1]]];
|  y=Flatten[
|      Append[Transpose[
|          Reverse[ReplacePart[Partition[Delete[y,n+1],n],
|              Reverse[First[Partition[Delete[y,n+1],n]]],1]]],{3*n+2,3*n+3,
|          3*n+4}]],{n,1,100}]
|x
|Out[2]=
|{1,3,5,4,10,7,15,8,20,9,18,24,31,14,28,22,42,35,33,46,53,6,36,23,2,55,62,59,
|   
 76,65,54,11,34,48,70,79,99,95,44,97,58,84,25,13,122,83,26,115,82,91,52,138,
|   
 67,90,71,119,64,37,81,39,169,88,108,141,38,16,146,41,21,175,158,165,86,191,
|   
 45,198,216,166,124,128,204,160,12,232,126,208,114,161,156,151,249,236,263,
|  243,101,121,72,120,47,229,178}
|
|The resulting set is a permutation of the positive Integers, with the
|caveat that it is not known (and, perhaps, not knowable) if *every* number
|eventually appears.
|
|I would like to generate x for values much greater than 100. Using
|Mathematica 3.0 on a Macintosh with some 50 MB assigned to the MathKernel,
|I can generate x with a Length of about 4400 before running out of memory.
|If there is some way to squeeze more data points out of my existing code, I
|would be pleased to hear of it.
|
|--
|Nature requires five,
|Custom allows seven,
|Idleness takes nine,
|And wickedness eleven.
|
|
|
|



  • Prev by Date: Re: Memory Leak
  • Next by Date: Re: A Recreational Endeavour
  • Previous by thread: Re: A Recreational Endeavour
  • Next by thread: Re: A Recreational Endeavour