Conversation

A RNG problem. I'm trying to uniformly sample paths on an SW --> NE grid, of size NS > EW, via random walk. So I generate a random number between 0 and 1 and go east if r < EW/(NS+EW)... but this seems to create a bias towards denser sampling of latter half of path
Image
3
8
I have to verify this, but I think what's causing this is that limits saturate suddenly. The bias against each direction should increase gradually as you approach the limit or something
1
Ah I think I have it. Using Matt's algorithm here, you'd get a pointwise entry/exit path counts, and you would toss the coin to actually reflect the number of paths in each direction to generate a uniform sampling of all paths.
Quote Tweet
Replying to @fiddlemath and @vgr
So, If you're travelling from bottom-left to top-right, first write a 1 in each leftmost and bottommost intersection, then for each empty cell, fill in the sum of the cell to the left and the cell below. Iterate all the way to the top.