All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Three Points in a Square (Posted on 2008-03-17)
Three points are chosen at random inside a square. Each point is chosen by choosing a random x-coordinate and a random y-coordinate.

A triangle is drawn with the three random points as the vertices. What is the probability that the center of the square is inside the triangle?

 No Solution Yet Submitted by Brian Smith Rating: 3.2000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Almost all the way | Comment 4 of 18 |

General concept

Take the random points to be A=(x1, y1), B=(x2, y2), C=(x3, y3). Draw AB and connect it with the centre Z=(0,0). Compute the angles of ABZ: a (at A) and b (at B). Next, draw the triangle ABC and compute the angles a' (at A) and b' (at B). The origin will be inside the triangle iff a' > a and b' > b.

Computation procedure

Extend the lines AZ and BZ until the reach the edges of the square at A' and B'. The origin enclosing condition is then that C lies in the shaded region bordered by ZA'B'. (cf http://www.geocities.com/frank_mayer/Fun_n_Games/Origin.jpg)

I've taken the square to run between x,y = +- 1. Let KA be the area subtended by Z, A' and the point (x=1,y=0) Then the probability we are looking for is given by

Average( |KA - KB|) /4, where | | denotes the absolute value.

We compute KA for 5 distinct cases:

Case 1: x1 <= y1  then 2K1 = y1/x1

Case 2: y1 < x1 <= -y1  then 2K1 = 2 - x1/y1

Case 3: -x1 < y1 <= x1  then 2K1 = 4 + y1/x1

Case 4: -y1 < x1 <= y1  then 2K1 = 6 - x1/y1

Case 5: -x1 < y1 <= 0  then 2K1 = 8 + y1/x1

Each of the cases 2-4 correspond to A' lying along a single edge of the square. Cases 1 and 5 together account for the remaining edge.

The expression for K1 can be simplified by using the terms

u = Min( |x1|, |y1| )  and  v = Max( |x1|, |y1| ).

Computing the probability amounts to calculating a double integral, where the numerator term is allowed to vary between +- the denominator term in the inner integral. The double integral computation is rather easy. However, as I don't have time for it now, I will put it aside for another day. (Or, perhaps, someone will want to finish it).

Edited on March 17, 2008, 5:21 pm
 Posted by FrankM on 2008-03-17 17:13:10

 Search: Search body:
Forums (0)