3

Following on from this question:
There are several solutions out there but each has a different outcome.

I'm trying to calculate the expected area of a random triangle with a fixed perimeter of 1.

My initial plan was to create an ellipse where one point on the ellipse is moved around and the triangle that is formed with the foci as the two other vertices (which would have a fixed perimeter) would have all the varying areas. But then I realized that I wouldn't account for ALL triangles using that method. For example, an equilateral triangle with side lengths one third would not be included.

Can anyone suggest how to solve this problem? Thanks.

When I ran a script that randomly selects a triangle with a perimeter of length 1 according to how @Sheheryar Zaidi specified in his answer:

Let $0<x<y<1$ be the points at which the "stick is broken", and so $x, y-x, 1-y$ are the lengths of the three segments. For a triangle to be formed, the sum of any two sides must be greater than the third side. Therefore we get the following inequalities: $$x+(y-x)>1-y \\ (y-x)+(1-y)>x \\ (1-y)+x>y-x$$ Plotting these on a coordinate system gives a triangular region with vertices $(0, 1/2), (1/2, 1/2), (1/2,1)$. So any pair $(x, y)$ contained within that region results in a triangle of perimeter 1. I parameterize these pairs: $$\left(\frac{a_1}{2}, \frac{1+a_2}{2}\right),$$ for $0<a_2<a_1<1$. Now these can be plugged in Heron's formula (and simplified): $$A(a_1, a_2)=\frac{1}{4}\sqrt{(1-a_1)(a_1-a_2)(a_2)}$$

the average area of $10^7$ attempts came out 0.026179216476998588.

The closest result is of @Sheheryar Zaidi, but I do not know what exactly is A(R) in $E(A)=\frac{1}{A(R)}\int_0^1\!\!\!\int_0^{a_1}A(a_1, a_2)\,da_2da_1$.

Here's the Python code:

import random
import math
def areaOfRandomTriangle():
    x = random.random()
    y = random.uniform(0,x)
    A = x/2
    B = (1+y)/2 - A
    C = 1 - (B+A)
    s = (A + B + C)/2
    area = math.sqrt(s*(s-A)*(s-B)*(s-C))
    return area

n = 10**7 c = 0 for i in range(n): c += areaOfRandomTriangle() print('Average Area:',c/n)

Average Area: $0.026179216476998588$

But when I chose the random triangle in another way suggested there - by using an ellipse, i.e .:

  • Side A of the triangle is uniformly selected from $[0,\frac{1}{2}]$.
  • An ellipse is constructed whose distance between the foci is A (parameters a, b of the ellipse can be found by the condition $2a +A = 1$).
  • Select a point from the circumference of the ellipse uniformly as suggested here.
  • We will define the other two sides of the triangle B, C to be the distance of the point from the focal points respectively.
  • Calculate the area of the triangle A, B, C.

The area average of $10^5$ attempts is $0.02184924698584864$.

So my question is how to choose the triangle randomly and what is the expectation of the area?

Avraham
  • 91
  • 1
    Not sure what you are asking. I don't imagine there is any sort of unique or even preferred way to select a random triangle of fixed perimeter. Certainly, my first thought was to break a line segmennt in two points and discard results that don't yield triangles. I don't understand the ellipse method as, if I am following it, that would fix one leg of the triangle. – lulu Apr 15 '21 at 12:13
  • 1
    Another approach: select three points at random in the plane (inside some fixed circle, say) and make the triangle with those vertices. Scale this to obtain the desired perimeter. the cases where the points are colinear have probability $0$, hence can be ignored. – lulu Apr 15 '21 at 12:14
  • 2
    I agree with the comments of lulu. In these issues one must be aware not to fall into the equivalent of Bertrand paradox – Jean Marie Apr 15 '21 at 12:26
  • Also, given a certain distribution $p(a, b, c) $, you can always crazily modify it so that certain triangles are more likely to come out, and others are less. For example, if you have a (continuous) function $f:X \to X $ where $X$ is the space of triangles, and $p$ a probability measure on it, you have a new probability given by $p'(a, b, c) = p(f(a, b, c)) / p(f(X)) $. Therr is a small exception if $f(X) $ has zero probability. You have to found some axioms that the probability you search must respect. For example, I guess you want symmetry $p(a, b, c) = p(b, a, c) $ and so on – Andrea Marino Apr 15 '21 at 12:29
  • The problem is well-solved in the journal article here with the results: $$E(A)=\frac{p^2 \pi}{105}$$ $$Var(A)=p^4 \left[ \frac{1}{960}-\left( \frac{\pi}{105} \right)^2 \right]$$ where $p$ is the perimeter. – Ng Chung Tak Apr 15 '21 at 17:35

2 Answers2

1

I continued @Sheheryar Zaidi's path (quoted in the question), and just fixed the last equation and the result that came out is just like the result of the code.
Because the $a_2$ is really $a_2|a_1$ like here, so his expectation is: $$\frac{1}{a_1}\int_0^{a_1}\frac{1}{4}\sqrt{(1-a_1)(a_1-a_2)(a_2)} \,da_2$$ Therefore the expectation of the triangle area is: $$E(A)=\int_0^1\frac{1}{a_1}\int_0^{a_1}\frac{1}{4}\sqrt{(1-a_1)(a_1-a_2)(a_2)} \,da_2da_1 =0.0261799387799$$ Which is exactly like the result of the code, with an accuracy of 6 digits after zero.

Avraham
  • 91
0

Let the interfocal distance be $ 2f=\dfrac13 $

When an equilateral triangle its maximum area is $$ \dfrac{\sqrt{3 }}{4} \cdot \dfrac19$$

For other $f$ choices maximum value would be less than this.

When sides are of length $ (x,y,x+y)$ its area is zero as three three sides are collinear for any $f$ choice.

Narasimham
  • 40,495