A B C ?
In a unit square, points A, B, C are chosen uniformly at random on the perimeter, and point D is chosen uniformly at random in the unit square. To 4 decimal places, what is the probability that the D lies within triangleNote: The probability is between 0 and 1.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I got this question wrong so I cannot submit a solution but seeing the right answer, I found my error, here is my non-comp sci solution:
The probability D is in the triangle is equivalent to the expected area of the triangle as the area of the square is 1 .
We will find the expected area of the triangle with a weighted average of 4 cases.
Fixing one point on the bottom of the triangle WLOG there is a 1 6 1 chance all 3 points will be on the same side, 1 6 3 P 2 = 8 3 chance that all 3 points will be on different sides, 1 6 3 P 2 = 8 3 chance that two points will be on a side together and the third on an adjacent side, and then the remaining 1 6 3 have two points on the same side and the third on the opposite side as depicted below:
Now we must find the average area of each one:
Case 1 : all 3 points are on one side
This case is trivial, the area is 0
Case 2 : all 3 points on different sides
Now the area is 1 − 2 x + z − 2 ( 1 − x ) ( 1 − y ) − 2 y ( 1 − z ) given that the average values of x , y , and z are all 2 1 , the average value of this expression is 4 1
Case 3 : two points on one side and the third on an adjacent side
The three sub-segments of this diagram are exchangeable and thus have the same average length. As their sum is always 1 that means each must have an average length 3 1 , so the distance between two points on the same side averages 3 1 . This is important for this case and the next.
The average length of the base (on the side with two points) is 3 1 and the average height is 2 1 thus the average area is 2 1 ⋅ 2 1 ⋅ 3 1 = 1 2 1
Case 4 : two points on one side and the third on the opposite side
The average length of the base (on the side with two points) is 3 1 and the height is 1 thus the average area is 2 1 ⋅ 3 1 ⋅ 1 = 6 1
With a weighted average of the probability of a case occuring and the average area it yields we find the average area of any triangle and subsequently the probability to be 1 6 1 ⋅ 0 + 8 3 ⋅ 4 1 + 8 3 ⋅ 1 2 1 + 1 6 3 ⋅ 6 1 = 3 2 5
Log in to reply
Nice Sean!
I must say, yours is a cooler solution, for being analytic.
Same story here, got fooled by the diagram.
Problem Loading...
Note Loading...
Set Loading...
!FORTRAN 90 PROGRAM FOR MONTE CARLO PROGRAM MAIN IMPLICIT NONE REAL(16) :: A(2),B(2),C(2),D(2) REAL(16) :: R0,R1,R2,R3 REAL(16) :: PROB, PREV INTEGER :: I, NUM,CIN,COUT
!NUM = 100000
CIN = 0 COUT = 0 I = 1 PROB = 0.0Q0 PREV = 0.0Q0 !DO I = 1, NUM
DO CALL GENERATE POINT ON PERIMETER(A) CALL GENERATE POINT ON PERIMETER(B) CALL GENERATE POINT ON PERIMETER(C) CALL RANDOM NUMBER(D)
END DO
CONTAINS
SUBROUTINE GENERATE POINT ON PERIMETER(PP) IMPLICIT NONE REAL(16), DIMENSION(:) :: PP REAL(16) :: X CALL RANDOM NUMBER(X)
END SUBROUTINE GENERATE POINT ON_PERIMETER
FUNCTION AREA_TRIANGLE(X,Y,Z) RESULT(AR) IMPLICIT NONE REAL(16), DIMENSION(:) :: X,Y,Z REAL(16) :: AR
END FUNCTION AREA_TRIANGLE
END PROGRAM MAIN