# Finding Area and probability[ hard nut to crack].

Suppose that $X$ and $Y$ are iid uniform distribution with $U(0, 1)$ random variables.

(a) What is $\mathbb P((X, Y ) ∈ [a, b]×[c, d])$ for $0 ≤ a ≤ b ≤ 1$ and $0 ≤ c ≤ d ≤ 1$ ?

What is $\mathbb P((X, Y ) ∈ A)$, where $A$ is an arbitrary subset of $[0, 1] × [0, 1]$?

(b) Let $A = {(x, y) ∈ [0, 1] × [0, 1] : x^2 + y^2 ≤ 1}$. What is the area of $A$ ?

(c). Define the rv $Z$ by

$$Z = 1 \quad ,\text{if} X^2 + Y^2 ≤ 1,$$ $$=0\quad, \text{otherwise}$$ What is $\mathbb E[Z]$?

(d) By simulating $Z$, write a program to estimate $π$.

### My attempt:

(a)$\mathbb P((X, Y ) ∈ [a, b]×[c, d])=\mathbb P(X)\mathbb P(Y)$

since $X$ and $Y$ are independent

$\mathbb P((X, Y ) ∈ [a, b]×[c, d])=\mathbb P(X)\mathbb P(Y)=(1)(1)=1$

for $0 ≤ a ≤ b ≤ 1$ and $0 ≤ c ≤ d ≤ 1$

I don't know what will be $\mathbb P((X, Y ) ∈ A)$ and (b)

for (c) i can write R code but don't know to manipulate at hand.

   # R code
n <- 100 # I choose n=100 randomly
X <- runif(n,0,1)
Y <- runif(n,0,1)
Z <- (X^2+Y^2<=1)
EZ <- sum(Z)/n


(d) ???

-
Since you know R, I suggest you check your answer to (a) by simulating it. Try, for example, $a=c=0.25, b=d=0.75$ and see if your simulation gives a probability of $1$ for (a). –  Dilip Sarwate Sep 25 '13 at 3:02
Note for (a), $\mathbb P((X, Y ) ∈ [a, b]×[c, d])=\mathbb P(X\in [a, b])\cdot \mathbb P(Y \in [c, d])$ by independence. –  Macavity Sep 25 '13 at 3:11

## 1 Answer

a) As @Macavity says $P((X,Y)∈[a,b]×[c,d])=P(X∈[a,b])⋅P(Y∈[c,d])$, since $X$ and $Y$ are $U(0,1)$, $P(X∈[a,b])=b-a$ and $P(Y∈[c,d])=d-c$ so $P((X,Y)∈[a,b]×[c,d])=(b-a)(d-c)$

Because $X$ and $Y$ are $U(0,1)$ the combined distribution $(X,Y)$ is uniformly distributed over the unit square with corners at $(0,0)$ and $(1,1)$. For any arbitrary subset $A$ of this square $P(X,Y)\in A$ is equal to the area of $A$.

b) For $A=(x,y)\in [0,1]×[0,1]:x^2+y^2\le 1$,

\begin{align} x^2+y^2&\le1\\ y^2&\le1-x^2\\ y&\le\sqrt{1-x^2}, \text{since all numbers are non-negative}\\ \end{align}

Integration will give you the area.

c) The area you just worked out will give you the probability $p$ that $Z$ is $1$. $E(Z)=p\times 1+(1-p)\times 0=p$

d) What is the shape of $X^2+Y^2\le 1$ within the unit square? How does the area of that shape relate to $\pi$? If you simulate $Z$ enough what value does the mean of your simulations approach? So, how does this relate to $\pi$?

-
Would you please explain Why does $X\sim U(0,1)$ imply that $P(X∈[a,b])=b-a$ ? If $X\sim U(0,k)$ , what will be $P(X∈[a,b])$? –  harry Sep 25 '13 at 8:25
(b) Do i need to integrate $$\int_{x=0}^{1}\int_{y=0}^{\sqrt{1-x^2}}(x^2+y^2)dy dx$$? –  harry Sep 25 '13 at 8:35
(a) Every location on the interval $(0,1)$ is equally likely, so for any sub-interval, the probability is equal to the length of that interval, so $b-a$. –  Dale M Sep 26 '13 at 1:10
(b) No. Integrate $$\int_0^1 \sqrt{1-x^2}dx$$ OR sketch it and work it out geometrically - a picture will give you A LOT of insight here. –  Dale M Sep 26 '13 at 1:12