What is a Markov Process?

University Mathematics

A few students that have great interest in going into financial mathematics, be in JC students or Uni students that were taught by me before, asked me where to start. So I often recommend them to read on Markov Process first. Of course, you need a certain knowledge for statistics here to be able to read. My brother attempted reading on it a bit and faced much discomfort. There were many definitions and terminologies that were not that user friendly.

A Markov Process is a stochastic process with the following properties
(a) The number of possible outcomes or states is finite.
(b) The outcome at any stage depends only on the outcome of the previous stage.
(c) The probabilities are constant over time.

I will discuss more on stochastic process in a later post, and possibly compare it to deterministic process. But for now, lets looks at what the above properties imply.

Credits: WIkipedia
Credits: WIkipedia

So the above diagram shows that we have three (finite) states, they are, bear, bull, and stagnant markets. We also see that the outcome of any stage here is pre-determined by the previous stage, be it moving from a stagnant market to a bear market. Lastly, the probabilities are constant OVER TIME. These probabilities are what we call transition probabilities, which represents the likelihood of moving from one state to another state.

Markov Processes help us to understand the happenings of the world, given the assumptions are adhered to. At the same time, it means that what happens in the long run won’t depend on where the process started, or on what happened along the way. It will, however be completely determined by the transition probabilities.

Does this imply that history doesn’t matter and I do not look at a company’s past performance before making a decision? Not quite, since the assumption clearly will not hold in reality. Markov processes model provides a framework to which we can compare the world. And if the world fits the assumption, that what happens in the long run is pretty much determined and affirmed.

Let’s talk about Zipf’s Law

University Mathematics

Zipf’s law /ˈzɪf/, an empirical law formulated using mathematical statistics, refers to the fact that many types of data studied in the physical and social sciences can be approximated with a Zipfian distribution, one of a family of related discrete power law probability distributions. The law is named after the American linguist George Kingsley Zipf (1902–1950), who popularized it and sought to explain it (Zipf 1935, 1949), though he did not claim to have originated it.

Pascal’s Triangle

JC Mathematics, University Mathematics

This is a really good video that introduces students to Pascal Triangle’s. A-levels Students should be able to relate to the binomial expansion coefficients that are found in the triangle! There are much more uses to Pascal Triangle’s. I will share more when the A-levels end.

Why we need to be close to zero?

JC Mathematics, University Mathematics

Many students have asked me why it is important to for x to be close to zero for the Maclaurin’s expansion to be a good approximation. So here, I plot it in the 4 curves:
y =e^x which is our actual curve.
y = 1+x which is the estimation of e^x, up to and including x.
y = 1+x+\frac{x^2}{w!} which is the estimation of e^x, up to and including x^2.
y = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!} which is the estimation of e^x, up to and including x^3.

Curves and its estimation
Curves and its estimation

We can observe from the graphs, that as we increase the degree of order, the estimated curves become more like that of e^x, although it still tend to deviate a lot. The idea of maclaurin’s is that it provides us a way to interpolate and write the humble e^x equation out in a polynomial that actually never ends. So as we continue to consider more terms, our estimation will get close and closer to the actual curve.

And clearly, we see that when x=0, we found the actual value. This is simply because the maclaurin’s expansion is centred about zero. 🙂

Mathematical Computing #1

University Mathematics

With regards to a recent post, I shall share further on Mathematical Computing and how we can start on it.

So to assist me in not over-simplifying the journey, I’ve personally signed up for an online course with Coursera to learn Python. I have prior experience with Python, C++, Matlab, R & Stata. So yes, I might not struggle in the course much but I can refresh on the basics and hopefully recall my struggles and share here.

Not the Snake! Credits: python.org
Not the Snake! Credits: python.org

Firstly, I recommend Python as a beginner mathematical computing language. It is also the language that is being taught to Year 1’s in NUS (NTU teaches Matlab instead). I think Python is more straight forward and easy to understand. Furthermore, it sets the foundations straight for future endeavours into other language too. I also recommended the Python Course to a fellow educator whose son wants to learn a bit.

Does your math need to be strong to do mathematical computing? Not really since this is altogether a different thing. Math focuses on problem solving, so the implantation of a algorithm simply hasten the process.

Prime Numbers and their uses

University Mathematics

Prime Numbers are numbers that are only divisible by itself and 1. However, you will be amazed that the pursuit of prime numbers has gifted us a number that is 17 million digits long. So what is this big hoo-ha over it. I meant its just a number and mathematicians around the world are still constantly trying to find them.

First up, using a simple code, ”
g_intensity = ((((y << 32) | x))^((x << 32) | y))) * 15731 + 1376312589) % 256″

Credits: Stackexchange
Credits: Stackexchange

This code is based on prime numbers whereby the intensity of green color is found using a function, where x and y are a pixel coordinates in screen space, stored in a 64bit integer variables.

So that was fun stuff, more importantly, modern cryptography rely a lot on the use of prime numbers. Here, we use large primes to encode information that is sent wirelessly when making transactions on our debit cards, credit cards, computers, etc in order to keep our information safe. For those who watch The Imitation Game, you can relate it a little. In the movie, war information was encrypted and transmitted through cryptography. Here, our valuable credit card information is protected the same way! If you’re keen to read, you can start reading on RSA Algorithm.

Other applications include predator – prey modelling in Biology and even Music, just to name a few. 🙂

How many chess games are possible?

JC Mathematics, Secondary Math, University Mathematics

The Shannon number, named after Claude Shannon, is an estimated lower bound on the game-tree complexity of chess of 10120, based on about 103 initial moves for White and Black and a typical game lasting about 40 pairs of moves.

Did you also know there are over 9 million different possible positions after three moves each. There are over 288 billion different possible positions after four moves each. The number of distinct 40-move games is far greater than the number of electrons in the observable universe.

Patterns in prime numbers

Patterns in prime numbers

University Mathematics

So you still think prime numbers are random?

Take a look at this really cool project, it kinda reminds me of the sieve of Eratosthenes: El Patrón de los Números Primos: Prime Number Patterns – Jason Davies

You can examine more on divisor plot as well.

Prime numbers has mystified mathematicians for centuries, there seems to be a pattern but mathematicians aren’t able to find a method to predict the next sequence or understand what exact cause prime numbers to be the sequence it currently is.