Real Mathematics – Life vs. Maths #6


The word itself sounds like a taxi application for smart phones, and that is not a bad metaphor for its true meaning: Chemotaxis is the movement of cells (or organisms) towards a source of a chemical gradient. This chemical gradient could either be good for the organism or bad for it.

If there is a chemical gradient in an environment that is good for the organism, it would move towards that environment. If the chemical gradient is bad for the organism’s life, it would move away from that environment. These movements are called Chemotaxis.

According to the illustrations red matter is bad, blue is good for the organism.

Random Path

In the previous article I talked about one-dimensional biased random walks. Now let’s use all our knowledge to create a two-dimensional biased random walk.

There were four possible outcomes for two-dimensional random walk: Up, down, right and left. Each and every one of these outcomes has the same probability that is ¼. That means taking one step in any of those directions have the same probability. In order to create a two-dimensional biased random walk let us keep the probabilities same but change the number of steps taken for right and upward directions.

Up: ¼ probability, 2 steps.

Down: ¼ probability, 1 step.

Right: ¼ probability, 2 steps.

Left: ¼ probability, 1 step.

This change will give biased results. If one would take N random steps under these conditions, that person will likely end up at a point which is located up-right hand side of the origin:

To illustrate a two-dimensional biased random walk I rolled a 12-sided dice 10 times (1-2-3 upwards, 4-5-6 downwards, 7-8-9 right, 10-11-12 left).

As seen in the pictures a two-dimensional biased random walk and Chemotaxis are essentially same with one another. If there was a food source for an organism on the up-right hand side of the origin, that organism would make movements as shown in the picture.

Now let’s analyze these illustrations:

On left we are looking at a random walk of an organism without any chemical presence in the environment. On right blue dots are food sources for the organism, which is why the organism is moving randomly towards where those blue dots are dense. If the food source is denser on the up-right, organism will make random movements towards that area.

This is a real life example for the biased random walk. Let’s get more real though.

Dive and Tumble

E. coli is a type of bacteria that could be fatal in some cases. Sugar is one of its main nutritional sources. This is why E. coli bacteria choose to move randomly towards areas where there is sugar. This makes E. coli a biased random walker.


There are organelles that look like whips on E. coli bacterium. These organelles (or propellers) help E. coli to move in two ways. Whenever these propellers are lined in the clockwise direction, they make bacteria to move forward, like swimming or diving. And whenever the propellers rotate counter-clockwise direction the bacteria makes a tumble that helps to change direction. Hence we call the two fundamental movements of E. coli dive and tumble.

E. coli uses dive and tumble in order to survive, and these movements are in fact biased random walks.

E. coli bacteria will always make random movements toward the sugar if there is some in an environment.


Even one-cell organisms that have no brains use mathematics for their survival.

Then, how is it still possible to see the smartest known creatures (humans) claim that they don’t need mathematics in their lives?

Human beings must use mathematics in order to understand the events that are occurring around them. Because mathematics is the only language we use for to explain those events.

Now that you are aware of this fact, try to find the mathematics behind the things that are happening around you. (Mighty Google at work!) Don’t hesitate to contact me in case you have questions. I’ll be glad to assist you.

For Those Interested In Random Walks: Random Walks in Nature

Brownian Motion: It is the random movement of particles in a fluid that are colliding with other atoms/molecules inside the very same fluid.

Robert Brown is the first person whom observed this sort of movement. In 1827, he was working with pollens and he observed that they are constantly and randomly moving inside the water. But he was not able to explain the reason behind the movement. It was Albert Einstein whom explained this phenomenon in one of his 1905 papers. (Click here to see Brownian movement.)


One of the easiest and most observable real life examples for Brownian motion is the movements of dust particles. Try it with some light in a dark room; you will be mesmerized with their random dance. The reason behind this movement is that the dust particles are actually colliding with invisible air atom&/molecules. You could imagine dust particles as ping pong and air molecules as racket. As you can see Brownian motion can be observed both in liquid and in gas.

M. Serkan Kalaycıoğlu

Real Mathematics – Life vs. Maths #5

Drunkard’s Way Back Home

