21

Question: The vertices of triangles are uniformly distributed on the circumference of a circle. What is the probability that the centroid is inside the incricle.

enter image description here

Simulations with $10^{10}$ trails give a value of $0.457982$. It is interesting to note that this agrees with $\displaystyle \frac{G}{2}$ to six decimal places where $G$ is the Catalan's constant.

Julia source code:

using Random

inside = 0 step = 10^7 target = step count = 0

function rand_triangle() angles = sort(2π * rand(3)) cos_angles = cos.(angles) sin_angles = sin.(angles) x_vertices = cos_angles y_vertices = sin_angles return x_vertices, y_vertices end

function incenter(xv, yv) a = sqrt((xv[2] - xv[3])^2 + (yv[2] - yv[3])^2) b = sqrt((xv[1] - xv[3])^2 + (yv[1] - yv[3])^2) c = sqrt((xv[1] - xv[2])^2 + (yv[1] - yv[2])^2) s = (a + b + c) / 2 incenter_x = (a * xv[1] + b * xv[2] + c * xv[3]) / (a + b + c) incenter_y = (a * yv[1] + b * yv[2] + c * yv[3]) / (a + b + c) incircle_radius = sqrt(s * (s - a) * (s - b) * (s - c)) / s return incenter_x, incenter_y, incircle_radius end

while true count += 1 x_vertices, y_vertices = rand_triangle() centroid_x = sum(x_vertices) / 3 centroid_y = sum(y_vertices) / 3 incenter_x, incenter_y, incircle_radius = incenter(x_vertices, y_vertices) centroid_inside = sqrt((centroid_x - incenter_x)^2 + (centroid_y - incenter_y)^2) <= incircle_radius inside += centroid_inside if count == target println(count, " ", inside, " ", inside / count) target += step end end

  • 2
    Interesting problem! Thinking about it made me ask https://math.stackexchange.com/q/4889784/35416. If that one can be solved, it might provide useful tools for dealing with this here, too. – MvG Mar 29 '24 at 20:42

3 Answers3

6

This is not an answer, but I have a plot of what the probability space looks like.

Fix the first vertex at the top. Choose two real values between $0$ and $1$ uniformly at random, let them be $p_1$ and $p_2$. The second vertex is $p_1$ the way around the circle, and $p_2$ respectively. Plot the points on the coordinate plane, where $p_1$ is $x$ and $p_2$ is $y$.

The entire space of possibilities is the square from $(0,0)$ to $(1,1)$. We plot the point only if the centroid is in the incircle. We get a figure like such ($10^4$ steps sampled from each axis):

normal plot

Bonus: Here is the same plot but with the fixed point on the opposite side instead.

shifted plot

I do not know where to proceed from here. I am not sure how to intuitively understand why six negative petals appear.

Code for anyone interested:

import matplotlib.pyplot as plt
import numpy as np
import math

sqrt = math.sqrt PI = math.pi cos = math.cos sin = math.sin def dist(p1, p2): d1 = p1[0]-p2[0] d2 = p1[1]-p2[1] return sqrt(d1d1 + d2d2)

def GInsideIncircle(p1, p2): try: v = ((1,0), (cos(2PIp1), sin(2PIp1)), (cos(2PIp2), sin(2PIp2)) ) g = (( v[0][0]+v[1][0]+v[2][0] ) /3, ( v[0][1]+v[1][1]+v[2][1] ) /3) a = dist(v[1], v[2]) b = dist(v[0], v[2]) c = dist(v[0], v[1]) p = a+b+c s = p/2 i = ( (av[0][0]+bv[1][0]+cv[2][0])/p, (av[0][1]+bv[1][1]+cv[2][1])/p ) A2 = s(s-a)(s-b)*(s-c) if A2<0: A2 = 0 r = sqrt( A2 ) / s return dist(g, i) < r except ZeroDivisionError: return False

def draw(a,b): x.append(a) y.append(b)

x = [] y = [] steps = 10000

for xd in range(steps): for yd in range(steps): if GInsideIncircle(xd/steps, yd/steps): draw(xd/steps, yd/steps)

plt.scatter(x, y) plt.show()

