# Probability that two random lines intersect inside a square

Consider the square with vertices $$(0,0),(1,0),(1,1),(0,1)$$.
Choose two independent uniformly random points $$P$$ and $$Q$$ inside the square.
Draw a line $$l_P$$ connecting $$(0,0)$$ and $$P$$.
Draw another line $$l_Q$$ connecting $$(1,0)$$ and $$Q$$.

What is the probability that $$l_P$$ and $$l_Q$$ intersect inside the square?

I will post my answer. Alternative solutions are welcome.

This question and answer serve to flesh out a comment I made at a similar question.

Let $$p$$ be the $$x$$-coordinate of the intersection of $$l_P$$ and $$y=1$$.
Let $$q$$ be the $$x$$-coordinate of the intersection of $$l_Q$$ and $$y=1$$.
If $$p<1$$ then $$p$$ is uniformly distributed in $$[0,1]$$, because the probability that $$p is proportional to the area of the triangle with vertices $$(0,0)$$, $$(0,1)$$ and $$(x,1)$$, which is proportional to $$x$$.
Similarly, if $$q>0$$ then $$q$$ is uniformly distributed in $$[0,1]$$.
For the lines not to intersect inside the square, first we require that $$p<1$$, which has probability $$\frac12$$. Then we require that $$q>0$$, which has probability $$\frac12$$. Finally we require that $$p, which (given that the first two requirements have been met) has probability $$\frac12$$ (since $$p$$ and $$q$$ are each uniformly distributed in $$[0,1]$$). So the probability that the lines do not intersect inside the square, is $$\left(\frac12\right)^3=\frac18$$.
Therefore the probability that the lines intersect inside the square is $$\frac78$$.