I'm trying to find the distribution of the distance from a random (uniformly chosen) point on a side of an equilateral triangle (of side length = 1) to the opposite vertex.
I did the following:
From a triangle with vertexes on points $(0,0),(1,0),(1/2,\sqrt{3}/2)$. Assuming this distribution will be the same for any side on any equilateral triangle of side length = 1, I got a point on the side $(0,0),(1,0)$. So, the distance from any point on this side to the opposite vertex will be:
$$ d^2 = (x-1/2)^2+(y-\sqrt{3}/2)^2$$ $$ d^2 = (x^2 - x + 1)$$
As $y = 0$ on this side.
And $X \sim U(0,1)$
And I need now the distribution for the random variable $d = \sqrt{x^2-x+1}$. However, I can't find a way to do this transformation, as there is no obvious way to isolate x and apply formulas like this: $f_y(y) = f_x[g^{-1}(y)]|\frac{d}{dy}g^{-1}(y)|$
Is there any other way to approach this problem or am I just missing how to transform this random variable?
I propose a solution based:
on the cdf (cumulative distribution function), the pdf being obtained by differentiation of the cdf.
on the use of a slightly simpler equilateral triangle with vertices $A(-1,0), B(1,0),C(0,\sqrt{3}).$
Let $M=(X,0)$ with $X$ R.V. uniformly distributed on $(-1,1)$ (with pdf $\frac{1}{2}\mathbb{1_{(-1,1)}}(x)$).
Let $D$ be the random variable distance $CM:=D=\sqrt{X^2+3}$ (Pythagoras).
By definition, the cdf of D is:
$$F_D(d)=P(D<d)=P(D^2<d^2)=P(X^2+3<d^2)=P(X^2<d^2-3)$$
$$F_D(d)=P(-\sqrt{d^2-3}<X<\sqrt{d^2-3})=\frac{1}{2}2\sqrt{d^2-3}=\sqrt{d^2-3}$$
(because $X$ is uniformly distributed on $(-1,1)$). By differentiation:
$f_D(d)=\dfrac{d}{\sqrt{d^2-3}}$ or more precisely $\boxed{f_D(d)=\dfrac{d}{\sqrt{d^2-3}}\mathbb{1_{(\sqrt{3},2)}}(d)}$ by integrating the range of values of $D$ into the expression of the pdf.
Remark: For an equilateral triangle with a different size, one has to replace $f_D(d)$ by $\frac{1}{a}f_D(\frac{d}{a})$ where $a$ is a scaling factor.