zhuli
  • 2,768
  • @zhuli A very unexpected shape indeed! Can you share the source code to simulate the plot of the probability space? – Nilotpal Sinha Mar 28 '24 at 01:45
  • 1
    Sorry about the wrong fixed point position, I've fixed it and created two different plots, which should make more sense now. I also included my source code, apologies for it being a bit messy, I wrote it from my phone and got lazy. – zhuli Mar 28 '24 at 02:01
  • 3
    So we really have three "negative" regions when we consider that both $p_1$ and $p_2$ are plotted on a circle, so the left and right edges of the graph represent the same position of $p_1$ and the top and bottom edges represent the same position of $p_2$. Each "negative" region occurs when two points are relatively close to each other and the remaining point is relatively far from them. There are two configurations that produce an equilateral triangle, and these are at the center of each "positive" region, which makes sense. – David K Mar 28 '24 at 02:41
6

A follow-up to my comment on Dan's post:

In the $x,y$ plane, the boundary of the region $R$ is defined by the implicit function

$$15+6\cos(2y)-5\cos(4y)=(6+10\cos(2y))\cos(2x)-12(\cos(3y)-\cos y) \cos x$$

so that solving for $x$ and denoting $c=\cos y$, we arrive at

$$\cos x = \frac{3c^3 - 3c \pm 4c^2 \sqrt{2-c^2}}{5c^2-1} \\ \implies x = x_{\color{red}{\pm}}(y) = \pm \arccos \frac{3c^3 - 3c \color{red}{\pm} 4c^2 \sqrt{2-c^2}}{5c^2-1}$$

where the $\pm$ subscript corresponds to the same sign on the root. In the plot, $x_-(y)$ and $x_+(y)$ are resp. shown in blue and red.

enter image description here

It can be shown that $\min x_-(y)=0$ at $y=\arccos\dfrac15$ (orange), which can be used as a cut-off to split up the integral for the area w.r.t. $y$:

$$\iint_R dA = 2 \iint_{R \land x\ge0} dA = 2 \left(\int_0^{\arccos\tfrac15} x_+(y) \, dy + \int_{\arccos\tfrac15}^\tfrac\pi2 \left(x_-(y) - x_+(y)\right) \, dy\right)$$

Double that and divide by $\pi^2$ to get the probability. Numerically, Mathematica with NIntegrate claims an area of about $4.520\color{red}{21146}\ldots$, compared to expected value via NSolve of

$$\frac{2 \times \text{area of }R}{\pi^2} = \frac G2 \implies \text{area of }R \approx 4.520\color{red}{10902\ldots}$$

I suspect the discrepancy is due to floating-point error.

user170231
  • 25,320
  • 5
    So the probability in question is $1-\frac{12}{\pi^2}\int_0^{\pi/2}(y-x_+)dy$. Numerical evidence suggests that $\int_0^{\pi/2}x_+dy=\frac{3\pi^2}{8}-2\pi\arctan{\frac12}$, and I ask for a proof here. That would imply that the probability is $4-\frac{24}{\pi}\arctan{\frac12}=0.45799317639...$. – Dan Mar 30 '24 at 00:54
  • 5
    ...and here is a proof that $\int_0^{\pi/2}x_+dy=\frac{3\pi^2}{8}-2\pi\arctan{\frac12}$. – Dan Apr 01 '24 at 23:01
  • @Dan Wonderful. That settles this question. But I am not sure which of the answers posted here should I select as the accepted answer since there is contribution from all towards the eventual answer. – Nilotpal Sinha Apr 02 '24 at 09:55
  • 1
    @NilotpalSinha I would accept user170231's answer, since the final answer appears in that answer's comments. (Maybe make a note in the question that the final answer appears there.) – Dan Apr 02 '24 at 10:03
  • Thats a fair point. – Nilotpal Sinha Apr 02 '24 at 10:06
  • 1
    Thanks @NilotpalSinha for the accept, but I just want to acknowledge that this was very much a joint effort! :) – user170231 Apr 02 '24 at 16:13
4

Long comment.

Here is evidence that $0.457<P<0.459$.

