The answer in the figure 1 is 1/3. The answer in Figure 2 is 1/2.
First of all, let me talk about my general idea.
When a worm passes through each node, it must consider the direction once. That is, it must be calculated once.
Figure 1. The first node has three paths. Then there are two roads with food. Both paths have nodes leading to food.
Therefore, the probability is1/3 *1/2 * 2 =1/3.
The same is true of fig. 2. The first node has two paths. One of them has food, and it must lead to food.
So, the probability is 1/2.