# Traffic Lights

Have you ever wondered what the probability is of making it through a sequence of traffic lights without stopping? Me neither. But some people do so let’s try and solve that problem. It’s something that appears in everyday life for example my walk from home to DroneDeploy taken me through 16 traffic lights.

Let’s say we begin at position `X=0`

at time `T`

in seconds and start walking as `1`

meter per second right. Let’s say `T`

is uniformly randomly distributed in the range `[0, 1e100]`

to account for all manner of late starts. Then let’s say there are `N`

traffic lines as positions `X1, X2, … ,XN`

for each of these they are red for `Ri`

seconds, then green for `Gi`

seconds after which they repeat their cycles. At time `T= 0`

all traffic lights have just turned red. So givens the lists or `X`

, `R`

and `G`

let’s try and compute the probability that we hit each of the red lights and thus the probability that...