Re: Short Doesn't Work
- To: mathgroup at smc.vnet.net
- Subject: [mg19273] Re: [mg19253] Short Doesn't Work
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 12 Aug 1999 01:24:26 -0400
- Sender: owner-wri-mathgroup at wolfram.com
>I am having problems with the Short[] function. > >In v3, the following, > >randDir:=2 Random[Integer]-1; >randWalk[n_]:=NestList[#+randDir&,0,n-1]; >(walk=randWalk[1000] ) // Short > >returns > ><<1>> > >I was expecting more than this. It still doesn't work if I >use Short[expr,5]. > >What's going on? > >Lawrence > >-- > > >------------------------------------------------------------ > (\___/) The fear of the LORD is the beginning of > (o\ /o) wisdom: a good understanding have all they > /|:.V.:|\ that do his commandments: his praise > \\:::::// endureth for ever. Psa 111:10 >-----`"" ""`------------------------------------------------ > Lawrence A. Walker Jr., M.Eng./Ph.D. Candidate > Morgan State University > Clarence M. Mitchell School of Engineering > COMSARE (Center Of Microwave/Satellite And RF Engineering) > Rm: 306-Schafer Phone: (443)885-1453 >------------------------------------------------------------ > > Lawrence, You can use Shallow. But still I agree with you. Short does not seem to work properly. randDir := 2 Random[Integer] - 1; randWalk[n_] := NestList[# + randDir &, 0, n - 1]; walk = randWalk[1000]; walk // Short <<1>> walk // Shallow {0, 1, 2, 3, 4, 5, 4, 5, 4, 5, <<990>>} Short seems to be very unpredictable in how it works. Wolfram should either give a better explanation or fix it or add extra parameters to control its use or get rid of it. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/