Re: Random points in triangle
- To: mathgroup at smc.vnet.net
- Subject: [mg111745] Re: Random points in triangle
- From: Mark McClure <mcmcclur at unca.edu>
- Date: Thu, 12 Aug 2010 05:28:28 -0400 (EDT)
On Sun, Aug 8, 2010 at 7:23 AM, Ray Koopman <koopman at sfu.ca> wrote: > Try this a few times. It looks pretty uniform to me. > > p == RandomReal[NormalDistribution[0,1],{3,2}]; > r == #.p / Total[#,{2}] & @ > RandomReal[ExponentialDistribution[1],{5000,3}]; > ListPlot[{p,r},PlotRange->All,AspectRatio->1,Frame->True,Axes->None, > PlotStyle->{{Red,PointSize[.02]},{Black,PointSize[.005]}}] Yes, it turns out that it *must* be. According to Wikipedia, the obvious generalization works for the n-simplex: http://en.wikipedia.org/wiki/Simplex#Random_sampling If you are happy working with change of variables for triple integrals and joint probability distributions, then the triangular case isn't too hard. Here's my proof: http://facstaff.unca.edu/mcmcclur/blog/UniformTriangle.html Mark McClure