Here's my quick and dirty C code for anyone interested. The beauty of such a method is that it takes less than 10 minutes to set up and run while thinking through the math took at least an hour for me. In the code, I pick two uniform random values a and b from [0 to 1). Then I compute the segment lengths a,b,c. Then compute the triangle inequality and check to see if it holds. I have to do the inequality calculation 3 times depending on whether a,b,or c is the longest piece.
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
int main() {
srand(time(NULL));
long not_tri=0;
double a,b,c, tri;
for (long i=0; i<1000000; i++) {
a=(double)(rand()%RAND_MAX)/RAND_MAX;
b=(double)(rand()%RAND_MAX)/RAND_MAX;
if (a>b) { c=1-a; a=a-b; }
else { c=1-b; b=b-a; }
tri=a-(b+c);
if (b>a) tri=b-(a+c);
if (c>b && c>a) tri=c-(a+b);
if (tri>0) not_tri++;
}
cout << "Not triangles: " << (double)not_tri/1000000.0 << endl;
return 0;
}