Finally we are back with Steve the accountant. So far I’ve talked about one dimensional random walk in order to understand drunkard’s walk. Although we are all aware of the fact that right and left are not the only options when we take a walk.

That is why Steve’s walk should be thought in two dimensions.

There are four choices of movement in a two-dimensional plane: Right, left, up and down. They all have same probability (just like in one dimension). It is ¼. These four directions are familiar to us as we already learned about Cartesian coordinates. In the end Steve’s walk turned out to be a walk in Cartesian coordinates. Let me choose origin of the coordinate system as Steve’s starting point. For the first random step there will be these four options:

To facilitate Steve the accountant’s walk, one could use a 12-sided dice. When it is thrown:

Take your step upwards for 1-2-3,

take your step downwards for 4-5-6,

take your step to right for 7-8-9,

and take your step to left for 10-11-12.


Q: How far from the starting point one would be after taking N random steps in a two-dimensional plane?

Answer to this question is same with one-dimensional random walk: After N random steps in two dimensions, one would be √N steps away from the starting point. That is same as imagining a circle that has its center at the origin (starting point) and has the radius √N. A two-dimensional random walk would likely end in this circle.

After taking 20 steps, one would be in this area. (I took √20 as 5.)

Recall that for one-dimensional random walks we found three conclusions. Third one was saying that we are likely to be back to the starting point if N is large enough of a number. Same conclusion can be made for two-dimensional random walks too; the more steps we take, the most likely we would be close to the starting point.

“A drunkard will find his way home, but a drunken bird may get lost forever.”

Shizou Kakutani

This result shows that Steve the accountant will likely make circles and return to his starting point. But he will eventually reach his home.

Let me take this one step further: If Steve the accountant’s walk is long enough he would have visited all the streets in his neighborhood. This is why we say two-dimensional random walks are recurrent just like one-dimensional ones. But if we go into three dimensions, things change. A three-dimensional random walk is not recurrent which is why it is possible to get lost in 3-D.

If Steve was taking his walk in this district, he would visit each and every street if his walk is long enough.

Biased Random Walk

We already know that in one-dimensional random walk there are two choices with equal probabilities: Right (1/2) and left (1/2).

Q: How can we find a one-dimensional random walk that is biased?

For such a random walk I can keep the probabilities of right or left unchanged. But I’ll arrange the number of steps taken. What I mean is that whenever we get a right; let’s take two steps instead of one but for a left we continue to take one step. Outcome used to be +1 or -1 for a step. Now it is either +2 or -1.

This is how a biased one-dimensional random walk can be created.

The reason this random walk is biased is that after taking N random steps, one will most likely be on the right side of the starting point. We can test that with a coin toss like we did in previous articles: Tails are +2, heads are -1.

After 10 coin tosses my path turned out to be as follows:

One wonders…

You make your own experiment with a coin and compare your results.

Ps. It is not over yet. To be continued…

M. Serkan Kalaycıoğlu

Real Mathematics – Life vs. Maths #4

Where am I?

Mathematicians love to make generalizations. Personally I don’t enjoy that either, but generalizations are very useful in case you’d like to make some mathematical magic. Is there anything cooler than magic?!

Let’s assume (beware of the generalization that is coming towards you) that we had taken N random steps in one dimension. Even though it is very small there still is a possibility that those steps could well be taken into the right hand side (or left). That would have meant that after N random steps, we are standing at +N (or –N). In this case we understand that we are N steps away from the starting point.


If we take half of the N random steps to the right, and other half to the left hand side we would be standing right on the starting point. In that case we would be 0 steps away from the starting point.


These two scenarios are the furthest (N steps) and closest (0 steps) destinations to the starting point after N random steps are taken. Thus, we are finally aware of the fact that after N random steps in one dimension, we have to stop at 0 to N steps away from the starting point.

Q: Is there an algorithm to find out how far we would be to our starting point even before we take a certain number of random steps in one dimension?

For N random steps the answer is the square root of N. For instance if we take 100 random steps in one dimension, we would be √100 = +/- 10 steps away from the starting point.

Click here to learn why it is so.

