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

Home > Probability
Mark's itinerary (Posted on 2016-05-26) Difficulty: 3 of 5
A certain salesman, called Mark O.V. delivers his goods to three cities: C1, C2, & C3, staying only for one day at a time in each of them.
His stay in C1 is always followed by going next to C2. If he delivers in either C2 or C3 he is thrice as likely to continue to C1, than to the other city.

Provide your estimate of the number of working days in each of the cities
within a period of 12,000 working days.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Analytic + Simulation + Probabilistic | Comment 1 of 5
Between occurrences of C1, there can be any number of alternations between C2 and C3, starting of course with C2, but ending with either C2 or C3.

After a visit to C1, each successive city has a 3/4 chance of returning to C1. So the probability is 3/4 that the duration out of C1 is 1 day, and 3 / 4^2 that the duration is 2 days, etc.

So the expected length of time between C1 visits is

t = 3/4 + 2*3 / 4^2 + 3*3 / 4^3 + ...
4*t = 3 + 2*3 / 4 + 3*3 / 4^2 + 4*3 / 4^3 + ...

3*t = 3 + (6-3)/4 + (9-6) / 4^2 + (12-9) / 4/^3 + ...
t = 1 + 1/4 + 1/4^2 + 1/4^3 + ...

4*t = 4 + 1 + 1/4 + 1/4^2 + ...
    = 4 + t
    
3*t = 4    
t = 4/3

Mark spends 1 day out of every 7/3 days in C1 or 3/7 of his days.

Each excursion out of C1 starts with C2, and 3/4 of such an excursion ends right after that first such visit.

Finding the expected total duration at C2 during one outing from C1:

d = 1 + 1/4^2 + 1/4^4 + 1/4^6 + ...
16*d = 16 + d

15*d = 16

d = 16/15

Since such an excursion starts once every 7/3 days on average (i.e., 3/7 of days), Mark spends (3/7)*(16/15) of his days at C2. Reduced, that's 16/35.

That leaves 1 - 3/7 - 16/35 = 4/35 of Mark's days at C3.

Simulation verification:

DefDbl A-Z
Dim crlf$, city(3)


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 c = 1
 For i = 1 To 10000
    city(c) = city(c) + 1
    Select Case c
      Case 1
        c = 2
      Case 2, 3
        If Rnd(1) < 0.75 Then
          c = 1
        Else
          c = 5 - c
        End If
    End Select
 Next
 
 For i = 1 To 3
   Text1.Text = Text1.Text & Str(city(i))
 Next
 Text1.Text = Text1.Text & crlf
 
 For i = 1 To 3
   Text1.Text = Text1.Text & Str(city(i) * 35 / 10000)
 Next
 Text1.Text = Text1.Text & crlf
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub

results in raw counts of

 4282 4574 1144

for days out of 10,000 spent and each respective city.

When the fraction out of 10,000 is multiplied by 35 the numbers are:
 
 14.987 16.009 4.004
 
in agreement with the number of 35ths found analytically.

The answers:

15/35 * 12,000 ~= 5143
16/35 * 12,000 ~= 5486
 4/35 * 12,000 ~= 1371

Probabilistically verifying the ratios:

If, at generation zero, Mr. Markov started out, arbitrarily, in C1, and follow the probabilities in a Quantum multiverse (or actually 35 such quantum universes within the multiverse), in city 1. We follow these 35 Schrodinger's Marks and see what how many of them, including fractionated Marks are in each city, we find to the limit of our computer's precision that after 123 generations 15 are in city A, 16 in city B and 4 in city C. That is, the Markov chain also imitates the probability that on any given day Mark O.V. is in the given cities proportionally.

Days after day 0:

