Triangle forming probability for area

491 Views Asked by At

Say you have a stick which breaks randomly into three pieces (we can choose the points randomly). What is the probability that the area is greater than or equal to $0.4$?

I can see it has something to do with Heron's formula but I just can't put t together.

2

There are 2 best solutions below

5
On BEST ANSWER

We will assume the length of the stick is $1$ and we break the stick by picking two points $u, v$ uniformly and independently from $(0,1)$.

Let $a = \min(u,v)$, $b = 1 - \max(u,v)$ and $c = |u-v| = 1 - a - b$. $a, b, c$ forms the sides of a triangle when and only when

$$a \le b+c,\;b \le c+a,\;c \le a+b\;\iff\;a \le \frac12,\;b \le \frac12,\;a+b \ge \frac12$$

Change variable to $x = 1-2a, y = 1-2b$, the lengths $a,b,c$ forms a triangle when $(x,y)$ falls inside another triangle $$\Delta = \big\{ (x,y) : x \ge 0, y \ge 0, x+y \le 1 \big\}$$ with area $\frac12$. It is clear conditional to $a,b,c$ forming a triangle, the probability "density" of picking a particular $(x,y)$ is $2dxdy$.

Let $A$ be the area of a triangle with sides $a,b,c$ and $A_0 = 0.04$. By Heron's formula, we have

$$\begin{align} A &= \sqrt{s(s-a)(s-b)(s-c)}\\ \iff 16A^2 & = 1(1-2a)(1-2b)(1-2c) = xy(1-x-y)\\ \iff 64A^2 & = ((x+y)^2 - (x-y)^2)(1-x-y) \end{align} $$ Change variable once again to $p = (x+y), q = (x-y)$, the triangle $\Delta$ becomes

$$\Delta' = \big\{ (p,q) : 0 \le |q| \le p \le 1 \big\}$$

Furthermore,

$$A \ge A_0 \quad\iff\quad (p^2 - q^2)(1-p) \ge (8A_0)^2 \quad\iff\quad q^2 \le p^2 - \frac{(8A_0)^2}{1-p} $$ Let $\displaystyle\;f(p) = \sqrt{p^2 - \frac{(8A_0)^2}{1-p}}\;$ and $\lambda_1, \lambda_2$ be the two roots of $f(p)$ in $(0,1)$. The condition above is equivalent to $\lambda_1 \le p \le \lambda_2$ and $|q| \le f(p)$. Since $dpdq = 2dxdy$, the probability we seek equals to

$$\mathbb{P}[A\ge A_0] = \int_{\lambda_1}^{\lambda_2} \int_{-f(p)}^{f(p)} dqdp = 2\int_{\lambda_1}^{\lambda_2} f(p) dp$$

Change variable to $t = \sqrt{1-p}$, this becomes

$$\mathbb{P}[A\ge A_0] = 4\int_{\mu_1}^{\mu_2} \sqrt{t^2(1-t^2)^2 - (8A_0)^2} dt\tag{*1}$$

where $\mu_1, \mu_2$ are now the roots of the polynomial $\;t(1-t^2) - 8A_0\;$ in $(0,1)$.

For the problem at hand where $A_0 = 0.04$, we have

$$\mu_1 \approx 0.3711104191979701,\; \mu_2 \approx 0.7613913530813122$$ and $(*1)$ evaluates numerically to $$\mathbb{P}[A\ge A_0] \approx 0.2586458039398669$$ This is compatible with what another user @Henry obtained through simulation.

5
On

Assuming the length of stick is $2$. Let $X_1$ and $X_2$ be randomly sampled from $\text{Uniform}(0,2)$ and let $X_{(1)}, X_{(2)}$ be the order statistic.

The length of the three pieces will be,

$$a=X_{(1)},\ \ b=X_{(2)}-X_{(1)},\ \ c=2-X_{(2)}$$

Using,

  • triangle inequality ($a+b\geq c, b+c \geq a, c+a\geq b$) and
  • the range of $X_{(1)}$ and $X_{(2)}$ ($0 \leq X_{(1)} \leq X_{(2)} \leq 2$),

one can obtain the following condition for the three pieces to form a triangle,

$$0 \leq X_{(1)} \leq 1, \ \ 1 \leq X_{(2)} \leq 1+X_{(1)}$$

Using Heron's Formula,

$$A^2 = s(s-a)(s-b)(s-c) = 1(1-X_{(1)})(1-X_{(2)}+X_{(1)})(1-2+X_{(2)})$$

