MathGroup Archive 2002

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

Search the Archive

Re: simple program: help, please!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34480] Re: simple program: help, please!
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Thu, 23 May 2002 03:32:23 -0400 (EDT)
  • References: <acffm8$rs5$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Mario,
    v= Table[Random[Integer,{1,100}],{50}]

    vo= Sort[v]

    e=v[[30]]

    s=Apply[Plus, Take[v,30]]

    d= s/e

For a manual, have you tried Help?-- you will find the Mathemetica book and
a lot more.

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


"_MarioLatens" <mario.lat at libero.it> wrote in message
news:acffm8$rs5$1 at smc.vnet.net...
> I have to do something like this: I don't know mathematica language but I
> think it can do that...
>
> for i=1 to 500
> (
>  1) get 50 nubers random from 1 to 100. (to be onest I need exponential
> distribution) and put it in a vector 'v'
>
> 2) order this vector ('v') :   vo=order_vector (v)
>
> 3) take the 30th elemente : e=vo[30]
>
> 4) calculate sum of first 30 elements of vo  :   for(j=1 to 30) s=s+vo[j]
>
> 5) calculate d=s/i;
>
> 6) print d, print the vector vo.
>
> )
>
>
> I don't know  mathematica very well and I have to manipulate data in a
> little time so I ask help you: how can I write this programs?
>
> Thank you in advance, Mario.
>
> P.S. where can I find nice manual on internet for programming whith
> mathematica?
>




  • Prev by Date: Re: Exponential forms and substitution
  • Next by Date: Re: Speeding up hierarchical sorting
  • Previous by thread: Re: simple program: help, please!
  • Next by thread: RE: simple program: help, please!