[Math] the probability of two random line segments crossing in a unit square

geometryprobability theory

For the purposes of this question a random line segment is defined by connecting two random points inside the unit square, where a random point is found by generating two random numbers between 0 and 1, and taking them as the x and y co-ordinates. What is the probability of two such randomly generated line segments crossing?

Best Answer

First decide whether you mean the line segments only, or the whole lines through the two points. Then the following method should lead you to the answer:

Generate four points at random. There are three ways to pair those points together, and the probability that the lines/line segments intersect will be $0$ or $\frac13$ or $\frac23$ or $1$, depending on whether the four points form a convex quadrilateral or a triangle with a fourth point in its interior.

So the overall probability can be deduced once you know the probability that four randomly chosen points from the unit square form a convex quadrilateral (or a triangle with a point inside). Not a trivial probability problem but I think it is known.