pronto is giving bicycles an opportunity like never before - a chance to see all of what seattle has to offer!
presentation notes: it gets a little math-y here and there. to see the details, click the up and down arrows when you see them!
pete is a pronto bike in seattle. he has a step-through frame, an adjustable seat post, and a wanderlust for the emerald city!
pete wants to go everywhere, but there are 3 things he's most excited to do:
lets say that any time pete goes for a ride, he is equally likely to go anywhere in the city.
what could pete do with this knowledge?
how long will it take pete to go to the aquarium, then the space needle, then the pier if he starts of at the frye museum
if pete wants to go to the space needle next, it'll take an average of 53 more rides to get to there. that's 106 total!
on average, its going to take pete 53 rides to get to the aquarium from the Frye
now to finish his trip, it'll typically take an average of 53 more rides for a total of 159 rides just to get to three places!
what if pete wants to see the whole city and he doesn't mind what order he sees the sights? it'll take him 248 trips to get around town!
we can use the random variable X to represent the number of bernoulli trials necessary to reach the aquarium
Thus the expected number of rides necessary to reach the aquarium is 53
The expectation of the three trips is, by linearity, equal to the sum of each expected value (53)
pronto pete doesn't travel at random...he goes where you want to go!
instead of having a probability of going from one node to another of 1/53, we have to include the probability of a rider wanting to take a ride.
we make a matrix that shows all of the "transition" probabilities based on the past year of pronto rentals. that is, the probability of going from one rental station to the next.
a city map demonstrating the probabilities when starting at 3rd and broad is shown to the right.
an interactive version of this transition matrix is available at
how long will it take pete to get to the aquarium now?
probability of going directly to the aquarium: 0.0069
for every 1,000 rides pete takes from the museum, he ends up at the aquarium about 7 times!
the average number of rides it'll take Pete to get visit the sharks: 32
for a markov chain, a state j is an absorbing state is one that you never leave once entered. that is, the jth entry of the jth row is equal to 1. we redefine our markov chain to make the desired state absorbing, so once we've reached the statation we stop calculating!
call the number of steps necessary to reach the desired station from the ith station.
then we can calculate the expected value of using the following formula:
let be the vector repesenting the expected number of steps necessary to reach the abosorbing state
then we can factor and we have
by removing the absorbing state from the matrix we now have a solution for the vector
this gives the expected number of steps to j from any other station
how long will it take to travel to three locations if it doesn't matter what order pete travels?
this is a much more difficult thing for pete to calculate. imagine pronto only has 3 stops, the frye museum, the aquarium, and pier 69.
if we started from pier 69, the probability of the trip happening is so unlikely that pete will probably be biking forever before he sees all three
an alphabet is a finite set of symbols
a word is a finite sequence of symbols over an alphabet
the kleene closure is the set of all words of any length (up to infinity) over a set v including the empty string
While the problem of reaching a vertex is solvable using the geometric distribution when restricted to two vertices, the problem becomes significantly more complex when considering the case of three vertices.
Consider the structure shown above with the probabilities as defined.
identifying all possible paths becomes an interesting task as the number of vertices increases, as bicycles can return to the same location or backtrack along a path.
consider paths going from pier 69 to the frye museum and the seattle aquarium and terminating once all three have been visited as words.
the alphabet for the words is
then there are 4 possible languages starting at the pier and visiting both the aquarium and the museum
By assigning probabilities to each transition and including infinite sums for the Kleene closures, we can calculate
but with these probabilities, the series is divergent
you'd think the aquarium, the frye museum, and a trip to british columbia would tire pete out - especially with the infinite trips, but he's ready to take a class at uw, take a selfie at the first starbucks, and really see what the city has to offer him
but calculations here are too big...we run into a lot of infinities...
we simulated more than 10000 bikes and recorded the stops they visited at
to see how many of them got to see all the stations
for the 1000 step rides, pete made it to all of the stations 0.056% of the time. that's a little more than once every 2000000 steps!
for 10000 step rides, pete made it to all of the stations 0.51% of the time.
this is the shortest simulation that was built. the probability of this exact trip happening again is so unlikely pete doesn't even want to think about it!
what a trip!
pronto pete is so jealous!