Codes are shown in the HTML file.
Markov Property
The Markov Property states that the expected value of the random variable \(S_i\) conditional upon all of the past events only depends on the previous value \(S_{i−1}\). The implication of the Markov Property is that the
Martingale Property
best expectation of future price, \((S_{t+k}\), is the current price, \(S_t\). The current price contains all the information until now.
$$ \mathbb{E}(S_{t+k}|F_t)=S_t, \text{ for k>=0} $$
That is called the Martingale Property.
Quadratic Variation
The Quadratic Variation is defined as,
$$ \sum_{i=1}^k (S_i – S_{i-1})^2 $$
In the coin toss case, each movement must be either “1” or “-1”, so \(S_i – S_{i-1} = \pm 1\). Thus, \((S_i – S_{i-1})^2 =1\) for all “i”. Therefore, the Quadratic Variation equals “k”.
A Realisation
Here below is the Code Realisation of a Brownian motion – Chapter 5.6 Paul Wilmott Introduces Quantitative Finance.