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.
(In reply to
my solution by Charlie)
I wrote my own simulation in VB, and it disconfirms my answer, and confirms the 54 seconds found by others:
DefDbl A-Z
Dim crlf$
Private Sub Command1_Click()
Randomize Timer
t = 0
For trial = 1 To 10000
psn = 3
Do
r = Int(3 * Rnd())
Select Case r
Case 0
t = t + 2
Case 1
t = t + 5
psn = psn + 1: If psn = 6 Then psn = 0
Case 2
t = t + 5
psn = psn - 1: If psn = 6 Then psn = 0
End Select
Loop Until psn = 0
Next
Text1.Text = Text1.Text & t / 10000 & crlf
End Sub
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
Text1.Text = Text1.Text & ct & " done"
DoEvents
End Sub
Some results of pressing the command button:
53.6584
54.6874
53.9702
54.4232
53.952
53.8928
53.7086
54.1006
53.8418
54.3884
53.6232
54.4604
53.8686
52.8786
54.296
54.2954
53.7354
53.8378
53.4062
53.666
53.574
|
Posted by Charlie
on 2019-09-12 19:03:28 |