Odds to be caught by the police
Robbers want to travel from city T to city E
Routes represents time to travel from one city to another
Police represents the presence of police at some city at some day
Fuel represents the initial quantity of fuel
Countdown is the max number of elapsed time to reach city E.
Whenever Robbers stop at a city where the police is staying the probability to get caught is proba = 1/10 + 9/10^2 + ... + 9^k-1/10^k
where k is the number of time they met or robbers stop to refill fuel.
Robbers can refill one unit per day at any city
The aim of the exercise is to compute the probability to escape
Example :
{
"fuel": 6,
"countdown": 7,
"police": [
{"city": "H", "day": 6 },
{"city": "H", "day": 7 },
{"city": "H", "day": 8 }
]
"routes": [
{"origin": "T", "destination": "D", "travelTime": 6 },
{"origin": "D", "destination": "E", "travelTime": 4 },
{"origin": "D", "destination": "H", "travelTime": 1 },
{"origin": "H", "destination": "E", "travelTime": 1 },
{"origin": "T", "destination": "H", "travelTime": 6 }
}
Odds = 0 (Cant go from T to E in 7 days)
{
"fuel": 6,
"countdown": 8,
"police": [
{"city": "H", "day": 6 },
{"city": "H", "day": 7 },
{"city": "H", "day": 8 }
]
"routes": [
{"origin": "T", "destination": "D", "travelTime": 6 },
{"origin": "D", "destination": "E", "travelTime": 4 },
{"origin": "D", "destination": "H", "travelTime": 1 },
{"origin": "H", "destination": "E", "travelTime": 1 },
{"origin": "T", "destination": "H", "travelTime": 6 }
}
Odds = 1-0.1 -(9/100) = 0.81
T->H (fuel 0,Day 6) 10% being captured
H (refill) (fuel 1 , Day7) 9/100 being captured
H - > E (Day8) Youpiii !
Can you help with this please ?