Blue - interesting maths
Purple - interesting article written by me
Orange - article that has been in the news but explained and modified by me (date might be important)
Red - book review
Lime green - finance
Indexes are combinations of equity.
Rules based indexes are driven by fundamental factors like value, momentum, growth, size, quality, yield and volatility.
Factor indexes should be careful to avoid biases to particular sectors. If a more naive approach is taken, there will be high exposures to these sectors. In the case of yield, some dividend increases are likely due to temporary high earning periods.
Let's discuss each of these in more detail:
Minimum volatility indexes - "defensive" and do relatively better than other stocks during periods of economic contraction, and therefore they reduce risk during market downturns.
High dividend yield - companies with increasing dividends, but also persistent dividends. This is also "defensive", doing better than other stocks during periods of economic contraction. Provides a regular income stream.
Quality - stocks with durable business models and competitive advantages. Considers how companies use investments to grow (ROE), the consistency of earnings and also the debt of the company.
Momentum - winning stocks tend to continue to perform well. This is perhaps due to delayed price reactions to information. Stocks that increase in value rapidly gain more attention from investors (e.g. Nvidia 2023). These indexes are plagued by crashes.
Value - takes into account the stock price along with earnings, dividends and book value (assets - liabilities) and also enterprise value (a more comprehensive alternative to market cap as it takes into account leverage). Forward P/E can be more reliable than P/E (divides the current share price by the estimated future EPS). Investors expect the market to revalue these stocks.
Size - small cap stocks outperform bigger companies in the long run. Not "defensive", it does best when the market grows. Larger companies are less likely to double/triple in value over the next 5 years than a smaller one.
Growth - uses historical earnings, sales and predicted future earnings. These stocks are meant to outperform their sector in terms of revenue/earnings growth. Its success has been largely due to the growth of tech stocks such as Microsoft, Apple and Nvidia.
Log-normal distribution - defined by the risk-free interest rate value and standard deviation (a measure of volatility).
An call option price is highest for volatile stocks during periods of rapid growth (so a high risk-free interest rate) because the stock will increase in price more on average.
Brownian motion = random stock price movement.
C = price of the option
S = stock price
K= strike price (the buyer of a call only makes money if the stock price at maturity is higher than the strike price)
T-t = time to maturity
N(d1) and N(d2) = normal distribution functions
Below a strike price, the buyer of a call option loses the cost of the call option. It doesn't matter if it is 0.5% less than the strike price, or if the price of the stock has decreased by 50%.
But if the stock doubles in value (as it may do with a very volatile stock), the buyer will make a lot of profit. This is not good for the bank.
Cash equity team:
Matches seller with buyer, while providing extensive risk information
Allows the clients to remain anonymous when making large trades
Building relationships with clients, and contacting them when there are stocks available to buy or if there is an opportunity to sell stocks
Numerical analysis to provide good advice to clients on what stocks may do well (using information provided by companies in their results)
Predicting market moves buy considering the market's expectations for a company's results and the bank's own predictions which may be different and more accurate
An interesting fact is that clients don't buy all the shares they ultimately want immediately, they buy the shares over a period of time. There are 2 main reasons for this:
There will not be enough stocks available to purchase at any one time
Banks have a tendency to prefer stocks with higher liquidity. If a client wants to buy a call/put option for a stock with high liquidity
Buying them over an extended period of time allows them to mitigate the risk of buying before the stock price decreases, therefore the importance of timing the investment is decreased
Banks can also communicate with a company's management (for example, their CFO), therefore building a relationship with that company, with the final goal of becoming that company's corporate broker (every company listed in the UK is required to have one of these, since a corporate broker acts as a financial advisor for that company). This leads to increased revenue from the bank, since they will earn a commission from the company.
Risk management:
Ever since the 2008 financial crisis, banks have learnt to become much more cautious.
They have a maximum risk limit - the maximum amount of money they will lose in a worst-case scenario.
They do this buy looking at data from historical stress scenarios - such as the COVID-19 pandemic, the 2008 financial crisis and Trump's 2016 election win - but also hypothetical scenarios, such as a war or energy crisis.
These algorithms to simulate risk run overnight based on the positions the bank has, and the next day traders will hedge to reduce risk if risk is too high. Hedging enables banks to mitigate the effects of a stock moving. If a bank has sold many call options for a stock, they can buy the stock themselves and help them pay the payout if the stock increases in value.
Hedging is always dynamic, so you will need to adjust the methods of hedging once the market adjusts.
Often, companies in the same sectopr behave similarly, so an index such as nasdaq can allow banks to hedge selling options in tech stocks.
An example risk report from a hedge fund can be found here: https://www.bhmacro.com/wp-content/uploads/2024/02/BHMF-Risk-Report-June-2024-ADV019179.pdf
Derivatives:
Structured products fit a client's needs for their desired level of risk and their desired returns
CDS (credit default swap) = if you buy $1,000,000 of BMW bonds, but you don't like the idea of losing this money if BMW goes bankrupt, you can buy CDS, which is similar to insurance. CDS for BMW is < 1% ($10,000), while return from the bonds is much more than this, so CDS is a relatively cheap insurance and can reduce risk for investors. In the event that BMW defaults/goes bankrupt, the bank which sold you the CDS will pay you the loss on these bonds - $1,000,000 if BMW were unable to pay anything to the bond owners.
Note: companies that are close to bankruptcy will have to pay more interest, due to the risk of being unable to pay the money back.
Notes on options: Options can give you more leverage on stocks. The value of a call option cannot exceed the value of a stock.
If a company is worrying about increasing interest rates, they can buy a swap. This is where the company pays a fixed interest rate to the bank, but the bank pays a floating interest rate to the company. This way, if the interest rate increases, the bank pays more than the company.
QIS:
Price to earnings can be a good metric for determining whether a stock is overpriced or undervalued. However, this metric should be used with caution - low price to earnings could be because the company has an upcoming court case that they are likely to lose, so you cannot invest based solely on P/E ratio. Also, certain sectors tend to have higher P/E, such as oil companies, where there is little potential for growth and government funding will be gradually reduced due to fears of global warming and low oil reserves. So P/E should be compared within each type of company, and not between them.
Some other metrics can be used...
Quality of earnings - cash earnings are more valuable
Earnings consistency - do they make money every month, or just some months?
Larger companies are more stable but have less potential for growth
Insiders (eg. the ceo) - are they buying or selling their stock?
Are their earnings growing?
Do they have too much debt?
Generator learns to make images that are like real images. Of course, the initially untrained generator produces obviously fake, random images.
The discriminator learns to distinguish fake data from real data.
The images made by the generator become training examples for the discriminator. The discriminator penalises the generator for producing results which are obviously fake. The generator's output is connected to the discriminator's input directly. The discriminator's training data also includes real data - real pictures.
Both the generator and discriminator are neural networks.
Discriminator (critic) training:
The discriminator classifies both real data and fake data from the generator.
The discriminator loss penalises the discriminator for misclassifying a real instance as fake or a fake instance as real.
The discriminator updates its weights through backpropagation from the discriminator loss through the discriminator network.
The discriminator becomes more accurate at deciding which data os fake or real.
Generator (artist) training:
Sample random noise. (NumPy has a random noise function, this will essentially provide the output of the untrained generator.)
Get discriminator "Real" or "Fake" classification for generator output.
Calculate loss from discriminator classification.
Back-propagate through both the discriminator and generator to obtain gradients.
Change the generator weights
The generator becomes better at producing fakes which are very close to the real thing.
How the entire GAN trains:
The discriminator trains for one or more epochs.
The generator trains for one or more epochs.
Repeat steps 1 and 2 to continue to train the generator and discriminator networks. We never train the generator while training the discriminator, and vice versa.
The generator becomes very good at producing artificial images that look almost identical to the real thing. The discriminator's performance gets worse and worse, eventually until it gets 50% accuracy - random predictions. This is failure to converge - not the desired outcome.
Uses:
Generator makes deep fakes - for example of a car. This image is not an actual picture of an actual car, it is synthetic and artificial.
Discriminator can determine if an image is a deep fake, for instance if someone on a social media app has posted a deepfake of a car, pretending that it is their own.
Cool effects! An AI could tranform a picture of a garden to a painting in the style of Van Gogh. We could even artificially use GANs to convert low resolution images from the past to high resolution images. Or with a single image, we can create faces from different viewing angles, and perhaps combine them to form a 3D model.
GANs can even be used to compose music.
A Dyson sphere. Not designed by James Dyson! It is by Freeman Dyson.
Date: April 2021
The possibility of intelligent life existing at the same time in nearby (like less than 500 light years) places in the universe - quite small. The idea of communicating over vast distances is an independent matter.
We don’t know how long intelligent life typically lasts. The Milky Way galaxy is about thirteen billion years old. Let’s say that it has been able to support intelligent life for about ten billion years. That is the length of 'our party'. If we assume that humans survive as a technological species for ten thousand years, then it is as if we showed up for a six-hour party but only stayed for one fiftieth of a second. Even if tens of thousands of other intelligent beings show up for the same party (and show up for the same amount of time), it is unlikely that we will see anyone else. We will see an empty room. If we expect to discover intelligent life in our galaxy, it requires that intelligent life occurs often and that it lasts a long time.
So while extraterrestrial life is expected to be common given how many stars and galaxies are out there, technologically advanced life needed for communication over vast distances took billions of years to evolve in earth (our only data point) and it is possible that this phase doesn’t last very long. For a chance of communication we need to create a signal or a signature that can outlast us and survive for millions of years. Once we have figured out what that might be we can go about looking for the same thinking that another intelligent species might have figured out something similar. A strong, self-sustaining signal that unmistakably originated with an intelligent being and is distinctively different from the varied signals we receive from different types of distant objects in space.
Perhaps if we built a Dyson sphere around our sun and built it to last then it would help solve our energy needs as well as create a distinctive signal, and the structure might even store all the knowledge that we’ve accumulated like a time capsule for another civilisation to find and download!
Date: April 2021
Recurring numbers:
These can be quite interesting. It is likely that you have heard of
1/3= 0.3333333... and 2/3=0.66666666.... and also 1/9 = 0.111111...
These are known as period 1 recurring numbers. i.e. they repeat one digit again and again.
But there are more interesting ones.
1/11 = 0.09090909... which is period 2 recurring. Similarly 2/11, 3/11...
1/7 = 0.1428567 1428567... which is period 6 recurring.
And 1/23 is period 22 recurring! i.e it repeats every 22 digits!
Irrational numbers don't repeat, like pi = 3.141592654... and they cannot be written as a fraction.
Interesting fact:
Think of a number. Write it down. Then, find the sum of all the digits in the number. Write your answer down, below the original number. Subtract. I know that your answer is divisible by 9. Try this out or see the example below.
281 - 11 = 270
270/9 = 30
Can you find a proof?
Answer:
abc = a*100 + b*10 + c.
When we subtract the sum of the digits we get: a*99 + b*9. This will be a multiple of 9, as each term is being multiplied by 9, 99, 999 etc. So it will work for all numbers!
Infinite primes?!?
Suppose P1, P2, P3 … PN are all the prime numbers and PN is the last prime number. Consider the number y=P1xP2xP3...xPN + 1. None of the prime numbers are a factor of this number. So, this new number must be prime or be divisible by primes that aren't already on the list.
Okay, so there are infinite primes, but is there a set of 11 consecutive numbers that don't contain a prime number? Yes.
Hint: We would like to find a 100 consecutive numbers such that the first is a multiple of 2, the second is a multiple of 3, the third is a multiple of 4, the fourth is a multiple of 5, and so on until the hundredth that is a multiple of 101. How can one find such a number?
101!+2 will divide by 2, because ‘101!’ divides by 2.
101!+3 will divide by 3.
And so on up to 101! + 101 which will divide by 101.
So there are 100 numbers that are not prime.
102!+2 …. 102!+101 will work too. Similarly 103! ….
202!+2 and so on to 202!+101 will work, and 303!+2 and so on.
Above is a picture of the most common type of neuron in the neocortex. The box shows an enlarged view of one dendrite branch so you can see how small and tightly packed the synapses are. The synapses in the highlighted area around the cell body are called proximal synapses. They are connected to sensory inputs. The remaining 90% of the synapses are further along the dendrites, and are involved in pattern recognition and prediction.
If you haven't already, see the article below!
Date: April 2021
There are about 100 billion neurons in the brain arranged in many thousands of cortical columns.
Each neuron has a number of dendrites on which thousands of synapses are arranged. Synapses connect the neuron to other neurons.
All our memories and knowledge are stored using these synapses.
Learning happens by forming new synapses, forgetting happens when an old one is removed.
The axon is the output of the neuron, signals travel along the axon.
If the proximal synapses receive enough input, then the neuron will spike. The spike starts at the cell body and travels to other neurons via the axon. Oddly, less than 10 percent of the cell’s synapses are in the proximal area.
Of the remaining synapses, if 8-20 neighbouring synapses activate at the same time then a pattern has been recognised. A neuron can thus be involved in recognising hundreds of different patterns. On the other hand if something unexpected happens then there is much more activity across the synapses as new information is learnt and new predictions are made.
A neuron. Neurons are very interesting. I made another article on them. (See above)
Diagram showing the brain.
For simplicity, you could refer to the limbic and reptilian brains as 'the old brain'. The old brain gives us our wish to live, our emotions, movement and stuff like that.
Our neocortex, which is relatively new, gives us our intelligence. A large neocortex distinguishes us from many other species. It is actually uniform throughout even though different parts of it seem to have different functions because they are connected to different sensory organs. It helps us make a model of the world by forming models of every different object.
The neocortex is made up of 150,000 minute cortical columns, each modelling a part of the world that it can sense and updating its knowledge of the world through each column's multiple models of multiple concepts.
As the brain is structured like this, it is certainly possible to make a very intelligent robot, with no wish to live, replicate, gain power, do harm or feel emotions. This would be great, as we don't need to worry about 'shutting it down'. It simply helps us solve complex problems that require intelligence.
Date: April 2021
Credit: Jeff Hawkins author of 'A Thousand Brains: a New Theory of Intelligence'
There is a set of criteria that machines must have to be considered intelligent. Humans have these characteristics.
Learning continuously:
What is it:
Every moment of our lives while we are awake, we are learning. Sometimes what we learn turns out to be not so important (like what clothes I wore a few days ago), so we forget it. Other times, we remember it (like the alphabet and times tables).
Why is it important:
The world is constantly changing, so our 'model of the world' must constantly adapt. See the 'many models section' for more info on models.
Humans and AI (how does the brain do it):
Humans have many neurons in our brain. Neurons are the fundamental building blocks of intelligence. When a neuron learns something, new synapses are stored on one dendrite branch. This doesn't affect the previously formed synapses. A lot of the time we learn through movement. As our sensory inputs change, cortical columns in our brain which together store a model of the world continuously makes predictions about what we expect to see and updates its model when required.
Most of todays AI learns through a lengthy training process before being deployed (so it stops learning).
Many models:
What is it:
The neocortex is composed of tens of thousands of cortical columns. Each column learns models of objects. Knowledge about anything is distributed throughout the brain. Each cortical column has its own set of reference frames that helps in learning the 3 dimensional structure of objects and how they move and change.
Why is it important:
This provides flexibility because even if one part of the brain gets damaged, it is unlikely that you will lose much knowledge.
Humans and AI:
AI designers can create machines with additional sensors, for example that can hear or see frequencies that are outside our range, like radio-waves and x-rays. Some fish sense electric fields, birds sense magnetic fields. These will be used to make even more complete models of the world. In humans, the long range connections between the neocortical columns vote to decide what object is being sensed and what to do. The same should happen in intelligent machines.
Oumuamua's hyperbolic trajectory
Date: March 2021
ʻOumuamua is the first know interstellar object detected passing through the solar system.
It is thought to be interstellar because its path around the Sun is seen to be strongly hyperbolic (see image) meaning that it’s velocity is high enough to not get gravitationally bound to the Sun, it comes from outside the solar system and goes back out. It did receive a gravitational slingshot effect from the sun the way spacecrafts flyby planets to boost their velocity.
Its trajectory differs from that of asteroids and is similar to that of a comet, which shows non-gravitational acceleration due to degassing close to the Sun, however no degassing has been observed. (When a comet degasses, it leaves behind a tail. No tail has been spotted. So, it probably isn't a comet. But then, what is it?)
It is a very small object, possibly disc shaped to account for the variation observed in its brightness. It has been suggested that it might be a light-sail like debris of a device made by an alien civilisation.
If we opened up our mind to how many planets in the Milky Way might be habitable, that there is no reason for us to be unique, and that we are already thinking of sending out tiny high speed probes to nearby stars under the Starshot Initiave. It’s reconstructed trajectory has been compared to the reconstructed galactic orbits of 7 million stars seen by the Gaia space observatory to identify the star system from which it originated or had past close encounters with and that could have given rise to its observed velocity. These are just a small fraction of all stars that will eventually be added to such a study.
'Oumuamua was discovered by the Panstarrs telescope in October 2017. Other more powerful telescopes such as the Large Synoptic Survey Telescope might look at it and other such interstellar interlopers in the future. So much work has been done on a small object that visited and is now headed out of our solar system.
A important figure in astrophysics, Avi Loeb, backs this story about Oumuamua, even writing a book on it. He was the longest serving Chair of Harvard's Department of Astronomy (from 2011 to 2020).
Edit: It was recently reported that it was probably made of frozen nitrogen, like Pluto.
Date: March 2021
Imagine a circle with a pentagon inside it. The corners of the pentagon touch the outside circumference of the circle.
Now, imagine a circle with a hexagon. What about an octagon. The areas of the two shapes become more and more similar. A 100 sided shape would look almost identical to a circle.
So, if we find the area of the corresponding 100 sided polygon, we would pretty much have the area of the circle.
But, how do you find the area of a polygon? You split it into triangles. So, the area of a n sided polygon would have 1/2 x b x h x n (the number of sides of the polygon, so the number of triangles). But b x n is also the perimeter of the polygon. So:
Area of polygon = 1/2 x perimeter of polygon x h.
But, the perimeter of the polygon is very, very similar to the circumference of the circle, which is 2 πr. Also, h will get very close to the radius so we get our famous area of circle = πr^2.
Date: Feb 2021
Some new evidence has confirmed the dinosaur extinction theory:
'Death by Asteroid' has been the leading theory for the cause of the mass extinction 66 million years ago.
In the 1980s, an element called iridium was found in thin layer of the Earth's crust. Iridium is rare on Earth but abundant on some types of asteroids. This same layer contained the bones of the dinosaurs and the remains of 75% of all life on Earth at the time.
In the 1990s, a huge crater was discovered in eastern Mexico. Named the Chicxulub crater (after a nearby settlement), its diameter was 100 miles wide, big enough to be the impact crater of an asteroid a 7 miles wide.
Now, iridium has been discovered in this same crater, in a layer about a kilometre below the sea-bed.
Pieces of the impactor and the earth's crust would have ejected out of the earth's atmosphere, heated to incandescence upon re-entry, broiling the Earth's surface and possibly igniting wildfires; meanwhile, colossal shock waves would have triggered global earthquakes and volcanic eruptions. Vaporisation of carbonate rocks would have created additional greenhouse effect. The blocking out of sunlight for a couple of decades would have killed much of the plants and cause everything to scorch or starve to death.
The asteroid would have released the same energy as 20 billion atomic bombs!
Date: Feb 2021
What is iridium?
Iridium is a member of the platinum family and is white in colour with a yellowish hue. It has a density of 22.65 grams per cubic centimetre. By comparison, the density of iron is 7.874 g/cm3. This makes it the highest density element. It is also corrosion resistant. The percentage of iridium in asteroids is as high as in the original dust cloud that created the solar system, while iridium levels in the Earth's crust are far lower because it receded into the molten core along with the iron it strongly bonds to in the early stages of the Earth's history.
More on asteroids:
Whatever asteroids contain is the composition of the original 'dust' that created, the Sun, the planets and us. All in one small rock. This is why some scientists are keen on exploring asteroids.
How many asteroids hit Earth (and their effects)?
The answer depends on size. Every day, Earth is bombarded with more than 100 tons of dust and sand-sized particles. About once a year, an automobile-sized asteroid hits Earth's atmosphere, creates an impressive fireball, and burns up before reaching the surface. Space rocks smaller than about 25 meters will most likely burn up as they enter the Earth's atmosphere and cause little or no damage. Asteroids with a 1 km diameter strike Earth every 500,000 years on average and they cause a crater of 13.6 km diameter.
What are sedimentary layers?
As life forms die, volcanoes explode and their magma dries up, layers are formed. It is basically a timeline. You can see these layers in the Grand Canyon. Layers with an unusually red probably contain a large amount of iron.
Date: Feb 2021
I started looking at this book and found some interesting ideas.
The book asks us to be 'inordinately curious' about words, and 'develop a fastidious vocabulary'.
Words are 'fairly wriggling with life, they are exciting and mysterious tokens of our thoughts'. 'Like living things, they have roots, branches and leaves.'
The Latin word for pebble was 'calculus' and that is where the word calculate comes from, because pebbles were used to calculate how far a hired Roman vehicle had driven. (It had a spinning container that dropped pebbles through a hole as the wheel turned. The dropped pebbles fell into a container and were counted at the end of your trip. )
Companion is simply one who eats bread with you - from Latin word 'cum', meaning with, and 'panis' meaning bread.
From the Latin word 'ligare', meaning to bind, comes ligament (something that ties two muscles together), and league (nations/organisations or teams bound together).
Similarly, the Latin root 'spectare', which means to watch, gives rise to the English words spectacle, spectator, inspect, introspect and even respect (the tribute you give to a person you care to look at again [re-spect]).
Here is what I got out of the first chapter:
Some companies pander to the wanton instincts of customers, while activities like sport or music, sublimate them.
Through lockdown, many of us boys like to live vicariously through games like Call of Duty.
He obeyed obsequiously.
Nokia became effete when Apple grew.
Sometimes you rationalise your mistakes, but other times you expiate them.
Date: Feb 2021
This book is so simple, yet it gave me an understanding of economics.
Here are some key points:
Companies use marketing strategies like price targeting to make different customers pay as much as they are willing and more than they need to. Being aware of their tricks can often get you a better deal. See pic.
We need to ensure that a product's harmful side effects are included in the price (raising the tax on diesel, for example to help reduce pollution).
We place value on things like safety and our time by making choices like whether to take a taxi or wait for the bus, or whether to buy a smoke alarm or CCTV.
When the market is fully competitive, it is the perfect market, efficient (you can't make one person better off by giving them a better deal for example through a subsidy, without making another worse off) and probably fair. Efficient markets, however, don't need to be fair, but it is possible to make an efficient market fair (by having a competitive market, the prices are reasonable relative to the cost of making it).
Prices of different things are all linked. For example, if you have a storm in South America, affecting the growth of coffee, coffee farmers in Kenya will enjoy high demand and a pay rise. They will try and buy materials like bricks to build new houses, so in brick prices in the area will go up.