1.5 Applications to financial services
Suppose we have a circle of radius 1 inscribed in a square, which therefore has sides of length 2 and area 4 = 2 × 2. What is the area A of the circle?
Before you try to remember your geometric area formulas, let’s compute it a different way using ratios and some experiments.
Suppose we drop some number N of coins onto the square and count how many of them have their centers on or inside the circle. If C is this number, then
Question 1.5.1
If N = 2, what are the possible estimates of A? What about if N = 3?
Clearly we will get a better estimate for A if we choose N large.
Using Python and its random number generator, I created 10 points whose centers lie inside the square. The plot below shows where they landed. In this case, C = 9 and so A ≈ 3.6.
For N = 100 we get a more interesting plot with C = 84 and A ≈ 3.36. Remember, if different random numbers had been generated then this number would be different.
The final plot is for N = 500. Now C = 387 and A ≈ 3.096.
The real value of A is π ≈ 3.1415926. This technique is called Monte Carlo sampling and goes back to the 1940s.
Using the same technique, here are approximations of A for increasingly large N. Remember, we are using random numbers and so these numbers will vary based on the sequence of values used.
N | 10 | 100 | 1,000 | 10,000 | 100,000 | 1,000,000 | 10,000,000 |
A | 3.6 | 3.36 | 3.148 | 3.1596 | 3.14336 | 3.141884 | 3.1414132 |
That’s a lot of runs, the value of N, to get close to the real value of π. Nevertheless, this example demonstrates how we can use Monte Carlo sampling techniques to approximate the value of something when we may not have a formula. In this case we estimated A. For the example we ignored our knowledge that the formula for the area of a circle is π r2, where r is the circle’s radius.
In section 6.7 we work through the math and show that if we want to estimate π within 0.00001 with probability at least 99.9999%, we need N ≥ 82,863,028. That is, we need to use more than 82 million points! So it is possible to use a Monte Carlo method here but it is not efficient.
In this example, we know the answer ahead of time by other means. If we do not know the answer and do not have a nice neat formula to compute, Monte Carlo methods can be a useful tool. However, the very large number of samples needed to get decent accuracy makes the process computationally intensive. If we can reduce the sample count significantly, we can compute a more accurate result much faster.
Given that the title of this section mentions ‘‘finance,’’ I now note, perhaps unsurprisingly, that Monte Carlo methods are used in computational finance. The randomness we use to calculate π translates over into ideas like uncertainties. Uncertainties can then be related to probabilities, which can be used to calculate the risk and rate of return of investments.
Instead of looking at whether a point is inside or outside a circle, for the rate of return we might consider several factors that go into calculating the risk. For example,
- market size,
- share of market,
- selling price,
- fixed costs,
- operating costs,
- obsolescence,
- inflation or deflation,
- national monetary policy,
- weather, and
- political factors and election results.
For each of these or any other factor relevant to the particular investment, we quantify them and assign probabilities to the possible results. In a weighted way, we combine all possible combinations to compute risk. This is a function that we cannot calculate all at once, but we can use Monte Carlo methods to estimate. Methods similar to, but more complicated than, the circle analysis in section 6.7 , give us how many samples we need to use to get a result within a desired accuracy.
In the circle example, even getting reasonable accuracy can require tens of millions of samples. For an investment risk analysis we might need many orders of magnitude greater. So what do we do?
We can and do use High Performance Computers (HPC). We can consider fewer possibilities for each factor. For example, we might vary the possible selling prices by larger amounts. We can consult better experts and get more accurate probabilities. This could increase the accuracy but not necessarily the computation time. We can take fewer samples and accept less precise results.
Or we might consider quantum variations and replacements for Monte Carlo methods. In 2015, Ashley Montanaro described a quadratic speedup using quantum computing. [12] How much improvement does this give us? Instead of the 82 million samples required for the circle calculation with the above accuracy, we could do it in something closer to 9,000 samples. (9055 ≈ √82000000.)
In 2019, Stamatopoulos et al showed methods and considerations for pricing financial options using quantum computing systems. [16] I want to stress that to do this, we will need much larger, more accurate, and more powerful quantum computers than we have as of this writing. However, like much of the algorithmic work being done on industry use cases, we believe we are getting on the right path to solve significant problems significantly faster using quantum computation.
By using Monte Carlo methods we can vary our assumptions and do scenario analysis. If we can eventually use quantum computers to greatly reduce the number of samples, we can look at far more scenarios much faster.
To learn more
David Hertz’ original 1964 paper in the Harvard Business Review is a very readable introduction to Monte Carlo methods for risk analysis without ever using the phrase ‘‘Monte Carlo.’’ [9] A more recent paper gives more of the history of these methods and applies them to marketing analytics. [6]
My goal with this book is to give you enough of an introduction to quantum computing so that you can read industry-specific quantum use cases and research papers. For example, to see modern quantum algorithmic approaches to risk analysis, see the articles by Woerner, Egger, et al. [20] [3]. Some early results on heuristics using quantum computation for transaction settlements are covered in Braine et al. [1]