Does anyone know if this is a difference in interpretation, or have i simply made a programming error ? (I'm pretty sure my programming is OK)
The difference isn't due to vagaries of javascript's pseudo random number generator, a friend has run the same code in java with a high-quality PRG from the encryption field, with the same result.
cheers, orion
the actual relevant code is this:
function test(A, B, C) { var t;
if ((A < B + C) && (B < A + C) && (C < A + B)) t = 1; else t = 0;
return t; }
// sequential cuts, 'keeping' a random first side. function doOneA() { var A = Math.random();
if (Math.random() < 0.5) A = 1 - A; var B = Math.random() * (1 - A); var C = 1 - A - B;
2. "RE: triangles solution correct ?"
In response to message #0
This is a tricky, but a well known, problem. One solution has been published in 1990 by J. Whittaker (Am Math Monthly, 97, 228-230).
The estimates your simulations lead to approximate ln(2)-.5! The paper deals with the Cartesian coordinates. I shall be trying to translate this into the barycentrics. I'll post here when finished.
Far as I understand, the point missed by Gardner and yours truly is that the second point is uniformly distributed not on the whole stick but only on its portion, so that the probabilities of getting two secondary pieces of certain lengths depend on the length of the piece being broken. The latter probabilities are not uniform.