All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Tunneling through a mine car (Posted on 2019-04-16) Difficulty: 3 of 5
Four safety engineers set out to inspect a newly cut tunnel through Mt. Popocaterpillar in the Andes. Each person walks at a different constant integer speed measured in meters per minute. In the tunnel there is a mine car which travels along a fixed track, automatically going from end to end at a fixed integer speed. When people board the car they may reverse its direction, but cannot change its speed.

At noon on Monday all four engineers start at the south end, while the mine car starts at the north end. The first (fastest) engineer meets the car, and takes it some distance north. The engineer gets out and continues going north, while the car resumes heading south. Then the second engineer meets the car and also takes it some distance north. Likewise for the third and fourth engineers. All the people, and the mine car, travel continuously with no pauses. The inspectors always go north. Each person enters and exits the car at an integral number of minutes.

All four engineers reach the end of the tunnel simultaneously. What is the earliest time this could happen?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
soln | Comment 14 of 25 |

The bottom line is that my result is 36 minutes with very advanced engineering and running rather than walking, but 46 minutes with more conventional engineering. 

Method: I described the method in my first posting: 7 parameters 

(4 Engineer walking speeds, the car's speed, the duration of E1’s 1st walk and drive) together serve to completely fix the simulation. I varied these parameters to get a minimum time. I show the math here. The output (abbreviated) is here.

To run the simulation I choose the very maximal ranges:
Maximum tunnel length:  2 x Gotthard 57 km tunnel
Maximum foot speed: 28 mph running speed
Max car speed: 200 mph
    (like a Maglev, but in a tunnel like Musk's futuristic
    one for CA)
Maximum time in tunnel: 20 days
  (Yikes. Fortunately all times are under an hour.)
The program ran in a couple of hours.
As the times got smaller, the tunnels,
the mine car and walkers became more fantastic.
For example I did not post a solution with T=34 min,
because the Engineers were moving too fast. Here are possible solutions:
---------
Tunnel 1:
Length: 2310 m, Time: 46 minutes: car speed: 105 m/min
Walking speeds: 49, 45, 45, 42, 35. E1 1st walk 15 min,
Car times 1, 4, 6, 10, min
--------
Tunnel 2:
Length: 18564 m, Time: 36 minutes: car speed:
  2184 m/min (86 mph)
Walking speeds: 468 (18 mph!), 364, 182, 39 m/min
E1 1st walk 7 min
Car times 1, 3, 6, 8 min
--------------
Incidentally, I was able to reproduce Steve H.s result for
E1, E2 of 6 min. It was, in fact, very helpful to have
his result for debugging this simulation - many thanks!
The case of E1, E2, and E3 only (3 E's) has a minimal
time of 17 min:
---------------
Tunnel 1-3E:
Length: 540 m, Time: 17 minutes: car speed: 60 m/min
Walking speeds: 30, 28, 20; E1 1st walk time 6 min,
Car times 1, 2, 5 min
--------------
program:

        program tunn
        implicit none
        integer Dmax,D,fsmax,csmax,cs,Trecord,Tmax,
        1 fs1,fs2,fs3,fs4,ft1,ct1,ct1max,posint,nonneg,
        2 irat,ihalfrat,id,iexp,texp,T2,T3,T4,ttot
        real xcs,xct1,ct2,ct3,ct4,xft1,xfs1,xfs2,xfs3,xfs4,
        2 pin1,pin2,pin3,pin4,pout1,pout2,pout3,pout4,
        3 pcc1,pcc2,pcc3,pcc4,T,rat,del
        
        Dmax =    114000 ! [meters] two times Gotthard 57 km tunnel length
        fsmax =      700 ! [meters/min] foot speed running at 28 mph
        csmax =     5000 ! [meters/min] car at 200 mph
        Tmax =     28800 ! [min] 20 days
        Trecord = 100000 ! [min] time to beat
        iexp=3
        texp=10**iexp
        pcc1=0
        print 2222
2222    format('Time Tunnel   Car Wlk fs1     pcc1    pin1',
        1'     ct1   pout1  fs2     pcc2    pin2     ct2   pout2 ',
        2' fs3     pcc3    pin3     ct3   pout3  fs4     pcc4    pin4',
        3'     ct4   pout4   ttot',/,170('-'))
         do 7 D = 20,Dmax
         id=D/texp
c        if (texp*id.eq.D)print*,D,' out of ',Dmax
          do 6 ft1 = 1,Tmax
          xft1=ft1
          rat=D/xft1
          irat=rat
          del=abs(rat-irat)
          if(del.gt.0.001)go to 6
          ihalfrat=irat/2-1
           do 5 fs1=4,ihalfrat
           xfs1=fs1
           pin1=ft1*fs1
           cs=irat-fs1
           xcs=cs
           ct1max = (D - pin1)/cs -5
            do 4 ct1 = 1, ct1max
            xct1=ct1
            pout1 = pin1 + ct1 * cs
            T = ft1 + ct1 + (D - pout1)/xfs1
            if (T.gt.Tmax.or.T.gt.Trecord) go to 4 
             do 3 fs2 = 3, fs1-1
             xfs2=fs2
             pcc2 = (ft1 + ct1) * fs2
             pin2 = pcc2 + (pout1 - pcc2) * xfs2/(xfs2+xcs)
             if(posint(pin2).eq.0) go to 3
             ct2=(D-T*xfs2)/(xcs-xfs2)
             if(posint(ct2).eq.0)go to 3 
             pout2 = pin2 + ct2*cs
             if(pout2.gt.D)go to 3
             T2 = pin2/xfs2 + ct2 + (D - pout2)/xfs2
              do 2 fs3 = 2, fs2-1
              xfs3=fs3
              pcc3 = (pin2/xfs2 + ct2)*fs3
              pin3 = pcc3 + (pout2 - pcc3) * xfs3/(xfs3+xcs)
              if(posint(pin3).eq.0) go to 2 
              ct3=(D-T*xfs3)/(xcs-xfs3)
              if(posint(ct3).eq.0)go to 2
              pout3 = pin3 + ct3*cs
              if(pout3.gt.D)go to 2
              T3 = pin3/fs3 + ct3 + (D - pout3)/xfs3
               do 1 fs4 = 1, fs3-1
               xfs4=fs4 
               pcc4 = (pin3/xfs3 + ct3)*xfs4
               pin4 = pcc4 + (pout3 - pcc4) * xfs4/(xfs4+xcs)
               if(posint(pin4).eq.0) go to 1
               ct4=(D-T*xfs4)/(xcs-xfs4)
               if(nonneg(ct4).eq.0)go to 1
               pout4 = pin4 + ct4*cs
               if(pout4.gt.D)go to 1
               T4 = pin4/fs4 + ct4 + (D - pout4)/xfs4
                if(T.le.Trecord)then
c               print*,'T = ',T
                Trecord = T
                print 777, T,D,cs,ft1, 
        1       fs1,pcc1,pin1,xct1,pout1,
        2       fs2,pcc2,pin2, ct2,pout2,       
        3       fs3,pcc3,pin3, ct3,pout3,
        4       fs4,pcc4,pin4, ct4,pout4,T2,T3,T4
                
777             format(f4.1,x,i6,x,i5,x,i3,x,
        1       4 (i4,x,3(f7.1,x),f8.1,1x),3(i2,x)  )
                endif  


1               enddo
2              enddo
3            enddo
4           enddo
5          enddo
6         enddo
7        enddo
        end
        integer function posint(x)
        implicit none
        integer ix
        real x,del
        posint=0
        if(x.le.0)return
        ix=x
        del=abs(x-ix)
        if(del.gt.0.001)return
        posint=1
        return
        end
        integer function nonneg(x)
        implicit none
        integer ix
        real x,del
        nonneg=0
        if(x.lt.0)return
        ix=x
        del=abs(x-ix)
        if(del.gt.0.0000000001)return
        nonneg=1
        return
        end


Edited on August 3, 2020, 11:22 pm
  Posted by Steven Lord on 2019-04-24 21:40:38

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (15)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information