3

Consider sticks of lengths $f(1),f(2),f(3),\dots,f(n)$ where $f(j)=j^\text{th}$ prime number.

Here is an example with $n=50$.

enter image description here

Let $P(n)=$ probability that three randomly chosen sticks can form a triangle.

What is $L=\lim\limits_{n\to\infty}P(n)$ ?

I am looking for a closed form for $L$, or if there is no closed form, then an approximation.

Simulations

Simulations suggest that $L\approx 0.46$.

enter image description here

My attempt

Suppose, for a given $n$, we have alreaday chosen $f(a)$ and $f(b)$, and we are about to choose $f(c)$.

If $f(a),f(b),f(c)$ can be the side lengths of a triangle, then $|f(a)-f(b)|<f(c)<f(a)+f(b)$, that is, $f^{-1}(|f(a)-f(b)|)<c<f^{-1}(f(a)+f(b))$.

So the probability that $f(a),f(b),f(c)$ can be the side lengths of a triangle is

$$\frac{\min\left(f^{-1}(f(a)+f(b)),n\right)-f^{-1}(|f(a)-f(b)|)}{n}$$

Then we take the average as $a$ and $b$ run from $1$ to $n$.

$$P(n)=\frac{1}{n^2}\sum_{a=1}^n\sum_{b=1}^n\frac{\min\left(f^{-1}(f(a)+f(b)),n\right)-f^{-1}(|f(a)-f(b)|)}{n}$$

If we use the prime number theorem to approximate $f(j)\approx j\log j$ and $f^{-1}(j)\approx\frac{j}{\log j}$ (which are asymptotic inverses), then

$$P\left(10^2\right)\approx 0.3595$$ $$P\left(10^3\right)\approx 0.4007$$ $$P\left(10^4\right)\approx 0.4246$$ $$P\left(10^5\right)\approx 0.4396$$

but I do not know how to take the limit as $n\to\infty$.

Context

Earlier I found that if $f(j)=j^{1/k}$ then $L=1-\dfrac{1}{\binom{2k}{k}}$, and I seeking a combinatorial proof for this fact.

Now I am wondering what $L$ is, if $f(j)=j^\text{th}$ prime number.

Dan
  • 35,053
  • 3
    As a crude thought, replacing $p_n$ with $n\log n$ might lead to a decent approximation. – lulu Oct 05 '24 at 13:14
  • 2
    The answer should be $\frac12$, just like the $k=1$ case in your earlier calculation. More generally, if $f(j)$ is reasonably nice and satisfies $\lim_{j\to\infty} \frac{\log j}{\log f(j)} = k$, then the answer should still be your $1-1/\binom{2k}k$. – Greg Martin Oct 06 '24 at 03:16
  • 1
    Simulation for $n$ up to $5\times10^7$: chart. The value for 50 million is $\approx 0.47275$, and this data agrees with @GregMartin's suggestion of $\frac12$. – Daniel Mathias Oct 06 '24 at 13:44

2 Answers2

3

(Self-answering, after reading comments from @Greg Martin and @Daniel Mathias.)

The answer is $\frac12$.

We have $f(j)=j^\text{th}$ prime number.

$f(j)$ asmptotically approaches $g(j)=j\log j$.

$g''(j)=\frac1j$, so the curvature approaches $0$ as $j\to\infty$. This mean that the graph of $f(j)$ increasingly resembles a straight line as we zoom out, so the probability that three sticks can form a triangle approaches the probability associated with linearly increasing stick lengths, which (based on my previous question) is $\frac12$.

This answer is supported by the chart from @Daniel Mathias' comment. This chart uses an exponential $n$-axis, which allows us to see the asymptotic behavior more clearly.

Dan
  • 35,053
1

Crude attempt with a partial answer:

3 side lengths form a triangle $$\iff f(a) \times (1,0) + f(b) \times (\cos(\theta_a),\sin(\theta_b)) + f(c) \times (\cos(\theta_c),\sin(\theta_c)) = (0,0)$$ for some non zero angles $\theta_b,\theta_c \neq 0$.

$$\frac{f(b)}{f(c)} = -\frac{\sin(\theta_c)}{\sin(\theta_b)}$$ $$f(a) = -f(b) \cos(\theta_b) - f(c) \cos(\theta_c)$$

$$f(a) = -f(c) \times \left(-\frac{\sin(\theta_c)}{\sin(\theta_b)}\cos(\theta_b) + \cos(\theta_c)\right)$$

$$\frac{f(a)}{f(c)} = -\frac{\sin (\theta_b - \theta_c)}{\sin(\theta_b)} $$ $$f(a) = -f(c) \times \frac{\sin \left(\theta_b + \sin^{-1} \left(\sin(\theta_b)\frac{f(b)}{f(c)}\right) \right)}{\sin(\theta_b)} $$

We also need $$\left | \sin(\theta_b)\right| \leq \frac{f(c)}{f(b)} $$

Set $$f(b) = f(c) \implies f(a) = -2f(c) \cos(\theta_b) \implies Prob \left(f(a) \leq 2 f(c) \right) = \text{ number of primes smaller than } 2 f(c)$$