Recently I came across an interesting C puzzle: We have a network with N nodes and M edges. Each node contains some number of packets. Initially, node i contains ai number of packets. At every time step, each packet randomly chooses one of it's neighboring neighbor and moves to it. We have to find out number of packets at every node after K time steps.
The main problem i'm facing in this problem is how to use probability. The word "randomly" is quite confusing and doesn't suggest any logic to me. Can anyone please help?