1  0 35 0
2  26.25 0 8.75
3  6.5625 28.4375 0
4  21.328125 6.5625 7.109375
5  10.25390625 23.10546875 1.640625
6  18.5595703125 10.6640625 5.7763671875
7  12.330322265625 20.003662109375 2.666015625
8  17.0022583007813 12.996826171875 5.00091552734375
9  13.4983062744141 18.2524871826172 3.24920654296875
10  16.1262702941895 14.3106079101563 4.5631217956543
11  14.1552972793579 17.267050743103 3.57765197753906
12  15.6335270404816 15.0497102737427 4.31676268577576
13  14.5248547196388 16.7127177119255 3.76242756843567
14  15.3563589602709 15.4654616117477 4.17817942798138
15  14.7327307797968 16.4009038172662 3.86636540293694
16  15.2004519151524 15.6993221305311 4.10022595431656
17  14.8496610636357 16.2255084037315 3.92483053263277
18  15.1127542022732 15.8308686967939 4.05637710093288
19  14.9154343482951 16.1268484775064 3.95771717419848
20  15.0634242387787 15.9048636418447 4.03171211937661
21  14.952431820916 16.0713522686228 3.97621591046118
22  15.035676134313 15.9464857985313 4.01783806715571
23  14.9732428992652 16.0401356511019 3.98662144963282
24  15.0200678255511 15.9698982616734 4.01003391277548
25  14.9849491308367 16.0225763037449 3.99247456541836
26  15.0112881518725 15.9830677721913 4.00564407593623
27  14.9915338860956 16.0126991708565 3.99576694304782
28  15.0063495854283 15.9904756218576 4.00317479271413
29  14.9952378109288 16.0071432836068 3.9976189054644
30  15.0035716418034 15.9946425372949 4.0017858209017
31  14.9973212686475 16.0040180970288 3.99866063432373
32  15.0020090485144 15.9969864272284 4.00100452425721
33  14.9984932136142 16.0022601795787 3.9992466068071
34  15.0011300897894 15.998304865316 4.00056504489468
35  14.999152432658 16.001271351013 3.99957621632899
36  15.0006356755065 15.9990464867402 4.00031783775326
37  14.9995232433701 16.0007151349448 3.99976162168506
38  15.0003575674724 15.9994636487914 4.00017878373621
39  14.9997318243957 16.0004022634065 3.99986591219785
40  15.0002011317032 15.9996983024452 4.00010056585162
41  14.9998491512226 16.0002262731661 3.99992457561129
42  15.0001131365831 15.9998302951254 4.00005656829153
43  14.9999151475627 16.000127278656 3.99995757378135
44  15.000063639328 15.999904541008 4.00003181966399
45  14.999952270504 16.000071594244 3.99997613525201
46  15.000035797122 15.999946304317 4.00001789856099
47  14.9999731521585 16.0000402717622 3.99998657607925
48  15.0000201358811 15.9999697961783 4.00001006794056
49  14.9999848980892 16.0000226528663 3.99999244904458
50  15.0000113264331 15.9999830103503 4.00000566321656
51  14.9999915051752 16.0000127422373 3.99999575258758
52  15.0000063711186 15.999990443322 4.00000318555932
53  14.999995221661 16.0000071675085 3.99999761083051
54  15.0000035837542 15.9999946243687 4.00000179187712
55  14.9999973121843 16.0000040317235 3.99999865609216
56  15.0000020158618 15.9999969762074 4.00000100793088
57  14.9999984881037 16.0000022678445 3.99999924405184
58  15.0000011339222 15.9999982991166 4.00000056696112
59  14.9999991495583 16.0000012756625 3.99999957477916
60  15.0000006378313 15.9999990432531 4.00000031891563
61  14.9999995216266 16.0000007175602 3.99999976081328
62  15.0000003587801 15.9999994618299 4.00000017939004
63  14.9999997309149 16.0000004036276 3.99999986545747
64  15.0000002018138 15.9999996972793 4.0000001009069
65  14.9999998486397 16.0000002270405 3.99999992431983
66  15.0000001135203 15.9999998297196 4.00000005676013
67  14.9999999148598 16.0000001277103 3.9999999574299
68  15.0000000638551 15.9999999042173 4.00000003192757
69  14.9999999521086 16.000000071837 3.99999997605432
70  15.0000000359185 15.9999999461222 4.00000001795926
71  14.9999999730611 16.0000000404083 3.99999998653056
72  15.0000000202042 15.9999999696938 4.00000001010208
73  14.9999999848469 16.0000000227297 3.99999999242344
74  15.0000000113648 15.9999999829527 4.00000000568242
75  14.9999999914764 16.0000000127855 3.99999999573818
76  15.0000000063927 15.9999999904109 4.00000000319636
77  14.9999999952055 16.0000000071918 3.99999999760273
78  15.0000000035959 15.9999999946061 4.00000000179795
79  14.9999999973031 16.0000000040454 3.99999999865154
80  15.0000000020227 15.999999996966 4.00000000101135
81  14.999999998483 16.0000000022755 3.99999999924149
82  15.0000000011378 15.9999999982934 4.00000000056888
83  14.9999999991467 16.00000000128 3.99999999957334
84  15.00000000064 15.99999999904 4.00000000032
85  14.99999999952 16.00000000072 3.99999999976
86  15.00000000036 15.99999999946 4.00000000018
87  14.99999999973 16.000000000405 3.999999999865
88  15.0000000002025 15.9999999996963 4.00000000010125
89  14.9999999998481 16.0000000002278 3.99999999992406
90  15.0000000001139 15.9999999998291 4.00000000005695
91  14.9999999999146 16.0000000001281 3.99999999995729
92  15.0000000000641 15.9999999999039 4.00000000003204
93  14.9999999999519 16.0000000000721 3.99999999997597
94  15.000000000036 15.9999999999459 4.00000000001802
95  14.999999999973 16.0000000000405 3.99999999998649
96  15.0000000000203 15.9999999999696 4.00000000001014
97  14.9999999999848 16.0000000000228 3.9999999999924
98  15.0000000000114 15.9999999999829 4.0000000000057
99  14.9999999999915 16.0000000000128 3.99999999999572
100  15.0000000000064 15.9999999999904 4.00000000000321
101  14.9999999999952 16.0000000000072 3.9999999999976
102  15.0000000000036 15.9999999999946 4.00000000000181
103  14.9999999999973 16.0000000000041 3.99999999999865
104  15.000000000002 15.999999999997 4.00000000000102
105  14.9999999999985 16.0000000000023 3.99999999999924
106  15.0000000000011 15.9999999999983 4.00000000000057
107  14.9999999999991 16.0000000000013 3.99999999999957
108  15.0000000000006 15.999999999999 4.00000000000032
109  14.9999999999995 16.0000000000007 3.99999999999976
110  15.0000000000004 15.9999999999995 4.00000000000018
111  14.9999999999997 16.0000000000004 3.99999999999987
112  15.0000000000002 15.9999999999997 4.0000000000001
113  14.9999999999999 16.0000000000002 3.99999999999992
114  15.0000000000001 15.9999999999998 4.00000000000006
115  14.9999999999999 16.0000000000001 3.99999999999996
116  15.0000000000001 15.9999999999999 4.00000000000003
117  15 16.0000000000001 3.99999999999998
118  15 15.9999999999999 4.00000000000002
119  15 16 3.99999999999999
120  15 16 4.00000000000001
121  15 16 3.99999999999999
122  15 16 4.00000000000001
123  15 16 4
124  15 16 4
125  15 16 4
126  15 16 4
127  15 16 4
128  15 16 4
129  15 16 4
130  15 16 4
131  15 16 4
132  15 16 4
133  15 16 4

DefDbl A-Z
Dim crlf$, city(1, 3)


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 city(0, 1) = 1
 For i = 1 To 150
   DoEvents
   city(1, 2) = city(0, 1) + city(0, 3) / 4
   city(1, 3) = city(0, 2) / 4
   city(1, 1) = 3 * (city(0, 2) + city(0, 3)) / 4
   Text1.Text = Text1.Text & i & " "
   For j = 1 To 3
     city(0, j) = city(1, j)
     Text1.Text = Text1.Text & Str(city(0, j) * 35)
   Next
   Text1.Text = Text1.Text & crlf
 Next

 Text1.Text = Text1.Text & crlf
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub


  Posted by Charlie on 2016-05-26 14:22:24
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