$$A^2 = X_{(1)}^2-X_{(2)}^2 +2X_{(2)} +X_{(1)}X_{(2)}^2-X_{(1)}^2X_{(2)}-X_{(1)}X_{(2)}-1$$

Let $E$ be the event that the three pieces form a triangle, then,

$$E = \{0 \leq X_{(1)} \leq 1 \text{ and } 1 \leq X_{(2)} \leq 1+X_{(1)}\}$$

and we need to find,

$$P(A^2 > c) = P(A^2>c|\text{E})P(E) + P(A^2>c|E^C)P(E^C) = P(A^2>c|E)P(E)$$

The joint pdf of $X_{(1)}, X_{(2)}$ is given by,

$$f_{X_{(1)},X_{(2)}}(x_1, x_2) = 2 \cdot \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{2}, \ \ x_1, x_2 \in [0,2],\ x_1 \leq x_2$$

And therefore the probability of the event $E$ is,

$$P(E) = \int_{0}^{1}\int_{1}^{1+X_{(1)}}f_{X_{(1)},X_{(2)}}(x_1, x_2) \partial x_2 \partial x_1 = \frac{1}{4}$$

The conditional joint pdf of $X_{(1)}, X_{(2)}$ conditioned on $E$ is,

$$\begin{align} f_{X_{(1)},X_{(2)}|E}(x_1, x_2) &= \frac{f_{X_{(1)}, X_{(2)}}(x_1\mathbb{I}(x_1 \in [0,1]), x_2\mathbb{I}(x_2 \in [1, 1+x_1]))}{P(E)}\\\\ &= \frac{1/2}{1/4} \\\\ &= 2,\ x_1 \in [0,1], x_2 \in [1,1+x_1]\end{align}$$

Introduce two random variables $U$ and $V$ as follows,

$$U = X_{(1)}$$

$$V = A^2 = X_{(1)}^2-X_{(2)}^2 +2X_{(2)} +X_{(1)}X_{(2)}^2-X_{(1)}^2X_{(2)}-X_{(1)}X_{(2)}-1$$

Writing $X_{(1)}$ and $X_{(2)}$ in the form of $U$ and $V$,

$$X_{(1)} = U$$

$$X_{(2)}^2(1-U) + X_{(2)}(U^2+U-2)+V+1-U^2=0 \\\\ \implies X_{(2)}^2 - X_{(2)}(U+2)-\frac{V+1-U^2}{U-1}=0 \\\\ \implies X_{(2)} = \frac{U+2 \pm\sqrt{(U+2)^2+\frac{4(V+1-U^2)}{U-1}}}{2}$$

Based on the values $X_{(1)}, X_{(2)}$ can take so as to form a triangle, we obtain the values that $U$ and $V$ can take,

$$0 \leq U \leq 1, \ \ 1 \leq \frac{U+2 \pm\sqrt{(U+2)^2+\frac{4(V+1-U^2)}{U-1}}}{2} \leq 1+U \\\\ \implies 0 \leq U \leq 1, \ \ 0 \leq V \leq \frac{U^2(1-U)}{4}$$

In order to obtain the pdf of $U, V$ conditioned on $E$, we compute the determinant of the Jacobian of $X_{(1)}, X_{(2)}$ with respect to $U, V$ as follows,

$$J = \begin{pmatrix} \frac{\partial X_{(1)}}{\partial U} & \frac{\partial X_{(1)}}{\partial V} \\ \frac{\partial X_{(2)}}{\partial U} & \frac{\partial X_{(2)}}{\partial V} \end{pmatrix} = \begin{pmatrix}1 & 0 \\ \ldots & \frac{\pm 1}{\sqrt{((U+2)(U-1))^2+4(V+1-U^2)(U-1)}}\end{pmatrix} \\ \implies |det J| = \frac{1}{\sqrt{((U+2)(U-1))^2+4(V+1-U^2)(U-1)}}$$

Corresponding to the $\pm$ sign in above matrix, let there be two different matrices $J_+, J_-$. For both matrices, $|det J_{+}| = |det J_{-}| = |det J|$.

Now, we compute the pdf of $U,V$ conditioned on $E$,

$$\begin{align} f_{U,V|E}(u,v) &= f_{X_{(1)}, X_{(2)}|E}\left(u, \frac{u+2 +\sqrt{(u+2)^2+\frac{4(v+1-u^2)}{u-1}}}{2}\right) |det J_{+}| \\\\ & \ \ \ + f_{X_{(1)}, X_{(2)}|E}\left(u, \frac{u+2 -\sqrt{(u+2)^2+\frac{4(v+1-u^2)}{u-1}}}{2}\right) |det J_{-}| \\\\ &= 2 \cdot 2 \cdot |det J| \\\\ &= \frac{4}{\sqrt{((u+2)(u-1))^2+4(v+1-u^2)(u-1)}}\end{align}$$

