Another week, another Riddler. This first question:
Choose three points on a circle at random and connect them to form a triangle. What is the probability that the center of the circle is contained in that triangle?
The method of finding if a point was in the center was as follows: Take Triangle ABC. Find the cross product of the vectors BA and BCenter. If the resulting vector is in the same direction (As measured by the dot product) as the cross product between the vectors BA and BC then the point is on the correct side of the line BA. Put another way, the center and the point C are on the same side of line AB. Repeat this for lines AC and BC. If the center is on the correct side of all the triangle’s lines then it is inside ABC.
This simulation was iterated to yield the answer of 25%.
Choose four points at random (independently and uniformly distributed) on the surface of a sphere. What is the probability that the tetrahedron defined by those four points contains the center of the sphere?
This was much more tricky. Firstly we had to find four points randomly distributed on a sphere. For this I used the Marsaglia method detailed here:
If x_1, x_2 are on independent uniform distributions on from (-1,1) and rejecting points for which
Next I needed to see if the center was enclosed. To do this I took the determinant 5 matrices of this form:
(Tetrahedron made up of points ABCD, center is c):
The other four matrices are of that form, but replacing A’s with c’s, then B’s with c’s, then C’s with c’s and finally D’s with c’s. If all these determinants have the same sign then the point is enclosed.
This simulation was iterated to yield the answer of 12.5%.
These graphs required a bunch of code to make the graphs. This can be found here