12 min read
11-07-2025

Mathematics behind Diversification.

Michaelangelo Aboyade-Cole
Mathematics behind Diversification
In our previous blog about diversification, we discussed the purpose of diversification, its benefits, and how it affects your portfolio. Now, we will discuss the mathematics behind portfolio diversification and how modern portfolio theory works.

Modern portfolio theory

Modern Portfolio Theory (MPT) is an investment theory that allows investors to create an asset portfolio that maximizes expected return based on the given risk level. MPT was introduced in 1952 by Harry Markowitz in his paper Portfolio Selection. He mathematically demonstrated how, by combining assets that are not perfectly correlated, investors could reduce overall portfolio risk. Before this, investment strategies did not account for the correlation between investments.
Markowitz's work led to optimization techniques that help investors construct portfolios based on their risk profile. For example, consider the following two simple assets used to illustrate diversification:

Safe Asset

  • Consistent 5% return
  • Low volatility
  • Stable performance
  • Limited upside potential

Risky Asset

  • High volatility
  • Return up to +40% in bullish markets
  • Downside risk of -20% in adverse conditions
  • High potential gains

Diversification Benefits:

  • Lowers downside risk if the Risky Asset underperforms
  • Offers higher upside potential than solely investing in the Safe Asset
Markowitz's core idea is that risk is a property of the portfolio as a whole rather than individual assets. A single investment's contribution to overall risk depends on both its weight in the portfolio and its interaction with other assets.

Mean-Variance analysis

Markowitz introduced mean-variance analysis, where Mean (μ) refers to the expected return of the portfolio, Variance (σ²) or standard deviation (σ) represents the risk (volatility) of the portfolio’s returns and investors are assumed to be risk-averse, aiming to maximize return for a given risk or minimize risk for a given return.

Efficient frontier

One of the most influential contributions of MPT is the efficient frontier—a set of optimal portfolios that offer the highest expected return for a given level of risk. Any portfolio that lies on the efficient frontier is considered efficient, meaning that no other portfolio exists with:
  • A higher expected return for the same risk level, or
  • A lower risk for the same expected return.
Efficient Frontier Graph
Portfolios not on the efficient frontier are considered suboptimal because they take on too much risk for the return or yield too little return for the assumed risk.

Mathematical understanding of diversification

Markowitz solved the problem using quadratic optimization techniques. The investor’s goal is:
Minimize portfolio variance:
min  wTΣw\min \; w^T \Sigma w
where:
  • wTw^Tis the transposed weights of the assets in the portfolio
  • Σ\Sigmais the covariance matrix of the assets in the portfolio
  • w is the weight of the assets in the portfolio
Minimizing portfolio variance is a core objective in portfolio construction, particularly for risk-averse investors. It essentially means selecting a mix of assets in such a way that the overall risk—or variability in returns—is as low as possible, given the correlations between the assets. This formula shows that the variance depends not only on the individual variances of assets but also on the covariance (or correlation) between them.
Subject to achieving a target expected return μ,
wTμ=μpw^T \mu = \mu_p
i=1nwi=1\sum_{i=1}^{n} w_i = 1
These two constraints mean that the portfolio must achieve a target expected return and the weights of all assets in the portfolio must sum to 1 (i.e., the portfolio is fully invested)
Incorporate Covariances: Portfolio risk depends not only on the individual variances of assets but also on their covariance (how they co-vary). Diversification is achieved by selecting assets with low or negative correlation.
If a portfolio consists of two assets, the risk (variance) of the portfolio is calculated using:
σp2=wA2σA2+wB2σB2+2wAwBσAσBρAB\sigma_p^2 = w_A^2 \sigma_A^2 + w_B^2 \sigma_B^2 + 2w_Aw_B\sigma_A\sigma_B\rho_{AB}
where:
  • wA,wBw_A, w_B= weights of assets A and B in the portfolio
  • σA,σBσ_A, σ_B= standard deviations of returns for assets A and B
  • ρAB\rho_{AB}= correlation coefficient between assets A and B
