Graph question (PLEASE HELP) - Google, Microsoft, Apple
Anonymous User
2259

Hello guys, I recently came across this question usually appearing in top companies. Please help out. Python solutions are preferred though others are appreciated as well..:

When put on a node on a directed graph the grasshopper will pick an outgoing edge at random and jump over it to the target node over the edge and repeat. All edges have equal probability. Each jump takes the grasshopper one second. If there are no outbound edges the grasshopper is trapped in the node forever. What is the expected average probability of finding a grasshopper at each node of the graph after a longtime has passed.

Comments (5)