Shortest distance between any two places (use a direct road, or go via the warehouse W, whichever is shorter):
| A | B | C | D | W |
|---|
| A | – | 6 | 17 | 7 | 5 |
| B | 6 | – | 4 | 12 | 10 |
| C | 17 | 4 | – | 6 | 12 |
| D | 7 | 12 | 6 | – | 2 |
| W | 5 | 10 | 12 | 2 | – |
There is no direct road A–C or B–D, so those legs go through W: A–C=5+12=17, B–D=10+2=12. Where both a direct road and a via-W path exist, take the smaller — e.g. A–D is 8 direct but 7 via W, so we use 7.
The routing rule: start at W, visit the four places in decreasing order of demand; if two places are tied on demand, go to the one closest to where you are now; each leg is travelled by the shortest path above.
Demands (with probabilities): A =50(40%) or 70(60%); B =40(30%) or 60(70%); C =70(30%) or 100(70%); D =30(40%) or 50(60%).
Every one of the 16 possible demand-days, worked out:
| # | A | B | C | D | Visit order | Route | Distance | Ends at | Total widgets |
|---|
| 1 | 50 | 40 | 100 | 30 | C,A,B,D | W–C–A–B–D | 47 | D | 220 |
| 2 | 50 | 40 | 100 | 50 | C,D,A,B | W–C–D–A–B | 31 | B | 240 |
| 3 | 50 | 40 | 70 | 30 | C,A,B,D | W–C–A–B–D | 47 | D | 190 |
| 4 | 50 | 40 | 70 | 50 | C,D,A,B | W–C–D–A–B | 31 | B | 210 |
| 5 | 50 | 60 | 100 | 30 | C,B,A,D | W–C–B–A–D | 29 | D | 240 |
| 6 | 50 | 60 | 100 | 50 | C,B,A,D | W–C–B–A–D | 29 | D | 260 |
| 7 | 50 | 60 | 70 | 30 | C,B,A,D | W–C–B–A–D | 29 | D | 210 |
| 8 | 50 | 60 | 70 | 50 | C,B,A,D | W–C–B–A–D | 29 | D | 230 |
| 9 | 70 | 40 | 100 | 30 | C,A,B,D | W–C–A–B–D | 47 | D | 240 |
| 10 | 70 | 40 | 100 | 50 | C,A,D,B | W–C–A–D–B | 48 | B | 260 |
| 11 | 70 | 40 | 70 | 30 | A,C,B,D | W–A–C–B–D | 38 | D | 210 |
| 12 | 70 | 40 | 70 | 50 | A,C,D,B | W–A–C–D–B | 40 | B | 230 |
| 13 | 70 | 60 | 100 | 30 | C,A,B,D | W–C–A–B–D | 47 | D | 260 |
| 14 | 70 | 60 | 100 | 50 | C,A,B,D | W–C–A–B–D | 47 | D | 280 |
| 15 | 70 | 60 | 70 | 30 | A,C,B,D | W–A–C–B–D | 38 | D | 230 |
| 16 | 70 | 60 | 70 | 50 | A,C,B,D | W–A–C–B–D | 38 | D | 250 |
The one tie-break that matters most: when A and C are both 70 (top demand), A is nearer the warehouse (5<12), so A is visited first.
This question is conditional: given Ahmednagar is visited first, what is the chance the route is 40 km?
Ahmednagar is first only when A ties C at the top demand — that is A=70 and C=70 (combinations #11, #12, #15, #16). So
P(A first)=P(A=70)×P(C=70)=0.60×0.30=0.18.
Among those four, the distance is 40 km only in #12 (A=70, B=40, C=70, D=50), route W→A→C→D→B=5+17+6+12=40. Its chance is
0.60×0.30×0.30×0.60=0.0324.
The conditional probability is
0.180.0324=0.18=18%.
💡 Teacher tip: "Given A is first" means we only compare inside that world — divide by P(A first), don't use the full 16-day space.
Answer: 18%