In all the problems f will denote a density, F the distribution function and c the constant needed to make the function a density.
Let (X,Y) be a random vector with joint density \(f(x,y) = cx/y^2, 1<x<y<2\).
\[ \begin{aligned} &1=\int_{-\infty}^\infty \int_{-\infty}^\infty f(x,y) dx dy = \\ &c\int_{1}^2 1/y^2 \left( \int_{1}^y x dx\right) dy = \\ &c\int_{1}^2 \frac{y^2-1}2\frac1{y^2} dy = \\ &c/2\int_{1}^2 1-1/y^2 dy = \\ &c/2(y+1/y|_1^2 = c/2(2+1/2-1-1) = c/4\\ &c=4 \end{aligned} \]
\[ \begin{aligned} &f_X(x) = \int_{-\infty}^\infty f(x,y) dy = \int_x^2 4x/y^2 dy = \\ &-4x/y|_x^2 = 4-2x, 1<x<2\\ &F_X(x) =\int_1^x 4-2t dt=4t-t^2|_1^x = 4x-x^2-3, 1<x<2\\ &F_X(1.5) = 4\times 1.5-1.5^2-3=\frac34=0.75 \end{aligned} \]
\[ \begin{aligned} &f_{Y|X=x}(y|x) = \frac{f(x,y)}{f_X(x)} = \frac{4x/y^2}{4-2x}=\frac{2x}{2-x}\frac1{y^2}; 1<x<y<2\\ &P(Y<y|X=x) =F_{Y|X=x}(y|x) =\int_x^y f_{Y|X=x}(t|x) dt = \\ &\int_x^y \frac{2x}{2-x}\frac1{t^2} dt = \frac{2x}{2-x} (-\frac1{t}|_x^y =\\ &\frac{2x}{2-x} (\frac1{x}-\frac1{y}) \\ &P(Y<1.5|X=1.25) =\frac{2*1.25}{2-1.25} (\frac1{1.25}-\frac1{1.5}) = \frac49=0.444 \end{aligned} \]
We roll three fair dice. Let X be the smallest of the three rolls and Y the largest. Find the joint density of (X,Y). Find F(2,4).
Let’s first consider the same experiment but assuming the three dice are rolled one after the other, so that there is also order. Then there would be a total of 63 = 216 different outcomes of this experiment. Now the event (X=k,Y=k) means all three rolls resulted in k, which has a probability of 1/63.
The event (X=k,Y=k+1) would be the outcomes (k, k, k+1), (k, k+1, k+1) and all there permutations. Each also has a probability of 1/63, so now without order the probability is 6/63 = 1/62.
For the case (X=k,Y=k+j) there are now j+1 possibilities for the “middle” outcome, and therefore the probability is j*6/63 = j/62, j=1,..,5.
So the density is given by
\[ 216P(X=x,Y=y) = \begin{vmatrix} X/Y& |& 1 & 2 & 3 & 4 & 5 & 6 \\ \hline 1 &|& 1 & 6 & 12& 18& 24& 30\\ 2 & |& 0& 1 & 6 & 12& 18& 24\\ 3 & |& 0& 0& 1 & 6 & 12& 18\\ 4 & |& 0& 0& 0&1 & 6 & 12\\ 5 & |& 0& 0& 0& 0& 1 & 6\\ 6 & |& 0& 0 & 0& 0&0& 1 \\ \end{vmatrix} \] Therefore
\[ \begin{aligned} &F(2,4) = P(X\le 2, Y\le 4) = \\ &1/216+1/36+2/36+3/36+1/216+1/36+2/36 = \\ &56/216 = 7/27 = 0.259 \end{aligned} \]
Say \(X\sim U[0,1]\) and \(Y|X=x\sim U[x, 1]\)
\[ \begin{aligned} &f_{Y|X=x}(y|x)=\frac{f_{X,Y}(x,y)}{f_X(x)}\\ &f_{X,Y}(x,y)=f_X(x)f_{Y|X=x}(y|x)=I_{0,1}(x)\frac1{1-x}I_{[x,1]}(y) \end{aligned} \]
\[ \begin{aligned} &f_{Y}(y) = \int_{-\infty}^{\infty} f_{X,Y}(x,y) dx =\\ &\int_0^y \frac1{1-x} dx = -\log(1-x)|_0^y=\\ &-\log(1-y)\text{; }0<y<1 \end{aligned} \]
\[ \begin{aligned} &f_{X|Y=y}(x|y) = \frac{f_{X,Y}(x,y)}{f_Y(y)} = \\ &\frac{\frac1{1-x}I_{0,1}(x)I_{[x,1]}(y)}{-\log(1-y)} = \\ &\frac{1}{(x-1)\log(1-y)};\text{0<x<y} \\ \end{aligned} \]
\[ \begin{aligned} &F_{X|Y=y}(x|y) =\int_{-\infty}^x f_{X|Y=y}(t|y)dx = \\ &\int_0^x \frac{1}{(t-1)\log(1-y)} dt = \\ &\frac{\log(1-t)}{\log(1-y)}|_0^x = \frac{\log(1-x)}{\log(1-y)};\text{0<x<y}\\ &F_{X|Y=0.6}(0.4|0.6)=\frac{\log(1-0.4)}{\log(1-0.6)}=0.557 \end{aligned} \]
n=1e5
x=runif(n)
y=runif(n,x,1)
hist(y,100,freq=FALSE)
curve(-log(1-x),0,1,add=TRUE,col="blue",lwd=2)
y0=0.6
x=x[abs(y-y0)<0.05]
hist(x,100,freq=FALSE)
curve(1/(x-1)/log(1-y0),0,y0,add=TRUE,col="blue",lwd=2)
length(x[x<0.4])/length(x)
## [1] 0.5641196