Assume that the circle is a unit circle centred at the origin, and the vertices of the triangle are:
$A\space(\cos(-2Y),\sin(-2Y))$ where $0\le Y\le\pi$
$B\space(\cos(2X),\sin(2X))$ where $0\le X\le\pi$
$C\space(1,0)$

So:
$a=BC=2\sin X$
$b=AC=2\sin Y$
$c=AB=|2\sin(X+Y)|$

The incircle has centre $\left(\frac{a\cos (-2Y)+b\cos (2X)+c}{a+b+c},\frac{a\sin (-2Y)+b\sin (2X)}{a+b+c}\right)$ and radius $\sqrt{\frac{(s-a)(s-b)(s-c)}{s}}$ where $s=\frac{a+b+c}{2}$.

The coordinates of the centroid are $\left(\frac{\cos (-2Y)+\cos (2X)+1}{3},\frac{\sin (-2Y)+\sin (2X)}{3}\right)$.

So the probability in the OP is the probability that

$$\left(\frac{\cos (-2Y)+\cos (2X)+1}{3}-\frac{a\cos (-2Y)+b\cos (2X)+c}{a+b+c}\right)^2+\left(\frac{\sin (-2Y)+\sin (2X)}{3}-\frac{a\sin (-2Y)+b\sin (2X)}{a+b+c}\right)^2<\frac{(s-a)(s-b)(s-c)}{s}$$

This probability is the ratio of the area of the shaded region to the area of the square in the graph below.

enter image description here

By symmetry, we only need to consider the bottom-left shaded region and the bottom-left half of the square. Rotate these regions $45^\circ$ anticlockwise about the origin, then shrink by factor $\frac{1}{\sqrt2}$, by letting $X=y-x$ and $Y=y+x$.

enter image description here

We want to find the area of the three unshaded regions inside the triangle. By symmetry, they have equal areas, so we only need to consider the top unshaded region.

As can be seen in a demos graph (where you can zoom in),

  • $\color{red}{y=f(x)=\arccos \frac15+0.06x^2-0.002|x|^3+0.0101x^4}$ lies above the top boundary of the shaded region
  • $\color{green}{y=g(x)=\arccos \frac15-10^{-5}+0.06x^2-0.004|x|^3+0.0113x^4}$ lies below the top boundary of the shaded region.

(I got $f(x)$ and $g(x)$ by trial and error.)

So an upper bound for the probability is

$$1-\frac{3\int_0^{\pi/2}\left(\frac{\pi}{2}-\color{red}{f(x)}\right)\mathrm dx}{\frac{\pi^2}{8}}=0.4589372...$$

and a lower bound for the probability is

$$1-\frac{3\int_0^{\pi/2}\left(\frac{\pi}{2}-\color{green}{g(x)}\right)\mathrm dx}{\frac{\pi^2}{8}}=0.457077...$$

Dan
  • 35,053
  • 2
    The region boundary is given by$$15+6\cos(2y)-5\cos(4y)=(6+10\cos(2y))\cos(2x)-12(\cos(3y)-\cos y) \cos x$$We can solve for either $x$ or $y$ by solving a polynomial in $\cos x/y$ resp. but I'm not sure that will make things easier – user170231 Mar 29 '24 at 17:58
  • 1
    You're right! I take it back, silly error in the integral setup on my part. – user170231 Mar 30 '24 at 00:05
  • 2
    Perhaps an easier way to arrive at the region boundary is first to utilize that the distance between the centroid and the inradius ($r$) is: $$\frac13\sqrt{s^2+5r^2-16rR}$$ Where $s$ is the semiperimater and $R=1$ in our case. We're essentially looking to find the probability that this is less than the inradius. Squaring and moving to the other side yields:

    $$P(\frac13\sqrt{s^2+5r^2-16rR} < r)=P(s^2+16 < 4(r+2)^2)$$ $$=P((\sin A +\sin B+\sin C)^2+16 < 4(\cos A+\cos B+\cos C+1)^2)$$

    Now fix $C=\pi-A-B$ and transform $x=A-B$ and $y=A+B$ to arrive at the region boundary.

    – Zacky Apr 01 '24 at 12:48