Now you are wondering: Where and how can we use this information in life?

Place of The Basketball Team

There are 16 teams participating in the Euroleague, which is the most prestigious tournament of Europe. In the regular season of the Euroleague teams get to play with one another twice. In the end of the regular season top 8 teams advance into the playoffs where champion of the season is decided.

2018-19 regular season is still underway.

Let’s assume that you are supporting a team that is average which means your team would like to fight for the top 8 positions. Just before the season starts you look at the calendar and try to guess how many games your team could win in order to stay in this fight: “If we beat Barcelona at home, and Darüşşafaka on both games…”

You really don’t have to do that. Obviously I will show you how you can use mathematics in order to guess how many wins your team should get.

There are two possible outcomes for a basketball game: Win or lose. It doesn’t matter how strong your opponent is, a game will have two outcomes whatsoever.

Similarities with Random Walks

In one dimension we know that there are two outcomes for a random walk: Right or left. And this is why basketball games can be treated as a random one dimensional walk.

In the regular season each team will play 15×2=30 games. This is same as taking 30 random steps in one dimension.

Then the difference between win and loss column after 30 games can be calculated with taking square root of 30.

√30 = 5,47…

We will call it 6 games. Outcome of these 6 games depend on luck. Your team can win or lose each and every one of them. It proves that after 30 games you either won 6 games more than you lost, or you lost 6 games more than you won:



This information we found using one dimensional random walks tells us that if a team wins between 18 to 12 games in the regular season, that team will be fighting for the playoff positions.


These pictures show how two previous regular seasons ended in the Euroleague. As you can see teams that won between 18 to 12 games fought for a playoff spot.

One Wonders…

Try to apply what you learned for one dimensional random walks to a football team that is participating among 18 teams. If it is an average team, what kinds of predictions can you make for the team?

Don’t forget to include the third possibility: Win, lose or draw.

Ps. I didn’t forget about Steve the accountant. We are slowly heading towards the answer.

M. Serkan Kalaycıoğlu

Real Mathematics – Life vs. Maths #4 (Extra)

Q: Is there an algorithm for us to use in order to guess where a one dimensional random walk could end?

Let’s say we took N random steps in one dimension. I have to assign something for these steps so that we can distinguish each and every one of the steps. I’ll call the first step a1. In this case I can call;

second step: a2,

third step: a3,

forth step: a4,

Nth step: aN.

In the previous article I’ve mentioned that there are two possible values for every step: +1 or -1. I’ve also said that probabilities of these values are equal to each other and precisely ½. Now I can use all this information to calculate the average value each random step has.

In order to do that I can use arithmetic mean: Add both numbers together and divide the total into two. Let me show the arithmetic mean of a1 as <a1>. Then we get the following result:


Average value of a random step in one dimension is 0.

<a1> = 0

<a2> = 0

<a3> = 0

<aN> = 0

Summation of all the average values of N random steps would show us how far we are from the starting point. Let u be the distance from the starting point after N random steps. Then:

u = <a1> + <a2> + <a3> + … + <aN> = 0 + 0 + 0 + … + 0 = 0.

This result says that after taking N random steps in one dimension we should expect to stop at the starting point. This is a paradox because even if it is very small there is a possibility that all N steps could have the value (for instance) +1. In that case u would be +N. But our math shows us that if we increase the number of steps we would eventually end up at the starting point.

More Beautiful Mathematics Needed

This answer is not pleasing to neither to us nor to the mathematicians whom are dealing with this problem. Because 0 is only one of the many possibilities: Not the only possibility.

It would be better if we found an interval for the answer. We can use mathematical manipulations to achieve that.

Two possible outcomes for each step is either +1 or -1 and we just assigned a1 to the value of first step. Let me take the square of a1: It will be +1 in both cases. If I take the square of every one of them:

a12 = 1

a22 = 1

a32 = 1

aN2 = 1

Distance from the starting point was assigned to u. Now let’s square u. It will be a relatively long equation as follows:

u2 = (<a12> + <a22> + <a32> + … + <aN2>) + 2 (<a1a2> + <a1a3> + <a1a3> + … + <a1aN> + <a2a3> + … + <a2aN> + … )