Impact of Correlation (ρ)
  • If ρ=1, the portfolio variance is not reduced (perfect positive correlation).
  • If ρ=0, the portfolio variance consists only of the first two terms (uncorrelated assets).
  • If ρ<0, the combined risk is reduced, leading to greater diversification benefits.
Thus, correlation is a key factor in determining portfolio risk.

Calculating portfolio return

The return of a portfolio is simply the weighted average of the returns of individual assets:
Rp=i=1nwiRi\R_p= \sum_{i=1}^{n} w_i\R_i
For a two-asset portfolio:
Rp=wARA+wBRB\R_p= w_A\R_A + w_B\R_B
where:
  • wA,wBw_A, w_B= the weights of assets A and B in the portfolio
  • RA,RBR_A, R_B= the returns of assets A and B in the portfolio

Diversification Example Calculation

Consider a simple portfolio made of two assets: a Safe Asset with a consistent return of 5%, and a Risky Asset with returns of 40% in a good scenario and -20% in a bad scenario.
In a bad scenario, investing only in the Risky Asset would yield -20%. However, a diversified portfolio with 50% allocation to each asset yields: 0.5 x 5% + 0.5 x (-20%) = -7.5%, significantly reducing downside risk.
In a good scenario, while the Risky Asset could return 40%, the diversified portfolio delivers: 0.5 x 5% + 0.5 x 40% = 22.5%, capturing much of the upside potential.
Thus, diversification mitigates extreme losses while still allowing for substantial gains, balancing risk and reward more effectively than investing in a single asset.

Final thoughts on Diversification

This is a simplified explanation of diversification using a two-asset portfolio. Real-world portfolios are far more complex, but the core principle remains the same: diversification reduces risk by incorporating assets that are not perfectly correlated.
However, diversification alone is not a guarantee against losses. Investors should also consider:
  • Market conditions
  • Factor exposures
  • Tail risks (black swan events)
  • Alternative diversification strategies (factor investing, smart beta, risk parity)
Keeping track of multiple portfolios can be challenging. Figy simplifies portfolio management by showing your asset allocation by type, sector, and currency. This helps you visualize your diversification strategy and optimize risk-adjusted returns.
In the next part of this series, we'll dig deeper into the common strategies behind diversification. In the final part of this series, we discuss whether diversification is really possible in an interconnected world.

Important Note: This article does not constitute financial advice. Please consult a professional for financial guidance.

Glossary

Modern Portfolio Theory (MPT)

An investment theory that helps investors create an optimized portfolio balancing risk and return.

Diversification

A risk management strategy that involves spreading investments across different assets to reduce exposure to any single asset.

Harry Markowitz

The economist who introduced Modern Portfolio Theory in 1952.

Mean-Variance Analysis

A mathematical approach used to evaluate investment portfolios by considering their expected returns (mean) and risk (variance).

Expected Return

The anticipated return on an investment based on historical data or probability estimates.

Variance

A measure of the spread between numbers in a data set, representing the risk or volatility of an asset or portfolio.

Standard Deviation

The square root of variance, used to quantify the amount of variation in an asset’s returns.

Efficient Frontier

A set of optimal portfolios that offer the highest expected return for a given level of risk.

Quadratic Optimization

A mathematical technique used to minimize portfolio risk while achieving a desired return.

Portfolio Variance

The measure of total risk in a portfolio, calculated by considering the individual variances of assets and their correlations.

Covariance

A statistical measure of how two asset returns move together, affecting overall portfolio risk.

Correlation

A value between -1 and 1 that measures how assets move in relation to each other.

Asset Allocation

The process of distributing investments among different asset classes to balance risk and return.

Risk-Adjusted Return

A performance measure that evaluates investment returns relative to the amount of risk taken.

Black Swan Event

An unpredictable, rare event that has a major impact on financial markets, often used in risk assessment.

Follow us

LinkedIn IconInstagram Icon

Download

Download in Apple app storeDownload in Google play store

Contact

Figy Services B.V.
info@figy.app
Capucijnenstraat 21 C-15
6211RN Maastricht
kvk: 94945705