## Ever been really really drunk…? Made a fool of yourself..? Here’s a strategy for U if you need to run…

Continuing my experiments with Python’s various mathematical, statistical and scientific libraries, I decided to do a simulation of the Drunkard’s Walk, using different probability distributions.

Unless you’ve ever been in that totally intoxicated situation where your vision is blurred, your brains has stopped working, each step you take is random in both direction and length,  and you don’t know which way to go to get home, you might want to stop reading, but for the rest of us, particularly those of us who really enjoy Jura Whisky (bloody Scotchmen!:-), what follows might be of interest… 🙂

The purpose of the exercise is to find out, with scientific evidence,  which strategy pays best  to escape after a wild evening in town with your best friends, with lots of booze (or whatever your favorite drug is… 🙂

So, recognizing the situation above, I decided to do a simulation for it.  Actually, three different simulations, based on three different probability distributions:

• Normal Distribution
• Uniform Distribution
• Cauchy Distribution

The basic idea with the simulation is that you find yourself located at position (0,0), and you want to get home, but first and foremost to make some distance from your current position, ideally but not necessarily towards your home position.  Because people from the bar are after you and you need to get to the h*ell out of where you are… 🙂

Since you are completely s*itfaced by all the booze you’ve been consuming, and your logic processing capacity is nil, you eventually come to the conclusion that your best option is to perform a random walk. The question is, which type of random walk would you choose…? Your secondary objective is to get home, but your primary objective, given that angry people are after you,  is to make as much distance as possible to your current, ‘partying’ location, since you’ve managed to upset a lot of people….

So, let’s run a simulation, with three different types of strategies for ‘escaping’: first strategy based on the normal distribution, second on the uniform distribution, and the third on Cauchy distribution.

The first strategy is based on normal distribution, that is, your choice of your nex (x,y) cordinates is based on the normal distribution.

Your second strategy is based on the Uniform distribution, meaning that each choice of a new  (x,y) value have equal probability.

And your third strategy, the one you believe would be the best, is to base your escape on the Cauchy distribution, to get as far away from your current position as possible, as quickly as possible.

The below chart shows what the Drunkard’s walk will look like in each of these three cases:

In the graphs above, the red spots show the starting and finishing points.

Contrary to intuition, it’s not the wild randomness Cauchy distribution that takes you as far way as possible from your origin, your party point – instead, it’s the uniform distribution, i.e. the one where you at each corner have an equal probability to turn left or right, and an equal probability for the speed you will use, that will take you farthest away from your current position. Obviously, if your target is to get home, none of these strategies will be of help, but if your target is to escape from all the people you’ve upset during the party, you might want to go with the uniform distribution… 🙂

[Did anyone spot the flaw in the conclusion that Uniform distribution gets you furthest away from your starting point…? The devil is in the details – look at the scales of the different graphs… they are different, which means that although it seems that Uniform allows you to make most distance, it is in fact Cauchy that does so, but due to the different scales it appears opposite. ]

High tech industry veteran, avid hacker reluctantly transformed to mgmt consultant.
This entry was posted in development, Math, software and tagged , , , , , . Bookmark the permalink.

### 3 Responses to Ever been really really drunk…? Made a fool of yourself..? Here’s a strategy for U if you need to run…

1. Helen says:

Hi,
I am a student that has found your blog by chance. I was wondering what settings or relationship between the parameters of the distributions you used to make them comparable. I would like to find a relationship between the mean and variance of the normal distribution and the parameters of the Cauchy, and also between the Cauchy and the Uniform.
I would appreciate any help or reference.

Thank you!! Your blog is amazing!

2. Helen says:

Thank you very much!!!!!