>>1610
time to solve this
first, by rotation and reflection, we can always get the first of the two points into the first half of the AB side. Let's give this point a coordinate along this side, distance from the point A, and mark it as x, and since it's in the first half, this distance is always less than 1/2.
Now, the second point can now be anywhere along the square (if I understood this question correctly, also on the same side as the first point.)
The second point is definitely not within 1/2 unit distance if it lies along BC or CD. If it lies along AB, then it's within 1/2 unit distance if it's at coordinate y < x + 1/2. And if it lies along AD, you have to use the Pythagorean theorem, and it's within 1/2 unit distance if it's at coordinate z² < 1/4 - x².
All sides have length 1, and the second point has the same probability to be anywhere. The chance that conditions are fulfilled are therefore (length of diameter where conditions are met)/(length of all sides combined). The chance that the second point is within 1/2 unit distance from the first point is therefore [ (x + 1/2) + sqrt(1/4 - x²) ]/4.
But, this was considering fixed position of first point. Now we need to integrate the solution along all possible positions of first point (since the probability density is the same everywhere, we don't have to take this into account). We integrate from 0 to 1/2 with respect to x, and divide everything with length of the integration interval (to keep probability normalized).
The integral of first part [x + 1/2]/4 is trivial, [(1/2)²/2 + 1/2 * 1/2]/4 = 3/32.
For the integral of second part sqrt(1/4 - x²)/4, we use the formula ʃ sqrt(a² - x²) dx = [x sqrt(a² - x²) + a² arcsin(x/a)]/2 + C. Value of the first term is zero on both sides of integration interval. The integral is therefore [arcsin(1) - arcsin(0)]/32 = π/64.
The length of integration interval was 1/2, so we have to multiply the value by 2 to obtain the result, which is (6+π)/32.