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

Home > Probability
Hexagonal Spider Web (Posted on 2019-09-12) Difficulty: 4 of 5
A spider has its web in the shape of a regular hexagon. A fly is stuck to the web at a vertex that is diametrically opposite from the vertex at which the spider is. The spider can walk freely along the edges of the hexagon. At each vertex, it randomly chooses between walking on one of the two adjacent edges or staying at the vertex, all three choices with equal probability. If the time it takes to travel an edge is 5 seconds, while the waiting time at a vertex is 2 seconds, find the expected time it will take the spider to get to the fly?

Note: At the end of a waiting period at a vertex, a new random decision to stay at the vertex, or move along one of the two edges is made, with equal probability for the three choices.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
hmmmm | Comment 2 of 7 |
I ran a simulation and got 45 sec. rather than Larry's 54. His series does indeed sum to 54. 

I checked my sim, found a bug and fixed it. Cheers! Now I verify L's results.
Sim is below: power?

5

time per move, ave time  6.001   54.023

6

time per move, ave time  6.000   54.008

7

time per move, ave time  6.000   54.003 

   

program flym
           implicit none
      integer iseed,ibig,j,pos,m,tottime,totmoves,i,k
      real*8 t,tm
      print*,'power?'
1       read*,j
      if(j.eq.0)stop
      iseed=time8()
      call srand(iseed)
      ibig=10**j
      tottime=0
      totmoves=0
        do 2 i=1,ibig
        pos=0
              do k=1,1000
              m=3*rand()
                if(m.eq.0)then
                totmoves=totmoves+1
                pos=pos-1
                tottime=tottime+5
                if(pos.eq.-3)go to 2
                elseif(m.eq.1)then
                tottime=tottime+2
                elseif(m.eq.2)then
                totmoves=totmoves+1
                pos=pos+1
                tottime=tottime+5
                if(pos.eq.3)go to 2
                endif
              enddo
        print*,' more than 1000 moves! i,k ',i,k
        stop
2         enddo
      tm=(1.*tottime)/totmoves
      t=(1.*tottime)/ibig
      print*,'time per move, ave time ',tm,t
      go to 1
      end


Edited on September 12, 2019, 10:19 pm
  Posted by Steven Lord on 2019-09-12 10:46:56

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 (0)
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