Triangles on the Unit Circle

Introduction

We consider the following three problems: For any random triangles on the unit circle,

  1. which triangle has the largest perimeter?
  2. which triangle has the largest area?
  3. what’s the average area of the triangles?

Solution to the problem 1

Denote a triangle by ABC, then

a2=BC2=sinβ2,b2=CA2=sinγ2,c2=AB2=sinα2.

Thus,

s=a+b+c2=sinα2+sinβ2+sinγ2,

where α+β+γ=2π. Now, we formulate the problem as: Find α, β and γ such that s attains its maximum. Define

L(α,β,γ;λ)=sinα2+sinβ2+sinγ2+λ(α+β+γ2π).

Taking partial differentials, and we solve

Lα=cos(α/2)2+λ=0Lβ=cos(β/2)2+λ=0Lγ=cos(γ/2)2+λ=0Lλ=α+β+γ2π=0

We get

α=β=γ=2π3.

The Hessian matrix is

H=[sinα240010sinβ240100sinγ2411110].

It's easy to show that H is negative definite when α=β=γ=2π3. So the triangle that has the largest perimeter is an **equilateral triangle** on the unit circle.

Solution to problems 2 and 3

It’s kind of difficult to have analytic solutions to problems 2 and 3. So we resort to Monte Carlo simulation.

  • We can think that coordinates of A, B and C are (cosα,sinα), (cosβ,sinβ), and (cosγ,sinγ), respectively, where 0α, β, γ2π.

  • The lengths of the three edges are

a=BC=(cosβcosγ)2+(sinβsinγ)2b=CA=(cosαcosγ)2+(sinαsinγ)2c=AB=(cosαcosβ)2+(sinαsinβ)2

  • The area is

s(sa)(sb)(sc),

where

s=a+b+c2.

R code:

d <- function(x, y) sqrt((cos(x) - cos(y))^2 + (sin(x) - sin(y))^2)

a_simu <- function()
{rand_nbrs <- runif(3, min = 0, max = 2 * pi)
 a <- d(rand_nbrs[2], rand_nbrs[3])
 b <- d(rand_nbrs[1], rand_nbrs[3])
 c <- d(rand_nbrs[1], rand_nbrs[2])
 s <- (a + b + c) / 2
 A <- sqrt(s * (s-a) * (s-b) * (s-c))
}

set.seed(12345)
N <- 1e4
simu_res <- replicate(n = N, a_simu(), simplify = TRUE)


(summary(simu_res))
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 0.0000005 0.1348081 0.3928584 0.4770273 0.7711802 1.2989897
the_means <- cumsum(simu_res) / (1:N)
(the_means[N])
## [1] 0.4770273
plot(1:N, the_means, type = 'l')
abline(a = the_means[N], b = 0, lty = 2, col = 'red')

Note that 1.2989897 is very close to 334, which is the area of an equilateral triangle on the unit circle. Thus, we have evidence to say that the the largest area is attained by an equilateral triangle on the unit circle.

Also note that 0.4770273 is close to 32π, which is the answer that we seek for the problem 3—according to this web site.

Lingyun Zhang (张凌云)
Lingyun Zhang (张凌云)
Design Analyst

I have research interests in Statistics, applied probability and computation.