Say I have a directed graph with no cycles like this one.
And say someone travels along it choosing a random edge to go down at every node. We know that the person walking starts from node 0 and is going to end up in node 8.
Is there a way to figure what the likelihood of this person going through a certain node is? For instance we know that they are going through node 3 2/3 of the time as the starting node only has 3 options and 2 of them goes through node 3.
But is there a way to know the likelihood of them going through a more inner node like 7? I thought maybe if we knew how many possible paths exists and how many of those go through node 7 we could divide them and get the answer. But now I don't think that'll work since not all paths are equally likely.
Any help would be appreciated. Thanks!
Funny, I went through the exact same thought process! Yes, I first thought of counting just the number of paths as well, but you're right, not all paths are equally likely. OK, so then just compute the probability of getting to a node by computing the probability of getting to any of its predecessors, and multiplying that by the probability of following the edge from that predecessor to the node in question. The image below shows the results (green means the probability of taking the edge, while red means the probability of getting to the node):
Just as an example: the probability of going through node $7$ is the probability of going through either of nodes 4, 5, or 6, respectively multiplied by the probability of taking the edge from that node to node $7$. Thus:
$$P(7) = P(4)\cdot \frac{1}{3}+P(5)\cdot \frac{1}{2}+P(6)\cdot \frac{1}{2} = \frac{2}{9}\cdot \frac{1}{3}+\frac{8}{27}\cdot \frac{1}{2}+\frac{19}{27}\cdot \frac{1}{2}=\bbox[yellow]{\frac{31}{54}}$$
Also, just for a sanity check, let's make sure the probability of getting to node $8$ is $1$:
$$P(8)=P(4)\cdot \frac{1}{3}+P(6)\cdot \frac{1}{2}+P(7)\cdot 1 =\frac{2}{9}\cdot \frac{1}{3}+\frac{19}{27}\cdot \frac{1}{2}+\frac{31}{54}\cdot 1 = \frac{4+19+31}{54} = 1$$ Yay!