#ThisWeeksFiddler, 20260731

This week the #puzzle is: Can You Sneak Past the Rings? #probabilities #montecarlo #coding #plot

A long vertical cylinder has three narrow open rings, each of which wraps around seven-eighths of the cylinder (leaving a one-eighth “gap”). The rings are evenly spaced vertically, but are otherwise randomly rotated about the cylinder’s central axis. For some orientations of the rings, there exists at least one vertical line down the cylinder’s surface that passes through each ring’s gap, as illustrated below.
What is the probability that at least one such vertical line exists?

And for extra credit:

Instead of requiring a vertical line down the cylinder’s surface, now any helix down the surface is allowed. An example of such a helix passing through all three gaps is shown below.
What is the probability that there exists at least one such helix that can pass through each ring’s gap?

Can You Sneak Past the Rings?

Solution, possibly incorrect:

Program Desmos

Method 1: Monte Carlo. It’s a bit fiddly, because when exactly do the 3 gaps overlap? I settle on:

  • Put the 1st gap at 0 – 1/8, WLOG.
  • If possible, create the overlap between the 2 1st gaps.
  • Then look for an overlap between that overlap and the 3rd gap.

467910 sneaks out of 10000000, prob = 0.04679
468490 sneaks out of 10000000, prob = 0.04685
468187 sneaks out of 10000000, prob = 0.04682

Once I had all those conditions in place, I could actually do method 2, plot it in Desmos.

It was fun to figure out how to plot it. How the cases combine. I look at the cases for the double overlap in the columns and the cases for the triple overlap in the rows.

Gap 1: a-b, 0 – 1/8
Gap 2: c-d, c = x, 0x10\le x\le1
Gap 3: e-f, e = y, 0y10\le y\le1
In general, overlap goes i1i2i_1 – i_2
Overlap: c-b, x – 1/8
0x180\le x\le\frac{1}{8}
Overlap: a-d, 0 – [x – 1 + 1/8]
78x1\frac{7}{8}\le x\le1
i1ei2i1yi2i_1\le e\le i_2\iff i_1\le y \le i_2xy18x\le y\le\frac{1}{8}0yx1+180\le y\le x-1+\frac{1}{8}
i1fi2i1y1+18i2i_1\le f\le i_2\iff i_1\le y-1+\frac{1}{8}\le i_2xy1+1818x\le y-1+\frac{1}{8}\le \frac{1}{8}0y1+18x1+180\le y-1+\frac{1}{8}\le x-1+\frac{1}{8}
efe\le f
ei1,i2fyi1,i2y+18e\le i_1,i_2\le f\iff y\le i_1,i_2\le y+\frac{1}{8}
yxy\le x
18y+18\frac{1}{8}\le y+\frac{1}{8}
Impossible
fef \le e
0i1,i2fi2y+780\le i_1,i_2\le f \iff i_2\le y+\frac{7}{8}
Impossible78y\frac{7}{8}\le y
x78y78x-\frac{7}{8}\le y – \frac{7}{8}

Anyway. The result is 6 triangles. Each triangle has an area of 181812=1128\frac{1}{8}\cdot\frac{1}{8}\cdot\frac{1}{2}=\frac{1}{128}. The area of all the triangles is 6128=364=0.046875\frac{6}{128}=\frac{3}{64}=0.046875. This agrees with method 1.

Result: 0.046875.

And for extra credit:

Desmos

I recreated the situation in Desmos and played around a little. Among other things, I construct the (orange) interval e has to fall in, in order to make a helix possible.

Interestingly, this interval always has length 0.5, corresponding to a probability of 0.5.

  • My x axis shows how far along the circumference of the cylinder I am. As with the fiddler, the first gap is frozen 0 – 1/8.
  • The helix has to go through a and d, or b and c, or somewhere in between. This corresponds to different slopes of the helix.
  • I construct a point on the line going through b and c and crossing the 3rd ring. This point will have x=c+(cb)=2cbx=c+(c-b)=2c-b.
  • This leads to 2cbf2cb18e2c-b\le f\iff 2c-b-\frac{1}{8}\le e.
  • I also construct a point on the line going through a and d and crossing the 3rd ring. This point will have x=d+(da)=2dax=d+(d-a)=2d-a.
  • This leads to e2dae\le 2d-a.
  • The interval for e to fall within is therefore 2cb18e2da2c-b-\frac{1}{8}\le e\le 2d-a.
  • The length of this interval is
    • 2da(2cb18)2d-a-(2c-b-\frac{1}{8})
    • 2da2c+b+182d-a-2c+b+\frac{1}{8}
    • 2d2c+ba+182d-2c+b-a+\frac{1}{8}
    • 2(dc)+(ba)+182(d-c)+(b-a)+\frac{1}{8}
    • 218+18+182\cdot \frac{1}{8} +\frac{1}{8}+\frac{1}{8}
    • 12\frac{1}{2}

So the result is 0.5. I am surprised, that the answer is so simple.

Skriv en kommentar