Re: Re: serie of random number

• To: mathgroup at smc.vnet.net
• Subject: [mg21324] Re: [mg21314] Re: [mg21202] serie of random number
• From: BobHanlon at aol.com
• Date: Fri, 24 Dec 1999 03:42:27 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```t = Table[Random[Real, {0, 1}], {9}]; Join[t, {1 - Plus @@ t}]

{0.28419996266564695, 0.02511318618010302,
0.355205808623824, 0.05090083250232359,
0.8554758085814785, 0.8451794714692122,
0.35775015747713446, 0.8695765278344698,
0.5735109302828055, -3.2169126856169976}

Note the sign and magnitude of the last term. I believe the requirement was
that the numbers lie on the interval {0, 1}.

Bob Hanlon

In a message dated 12/23/1999 6:10:59 AM, hpd1 at is2.nyu.edu writes:

>Several suggestions have been posted, each of which involves dividing each
>of n random terms by the sum of those n terms.  There's another obvious
>way:
>generate n-1 random terms and add a final term equal to 1 minus their sum.
>t=Table[Random[Real,{0,1}],{9}];Join[t,{1-Plus@@t}]
>The distribution will be somewhat skewed, however, because all of the
>"correction" to sum to 1 will be contained in the single final term.  If
>n
>is large enough, that shouldn't make much difference, and with a large
>n
>this method is probably faster.
>

```

• Prev by Date: Re: Q.) how can i merge LISTs.
• Next by Date: Re: Partial evaluation
• Previous by thread: Re: serie of random number
• Next by thread: Re: Re: serie of random number