MathGroup Archive 2005

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

Search the Archive

Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56139] Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?
  • From: "Peltio" <peltio at trilight.zone>
  • Date: Sat, 16 Apr 2005 03:52:51 -0400 (EDT)
  • References: <d3o0m7$bor$1@smc.vnet.net>
  • Reply-to: "Peltio" <peltioNOSPAM at despammed.com.invalid>
  • Sender: owner-wri-mathgroup at wolfram.com

you wrote

>It seems like I should get a random number with mean 10 and sigma 0. Or
>in other words, the result should 10 every time.

    >Map[Random,Thread[NormalDistribution[Array1,Array2]]]

>Anyone have an easy workaround?

My suggestion is to build your random function in such a way that it can
handle special cases:

    myRandom[mean_, 0] := mean
    myRandom[mean_, 0.] := N[mean]
    myRandom[mean_, std_] := Random[NormalDistribution[mean, std]]

    MapThread[myRandom, {Array1,Array2}]

cheers,
Peltio
Invalid address in reply-to. Crafty demunging required to mail me.





  • Prev by Date: Re: removing subelements
  • Next by Date: Re: Mathematica 4.0 can't run under XP.
  • Previous by thread: Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?
  • Next by thread: Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?