Algorithm. Unless you live disconnected from the universe, you've probably heard or read this word that has changed the world and has more influence on your life than you think. It's never too late to understand it and know how it can help you!
What is an algorithm?
It is something that is not just correlated with computer science or scientists. Really! An algorithm is nothing more than a sequence of actions taken to achieve a specific goal. Every day you run an algorithm, from the time you wake up to the moment you go to sleep. And when you sleep, your body also performs various algorithms. The action of preparing a juice or to get ready to go to work in the morning are just a few examples. And that favorite app on your smartphone? They are a set of algorithms!
Most people tend to always do the same things. We call this a routine. One may like to have it and others do not. Even when you try to do something out of your routine or when you try not to have one, you are executing some tasks to get away from it. Try to google "how to get away from the routine". A high number of websites, books, and videos suggest you follow certain steps (tasks ?!) to try to do something different :) The same thing happens when you seek to be more productive: you look for tasks that will help you be more efficient, do more things with more quality in the same time. The more complex the objective, the more complex is the algorithm.
In the end, what we are really looking for is a way - the best way - to do something we want. As simple as preparing breakfast or complex as having an app that helps us escape the traffic.
To make it even clearer here is an example of an algorithm:
Algorithm to call someone from a cell phone.
1 - Pick up the phone from your pocket and open the calls app
2 - I know the number of the person?
2.1 - If yes, enter the number
2.2 - If not, search for the number in the phone book
3 - Press Call
4 - Did the person answer?
4.1 - If yes, talk
4.2 - If not:
4.3 - Was it important?
4.3.1 - If yes, wait a while and call again in a few minutes or leave a message
4.3.2 - If no, call tomorrow
5 - End the call
6 - Put your cell phone back to your pocket
And why should I care about algorithms?
Well, there's no way to get away from them. But it is very easy to benefit from it! And we can not dissociate programming from algorithms either. Programming is to write algorithms in some specific language so that we can automate tasks or execute them faster. In a way, many people are already programmers, from executing simple jobs in Excel to professional applications developers and solutions like programs to do astronomical calculations. Particularly I think that in the near future programming will be a discipline in schools, that we will be learning from an early age (at least it should be). It does not mean that we should all be programmers. The world will always need other types of professionals. However, programming or knowing how to create algorithms don't need to be an exclusive knowledge from software developers or scientists. Given its basis in mathematics and logic, the benefits are numerous. As each day we collect and store more data, knowing what to do with them and how to extract meaning from it, becomes evident how important this subject is. For instance, if you are a psychologist and want to analyze data from a survey done with your patients, of course, you can hire a good professional to help you. But would he have the same knowledge in psychology as you have?
There are 3 characteristics that define what a valid algorithm is:
Also, we said at the beginning of the post that the world is full of algorithms. In fact, it always was. What has happened over time is that we have found more efficient ways to run and automate our tasks. This is an endless process, and every time we take it one step further, life becomes easier and more beneficial to all of us.
Thank you for the reading and see you next post!
Rare events are by definition events that happen with a very low frequency. Frequent examples of the literature are large tsunamis, earthquakes and the impact of an asteroid. However, the rare event to us is a financial crisis. Rare events exert so much fascination not because they are rare but also because they are difficult to predict, making whoever does it - by luck or not - the next great guru for a few months or even years.
I intentionally used the term "luck" because according to the efficient markets hypothesis, any financial crisis is practically impossible to be predicted, being practically impossible to make money trying to predict what will happen next in the markets. Consequently, when you get it right, it's nothing more than a coincidence of facts.
An interesting point here is that perhaps will never be possible to predict exactly when a crisis will happen, but it is possible to understand that a crisis is imminent with a certain degree of probability - which always brings us a certain degree of uncertainty as well. The problem lies in ignoring the degree of uncertainty and finding that only a high probability is a "guarantee" of occurrence of a particular event. Toss a coin 100 times gives you a high probability of a certain amount of "heads" happening - close to 50% - but nothing prevents you from having 100 "tails" in a row. Okay, it's rare, but nothing says it cannot happen.
Let's do a practical test. Check on the chart below the results from a 1000 coin tosses simulation.
A simple simulation of tossing a coin 1000 times, using Microsoft Excel (for the sake of the argument, lets forget questions such as if the RAND function is random and what is randomness), shows us in the following chart an idea of what can happen. In this example, in 1000 "tosses", a sequence of 15 heads (maximum value in a row obtained) occurred 2 times and in 16 times we had a sequence greater than 10.
What do we conclude from this, and what does this have to do with investments or trading?
The first point here is the fact most ignored by the beginners: "this stock has already gone up too much, it has been going up for 10 days ... it will go down, for sure". As we saw above in the coin toss example, if the coin were an stock share and the "head" was a bullish day, we saw that the stock would have gone up "15 days in a row", twice in a period of 1000 days. And we cannot forget that we had 16 times with more than 10 hypothetical bullish days.
This leads us to the second point: is it possible to profit from this? Yes, but never neglect the fact that we can perhaps have one single time 15, 20, or 30 heads in a row. But don't forget that your risk:return ratio, that is, how much your bet is worth is more interesting every time. It is guaranteed? Never will be...especially if the events are independent, like the toss of a coin ... but in markets, where everyone will probably be "seeing" the same event and trying to anticipate what will happen, we have the effect of the self-fulfilling prophecy. This would prove once again the efficiency of the markets and the impossibility of predicting it. One may try to predict something...but taking this guy seriously is another talk.
Finally, the third and final point is that crises are impossible to be predict, since they are examples outside of any sample - outliers. They never happened before, so it would be impossible to try to predict what never happened...it would simply be impossible to calculate the probability. Returning to our example of the 1000 tosses, how to calculate the probability of occurrence of 17 heads in a row if this never happened before?
Lets wait for our next posts!