Given two rectengles, with edges length choosen uniformily from [0,1], what is the probability that the second rectengle will fit the first? i'm trying to solve this question with no success so far.
it is from a probability course test and the final answer was $ \frac{1}{6} $.
Given two rectengles, with edges length choosen uniformily from [0,1], what is the probability that the second rectengle will fit the first?
thanks!
 A: We'll define the (random variables) width and hight of first and second rectangles as $w_1,h_1$  and $w_2,h_2$ respectively. It is given that all edges are unifermly distributed. In notation: $w_1\sim U(0,1)$, $w_2\sim U(0,1)$, $h_1\sim U(0,1)$, $h_2\sim U(0,1)$. We need to find the probabilty that the 2nd rectangle will fit in the 1st. I.e. we need to find $p (A\cup B)$ where we'll denote $A=(w_2<w_1) \cap (h_2<h_1)$ and $B=(h_2<w_1) \cap (w_2<h_1)$. Note that $$p(A \cup B)= p(A)+p(B)-p(A\cap  B)$$. It is given that all 4 r.v. are independent thus $$p(A)=p(w_2<w_1)× p(h_2<h_1)=1/2×1/2=1/4$$ and  $$p(B)=p(h_2<w_1)× p(w_2<h_1)=1/2×1/2=1/4$$. To calculate $p(A\cap  B)$ observe that $$A\cap B=(w_2<h_2<w_1<h_1) \cup  (h_2<w_2<w_1<h_1) \cup 
(w_2<h_2<h_1<w_1) \cup(h_2<w_2<h_1<w_1)$$.
Observe that every pair of the last 4 events in the right hand in the last equality are disjoint (for instance $$(w_2<h_2<w_1<h_1) \cap (h_2<w_2<w_1<h_1) = \emptyset$$ ). Now, it is easy to prove that given 4 uniformly distributed independent r.v. $u_i \sim U(0,1),\quad i=1..4$ then $p(u_1<u_2<u_3<u_4)=1/24$.
There are 2 ways to prove it. Either directly by integration on the joint density function of $u_i$ or indirectly using the fact that all events of the form $u_i<u_j<u_k<u_l$ (where $i,j,k,l$ are permutations of 1..4) Are disjoint and have equal probability. And since there are 24 permutations we coclude $p(u_1<u_2<u_3<u_4)=1/24$
Now back to $p(A\cap  B)$.
$p(A\cap B)=4×p(w_2<h_2<w_1<h_1)=4/24=1/6$
So lastly,
$p(A \cup B)= p(A)+p(B)-p(A\cap  B)=1/4+1/4-1/6=1/3$
A: Are you sure it's $1/6$? As NivMan, I get $1/3$ in my two solutions:
Call the first rectangle $R$ and the second $S$. Let $R_1,R_2$ (resp. $S_1,S_2$) be the edges of $R$ (resp. $S$). We want the probability that $S$ fits $R$. We can order (decreasing in length) the edges $R_1,R_2,S_1,S_2$ in $24$ possible ways, all equally likely by independence and uniformity of the choice, and we won't be able to fit $S$ in $R$ if and only if when we order them:

*

*The first element is $S_1$ or $S_2$,

*The last element is $R_1$ or $R_2$.

So out of the $24$ half of them don't satisfy the first, and from this half $2/3$ elements will satisfy the second condition (by inspection or easy conditional probability), so in total $1/3$ of the combinations satisfy what we wanted.
Another way of thinking about this would be forgetting the indices, we are trying to order $2$ Rs and $2$ Ss and can't start with $S$ nor end with $R$, that gives $RSRS,RRSS$ are the only good ones out of the $\frac{4!}{2!2!}=6$, so we again get $1/3$.
