Skip to main content
24-Ruby IV
September 20, 2017
Question

The problem of cockroach races

  • September 20, 2017
  • 6 replies
  • 17509 views

The cockroach needs to run from start (from different positions of the start line) to finish-line in minimum time.
On the field of running there is a section in the form of a circle (see Fig.), where the running speed
differs by V1> V2 or V1 <V2.
Which route (trace) from the start line to the finish line should the cockroach use from different positions?

Better to get numerical, symbolical and plot solution (with animation!).

Bug.png

 

6 replies

23-Emerald IV
September 20, 2017

Not formulated clear enough:

- Is finish anywhere on the bottom line?

- Does the full circle need to be run in all cases, or is running (part of) the lower half of the circle enough?

- Does the full horizontal track (at the top) need to be run?

 

Luc

23-Emerald IV
September 20, 2017

Ah, now I see it.

The run is from top to bottom, and the question is if it's wise to run across the circle, or to avoid it.

 

Luc

24-Ruby IV
September 20, 2017

Two cases

Bug-1.png

19-Tanzanite
September 20, 2017

The case of V2<V1 doesn't make much sense. In that case it's clear that the cockroach must avoid the circle. Then there are an infinite number of equivalent solutions where the cockroach starts at some point on the start line and runs perpendicular to that to the finish line.

 

If V2>V1 the solution is obvious. Start above the center of the circle, run perendicular to the start line to the finish line. That's the shortest possible path, with as much of it as possible in the circle.

 

Edit:. You added a new post while I was typing, and now I see that the start point is not a variable, but fixed. That makes the solutions less trvial Smiley Very Happy

23-Emerald IV
September 20, 2017

Valery's question is to solve it for any starting position (horizontal) along the start line.

I bet it's related to an optical problem.

 

Intriguing, but I have to crack a coconut first...

 

Luc

16-Pearl
September 20, 2017

While I don't have the time to solve it, I think my approach would be a monte carlo.  

 

Given - starting position, v1, v2 ,s, r

 

Approach - Walk in a straight line at a random angle (0.0001 to 179.9999 deg - 90 deg being straight to the finish).  Then you need logic on if you hit the circle or not.  If you hit the circle, begin walking at a 2nd random angle (0 to 180 deg again) until you hit the circle edge again.  Then straight down to the finish.  Calculate the time for each attempt.

 

I'm assuming the question involves straight lines only.  But if the penalty or bonus of V2 was sufficient then following the edge of the curve would win.  (If V2 was ~0 then you'd want to walk around it)  That makes the real answer more difficult to calculate.  

24-Ruby IV
September 20, 2017

I would like to have someone:

Run-Square.gif

25-Diamond I
September 20, 2017

The result sure depends on the ratio v1/v2.

Furthermore you'll have to explain, as dferry pointed out, if you are just after straight lines or if you will also allow a curved path along the circumstance of the circle.

 

16-Pearl
September 20, 2017

While it's not my problem, I'd suggest the following constraints and clarifications

a.) travel in straight lines only

b.) If the circle is entered, 2 direction changes total are allowed (when you enter circle and when you leave)

c.) If the circle is not entered, 1 direction change is allowed (allowing you to avoid the circle)

d.) the roach is infinitely thin (allowing it to pass tangent to circle)bugs.jpg

Just as I finished typing I see your later constraints.  But I figured I'd send this anyway.

24-Ruby IV
September 20, 2017

All is allowed for the minimal time of run from start tp finish!

25-Diamond I
September 20, 2017

@ValeryOchkov wrote:

All is allowed for the minimal time of run from start tp finish!


Really? In your answer to Fred you confirmed that start and finish point must be vertically aligned. If thats true, none of dferrys three paths would be allowed!??

23-Emerald IV
September 23, 2017

It took a little longer. Unlike (possibly) Valery, I don't have cockroaches in the house. I do have silverfish (Lepisma saccharina) in my house, but they are much harder to train....

Anyway, here's the input:

LM_20170920_Cockroach.png

And the output is shown below, for s=1, r=1 v1=1 and v2=2 and b positions ranging from -2 to 2:

LM_20170920_Cockroach.gif

 

Luc

 

24-Ruby IV
September 23, 2017

Luc! I showed your animation to my cockroaches. They liked it. But one (in the middle - the egghead - as you and me) asked to start the animation from the point (case) when they run faster, bypassing the circle - from x =-3 to 3 for example. And for thr case when v.circle<v.field!

Taracany-1.png

23-Emerald IV
September 25, 2017

My silverfish have come across an interesting, but not completely unexpected phenomenon.

Observe the running field as shown below:

LM_20170920_CockRoach2.png

Notice that I've indicated s, the shortest distance between either side of the circle and the start and finish lines, and r is the radius of the circle. Then we have points b, the x-position on the start line, f, the x position on the finish line and i and o the entering and exiting points on the circle. v1 is still the speed of running outside, and v2 inside the circle. For each of these items you'll find values at the top of the picture.

Then there is angles alpha.i and beta.i, which are the angles between the normal (brown line from the circle centre through point i) on the circle edge and the entering path outside and inside the circle corresponding to point i. There's also the normal for point o, and I can define corresponding angles alpha.o and beta.o.

Now watch the animation below and pay attention to alpha.i and beta.i, and the ratio of their sines (shown at the top of the picture).LM_20170920_Cockroach1_1.5.gif

 

As you can see, the ratio of the sines of those two angles remains a constant (there's a division by zero problem in the middle of course), and that constant is the ratio of run speeds: v2/v1. This is Snell's law of optics.

Incidentally, I've calculated the run time for each path, and show the value as t. The small blue cross indicates that speed along the y-axis for each of the x-values of b.

 

Have fun!
Luc

 

P.S My silverfish are starting to learn how to deal with v1>v2:

LM_20170920_CockRoach_2_1.6.png

24-Ruby IV
September 16, 2020

You can free download the chapter about cockroach races

from the site of the book

2^5 Problems for STEM Education 

See please Study-27-Divertsment-for-Website.pdf in the Support Material.