#ThisWeeksFiddler, 20260612

This week the #puzzle is: Can You Catch the Longest Wave? #geometry #trigonometry #coding #approximation #maximum #average

Semicircle Island is shaped like a perfect semicircle (or semidisk, technically), with a radius of 1 mile. It doesn’t have any permanent residents, but it’s a very popular destination for surfers.
Rumor has it that a big wave is headed toward the island, but no one knows which direction it’s coming from. This thin, straight wall of water never changes speed or direction. It will first make contact with the island at 10 a.m. and it will last be in contact with the island at 10:10 a.m.
What is the longest possible stretch of land that is directly under the wave at 10:05 a.m.?

And for extra credit:

Another wave is approaching the island, but again no one knows which direction it’s coming from—for the moment, all directions are equally likely. For example, it might come in the direction illustrated below:
On average, what is the length of the stretch of land directly under the wave halfway between when the wave first and last makes contact with the island?

Can You Catch the Longest Wave?

Solution, possibly incorrect:

Program Desmos Video

Method 1: Recreate the situation in Desmos and play around to find a maximum value. (The Desmos document includes an animation. So does the video 😉 )

Method 2: Write a program to systematically go through a lot of options and find a maximum value.

The methods share a lot of the same math.

Assuming the island is a circle, but with 0 <= x, it makes sense to only look at some of the possible angles for the wave.

0θπ20\le \theta \le \frac{\pi}{2}

Here the angle is the one between the x axis and a line perpendicular to the wave. The wave is a tangent to the circle, and the line crosses the wave at the tangent point. (This wave could be the incoming wave or the outgoing wave.) This point can now also be described as:

x1=cos(θ),y1=sin(θ)x_1=\cos(\theta), y_1=\sin(\theta)

So now we have a definition of the line representing the wave:

yy1=x1y1(xx1)y-y_{1}=-\frac{x_{1}}{y_{1}}\left(x-x_{1}\right)

The wave on the other side of the island goes through (0,-1) and has the same slope.

y(1)=x1y1(x0)y-\left(-1\right)=-\frac{x_{1}}{y_{1}}\left(x-0\right)

To learn something about the wave in the middle, the one we will try to restrict to the island, learn the length of and maximize, we begin with a single point on that line:

x2=x1+02,y2=y1+(1)2x_{2}=\frac{x_{1}+0}{2},y_{2}=\frac{y_{1}+\left(-1\right)}{2}

And now we can describe the line segment:

yy2=x1y1(xx2){0x1y2}y-y_{2}=-\frac{x_{1}}{y_{1}}\left(x-x_{2}\right)\left\{0\le x\le\sqrt{1-y^{2}}\right\}

To learn more, we need exact descriptions for the end points of the segment. The top point will either be on the y axis or on the circle.

x3a=0x_{3a}=0

x1y1(xx2)+y2=1x2-\frac{x_{1}}{y_{1}}\left(x-x_{2}\right)+y_{2}=\sqrt{1-x^{2}}

Changing this to the standard form:

ax2+bx+c=0ax²+bx+c=0

a=x12y12+1a=\frac{x_{1}^{2}}{y_{1}^{2}}+1

b=2x12x2y122x1y2y1b=-\frac{2x_{1}^{2}x_{2}}{y_{1}^{2}}-\frac{2x_{1}y_{2}}{y_{1}}

c=x12x22y12+y22+2x1x2y2y11c=\frac{x_{1}^{2}x_{2}^{2}}{y_{1}^{2}}+y_{2}^{2}+\frac{2x_{1}x_{2}y_{2}}{y_{1}}-1

x3b=bb24ac2ax_{3b}=\frac{-b-\sqrt{b^{2}-4ac}}{2a}

x3=max(x3a,x3b),y3=x1y1(x3x2)+y2x_{3}=\max\left(x_{3a},x_{3b}\right),y_{3}=-\frac{x_{1}}{y_{1}}\left(x_{3}-x_{2}\right)+y_{2}

And for the bottom point:

x4=b+b24ac2a,y4=x1y1(x4x2)+y2x_{4}=\frac{-b+\sqrt{b^{2}-4ac}}{2a},y_{4}=-\frac{x_{1}}{y_{1}}\left(x_{4}-x_{2}\right)+y_{2}

And now we can calculate the distance between the points:

d=(x4x3)2+(y4y3)2d=\sqrt{\left(x_{4}-x_{3}\right)^{2}+\left(y_{4}-y_{3}\right)^{2}}

Playing around with the original angle, it’s possible to find a max for d. This happens at:

θ=0.339837\theta=0.339837

dmax=1.885618d_{max}=1.885618

The program reaches the same conclusion. 1.885618.

And for extra credit:

Instead of looking for a max, convert the program to add all the distances together, to find an average.

Result: 1.304439.

I’m sure there’s a way to find a function, where d pops out, and then integrate over it for all angles. But, you know.

Skriv en kommentar