0
$\begingroup$

How do I plot points in the region of a circle with radius 1, given a uniform bivariate distribution (X,Y)?

Conditional PDF of y given x is provided as: (1) / (2 * sqrt(1 - x^2))

Any help is greatly appreciated. (I am coding in Maple).

Thanks!

  • 0
    Continuing to outsource your HW? Did you explain this approach to your TA?2017-02-05

1 Answers 1

2

I'm addressing the $\textit{first question}$: 'How do I plot points in this region ?'.

Generate a pair of 'random numbers' $\xi_{r}$ and $\xi_{t}$ which are uniformly distributed in $\left[0,1\right)$. A point$\left(x,y\right)$ in the unit disk is given by: $$ x = \sqrt{\xi_{r}}\cos\left(2\pi\xi_{t}\right)\,,\qquad y = \sqrt{\xi_{r}}\sin\left(2\pi\xi_{t}\right) $$


The following $\texttt{Mathematica}$ code makes the job with $10000$ points:

Clear[n,r,randDisk1,t];

randDisk1[] :=
Module[{r, t},
r = Sqrt[RandomReal[]];
t = 2 Pi RandomReal[];
{r Cos[t], r Sin[t]}
]

ListPlot[Table[randDisk1[], {n, 1, 10000}], 
PlotStyle -> {Red, PointSize[0.002]}, Axes -> False,AspectRatio -> 1]


enter image description here

  • 0
    Proof? You know, like, on a *maths* site...2017-02-05