First part of the equation makes N.

All the terms in the second part of the equation are equal to each other. That is why it will be enough if I calculate only one of the terms. Let me first calculate a1a2 so that I can take its average and find <a1a2>:

As you can see from the picture second part of the equation makes 0. Then square of the distance from the starting point is u2 = N. Take square root of both sides and we get our answer: +√N and -√N.

This result means that after taking N random steps in one dimension, one would stand at any point between +√N and -√N. For instance if one takes 100 random steps in one dimension, that person would be √100 = +/- 10 steps away from the starting point.

M. Serkan Kalaycıoğlu

Real Mathematics – Life vs. Maths #3

Drunkard’s Walk Back Home

Steve the accountant finished another working week. He usually spends his weekends in peace. But this specific weekend was different: He was supposed to meet his old college mates whom he hasn’t seen for ages. That night they talked about old days, laughed and drank until morning. Steve the accountant has never been a heavy drinker. At the end of the meeting even though he was barely standing he insisted that he can walk back to his home by himself.

indir (11)

Steve the accountant started walking in random directions: “This street looks familiar… Oh that building looks just like mine…”

Q: Can a drunkard make his way home using a random walk?

Random Walk in One Dimension

I have to talk about random walk in one dimension before I answer the fate of Steve the accountant. In one dimension walking path is something we are familiar since we are kids: The number line.

There are two directions on the number line: Right and left.


  • In one dimension one step to right means +1, one step to left means -1.
  • Let’s assume that the probability of choosing right and left is same.
  • Because of the previous assumption taking a step towards right or left has the probability of ½.


Now let’s draw a number line and choose zero as the starting point. First step can be taken towards +1 or -1. Their probabilities are equal: ½.

Taking two steps at once will be a little bit more complicated than taking one step. After taking only one step we concluded that there can be only two possibilities: +1 and -1. But when we try to take two steps at once, there will be four possibilities:

0 -> +1 -> +2

0 -> +1 -> 0

0 -> -1 -> -2

0 -> -1 -> 0.


In every possibility, probability will be equal: ¼.

After the second step, we may be standing on either one of +2, 0 or -2 with probabilities ¼, 2/4 and ¼ in order.

How about three steps?

We already know what the probabilities are after two steps. According to our findings third step can start either at +2, 0 or -2.

  • If we take our step from +2, we can go to +3 or +1. Their probabilities will be half of the probability of +2. Hence it will be 1/8 each.
  • If we take our step from -2, we can go to -3 or -1. Their probabilities will be half of the probability of -2. Hence it will be 1/8 each.
  • If we take our step from 0, we can go to +1 or -1. Their probabilities will be half of the probability of 0. Hence it will be 2/8 each.


Our calculations show that after the third step we could stand on:

+3 with the probability of 1/8.

-3 with the probability of 1/8.

+1 with the probability of 1/8 + 2/8 = 3/8.

-1 with the probability of 1/8 + 2/8 = 3/8.

In case we continue using the same logic, fourth and fifth steps would look like the following:

After 100 steps, final position and its probability is shown as follows:

Coming back to your starting point (which is zero) has the highest probability.

So far we can make these conclusions about a random walk in one dimension:

  1. When we take even number of steps, we stop on an even number. When we take odd number of steps, we stop on an odd number.
  2. As we increase the number of steps probability of stopping around the starting point gets higher.
  3. Previous argument indicates that if we take more steps, probability of returning to the starting point will increase as well.

Game of Random Walk in One Dimension

So far we understood that a random walk in one dimension has two possible outcomes. In order to simulate a one dimensional random walk we can use coin toss since there are only two possible outcomes for a coin toss: Heads or tails.


If we have a fair coin, probability of getting heads or tails will be equal to each other: 1/2. Then let’s assign tails to -1 and heads to +1.

  1. Toss a coin 10 times. Where did you finish your random walk?
  2. Do the same thing for 30 times and compare your result with the previous one.

I could hear you saying: “What about Steve the accountant?”

A little bit of a patience. We’ll get there in the upcoming articles.

M. Serkan Kalaycıoğlu