This week the question title is: A Pi Day Puzzle
You are planning a picnic on the remote tropical island of 𝜋-land. The island’s shape is a perfect semi-disk with two beaches, as illustrated below: Semicircular Beach (along the northern semicircular edge of the disk) and Diametric Beach (along the southern diameter of the disk).

If you pick a random spot on 𝜋-land for your picnic, what is the probability that it will be closer to Diametric Beach than to Semicircular Beach? (Unlike the illustrative diagram above, assume the beaches have zero width.)
And for extra credit:
Suppose the island of 𝜋-land, as described above, has a radius of 1 mile. That is, Diametric Beach has a length of 2 miles.
Again, you are picking a random point on the island for a picnic. On average, what will be the expected shortest distance to shore?

Highlight to reveal (possibly incorrect) solution:
From a point p1 within the semi-disk, the distance to the semicircle is actually the distance to the point p2 on the semicircle, that lies on the line going through the center of the semicircle and p1, as that line is perpendicular to the tangent going through p2. (Figure.) The distance to the diameter is measured by simply going straight down.
Assuming that the radius of the semicircle is 1, the distance from center to p2 is 1. The distance from center to p1 = (x1, y1) is (x12 + y12)0.5. The distance between p1 and p2 is 1 – (x12 + y12)0.5.
The distance from p1 to the diameter is simply y1.
And what we’re looking for is the part of the semi-disk, where y1 < 1 – (x12 + y12)0.5.
The area of the whole semicircle is π * 12 / 2 = π / 2.
The area of the purple area of the Desmos figure is… Hang on.
y = 1 – (x2 + y2)0.5 <=>
1 – y = (x2 + y2)0.5 <=>
(1 – y)2 = x2 + y2 <=>
1 – 2y + y2 = x2 + y2 <=>
1 – 2y = x2 <=>
1 – x2 = 2y <=>
(1 – x2) / 2 = y
So the area of the purple area is
∫ (1 – x2) / 2 dx, from -1 to 1 =
1/2 ∫ 1 – x2 dx, from -1 to 1 =
1/2 [x – x3/3] from -1 to 1 =
1/2 ((1 – 1/3) – (-1 + 1/3)) =
1/2 (2/3 + 2/3) =
2/3
So the probability of aiming for the red area and hitting the purple area is 2/3 / π/2 = 4/3π ~ 0.4244.
And for extra credit:
Imagine the semi-disk is the base of a shape, described by z = f(x, y). At the beaches, f(x, y) = 0. Elsewhere, f is the distance to the nearest shore. We want to integrate over this shape.
Or maybe we just want to monte carlo it. 😉
My program reaches the conclusion, that the average distance is something like 0.192 miles.