It is easy to $\color{red}{\text{verify}}$ that,

$$\int_{0}^{1}\int_{0}^{\frac{u^2(1-u)}{4}}\frac{4}{\sqrt{((u+2)(u-1))^2+4(v+1-u^2)(u-1)}} \partial v \partial u = \int_{0}^{1} 2u \partial u = 1$$

Integrate over $U$ to obtain the marginal distribution of $V$ conditioned on $E$,

$$f_{V|E}(v) = \int_{u:\ 0 \leq u \leq 1,\ \ 0 \leq v \leq \frac{u^2(1-u)}{4}} f_{U,V|E}(u,v) \partial u$$

The cdf of $V$ conditioned on $E$ will then be,

$$P(V \leq c | E) = \int_{0}^{c}\int_{u:\ 0 \leq u \leq 1,\ \ 0 \leq v \leq \frac{u^2(1-u)}{4}} f_{U,V|E}(u,v)\partial u \partial v $$

Consider the equation $v = f(u) = \frac{u^2(1-u)}{4}, \ u \in [0,1]$. For a particular value of $v = c > 0$, there are two values of $u$ satisfying the equation. Let those values be $u_0$ and $u_1$.

Note that $u_0 \in [0,f^{-1}(v_{max})] \equiv [0,\frac{2}{3}]$ and $u_1 \in [f^{-1}(v_{max}), 1] \equiv [\frac{2}{3},1]$. With this argument, the above integral can be written as,

$$\begin{align}P(V \leq c | E) &= \int_{0}^{u_0}\int_{0}^{\frac{u^2(1-u)}{4}} f_{U,V|E}(u,v)\partial v \partial u + \int_{u_0}^{u_1}\int_{0}^{c} f_{U,V|E}(u,v) \partial v \partial u \\\\ & \ \ \ \ + \int_{u_1}^{1}\int_{0}^{\frac{u^2(1-u)}{4}} f_{U,V|E}(u,v)\partial v \partial u\\\\ &= \int_{0}^{u_0}2udu + \int_{u_0}^{u_1}\left(\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c)}}{u-1} + 2u \right) \partial u + \int_{u_1}^{1}2u \partial u\\\\ &= u_0^2 + \int_{u_0}^{u_1}\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c)}}{u-1} \partial u + u_1^2 - u_0^2 + 1 - u_1^2 \\\\ &= 1 + \int_{u_0}^{u_1}\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c)}}{u-1} \partial u \end{align}$$

Finally,

$$\begin{align} P(A^2>c) &= P(A^2 > c|E)P(E) \\\\ &= (1-P(V \leq c|E))P(E) \\\\ &= \left(- \int_{u_0}^{u_1}\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c)}}{u-1} \partial u \right)P(E) \end{align}$$

Now, the value of $c$ is $0.04^2$ for the case when the length of the stick is $1$. Scaling up this value for the stick of length $2$ so that the probability doesn't change,

$$\frac{c_{new}}{\text{(max area in case of length 2 stick)}^2} = \frac{c_{old}}{\text{(max area in case of length 1 stick)}^2} \\\\ \implies \frac{c_{new}}{\left(\frac{\sqrt{3}}{9}\right)^2} = \frac{c_{old}}{\left(\frac{\sqrt{3}}{36}\right)^2} \\\\ \implies c_{new} = 0.0256$$

For $c > 0$, the values $u_0$ and $u_1$ are the solutions of $c = \frac{u^2(1-u)}{4}$ in the intervals $[0,\frac{2}{3}]$ and $(\frac{2}{3}, 1]$, respectively. Therefore, for $c = c_{new} = 0.0256$, $u_0 = 0.420283$ and $u_1 = 0.862277$. Putting these values in the last equation,

$$P(A^2 > c_{new} | E) = -\int_{u_0}^{u_1}\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c_{new})}}{u-1} \partial u \approx \color{blue}{0.258646}$$

$$P(A^2 > c_{new}) = \frac{-\int_{u_0}^{u_1}\frac{2 \sqrt{(u-1) (u^3 - u^2 + 4c_{new})}}{u-1} \partial u}{4} = \color{blue}{0.0646615} $$

Note: Used Wolfram to compute the value of the integral.