Given $K\_n$, if a random real weight between $[0, 1]$ is chosen for every edge, what is the probability that the graph satisfies the triangle inequality? How about the discrete version, where the weights are integers in $[0, k]$?


It is easy to see that if $n = 3$ the probability is $1/2$ and (empirically) that the probability approaches zero as n goes to $\infty$. Has anyone studied the problem before? Any exact or asymptotic results are appreciated.


Notes:


1. This question was posted on math.SE [here](https://math.stackexchange.com/questions/158233/probability-that-a-random-weight-function-on-k-n-satisfies-the-triangle-inequa). I got no answers and it seems pretty inactive at the moment.
2. This is my first question on mathoverflow, so I am sorry if this is not research-level, but it seems to me that it is.



Probability that random weights on $K_n$ satisfy triangle inequality
This is a little too long for a comment. It's easy to prove the rate suggested by Anthony Quas in the comments. For some constants $c\_1,c\_2 \gt 0$ and $n \ge 3$, 


$$e^{-c\_1 n^2} \le P(n) \le e^{-c\_2 n^2} .$$.


Lower bound: When all distances are greater than $1/2$ the triangle inequality is satisified.


Upper bound: Take $c n^2$ edge-disjoint triangles in $K\_n$. The probability that the triangle inequality is satisfied everywhere is at most the probability that it is satisfied just on those triangles, $2^{-c n^2}$, since simple integration ($\int\_0^1 \int\_0^{1-y} (1-x-y) dx dy = 1/6$) checks that the probability for one triangle is $1/2$.


The same sorts of bounds hold in the discrete version for $k \ge 1$. It's possible that the exact values may be interesting, and I suggest calculating them exactly for small $n$ and checking the normalized values in the OEIS.


