2D Random Walk and a Drunk Mathematician

July 9, 2021

The random walk is a way to create a path based on random decisions at junctions. If you’ve played a procedurally generated video game, including major examples like Minecraft and Stardew Valley as well as cult favorites like Spelunky and Dwarf Fortress, you’ve encountered a random walk in the form of a dungeon or terrain made this way in the programming. More @ Popular Mechanics

2D Random Walk math helps game programmers to plot interesting pathways in games like Minecraft Dungeons. (above)

Plot a 2D Random Walk

There are 4 choices:


Note: This 2D random walk is limited to a 1-unit step length and right angles turns.

Set the Random Number Spinner here to 4 and generate 8 random moves of 1 unit and plot the moves on the worksheet(below).

1  up

2  down

3  right

4  left

Printable Worksheet: 2D Random Walk Worksheet

Here are 5 X 8 step 2D Random Walks.

These 2D Random Walks do not look like the path taken by a drunk mathematician.

Drunken Mathematician 

This looks like a drunken mathematician and the 2D Random Walk for a drunk mathematician would look like pathways shown below with variable step lengths and turns from 0-360°.

All Random Walks can be mathematically modeled. eg. Go to MIT here. This math can be quite complicated (See here.) But all we want to do is plot the 2D Random Walk to see random numbers in action.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: