Aristotle vs Shopenhauer. Please, don’t try to be right

Around 350 years B.C. lived Aristotle, who founded the Peripatetic school. Aristotle and his disciples’ aim was to find truth by discussing, and bouncing ideas of each other while taking nice walks under the Athenian sun. Aristotle would ask questions to find truth by induction, arriving at conclusions from known facts to reach higher levels of understanding.

Fast forward to 1831. German philosopher Arthur Schopenhauer, example of philosophical pessimism, wrote “The art of being right: 38 ways to win an argument” , his goal was not to find the truth, but to win dialectic fights. He saw discussion as a competition to which the goal was to win, instead of a way to enrich each other and humanity through arriving at better understanding of the universe.

In my life I have met many people with which it is very nice to discuss, because their clear goal is to use logic to progress together, to shine a light on the unknown, and to help each other.

I have also met quite a few people who believe the most important thing is to be right, who will use every trick in the book to win the conversation and come out on top. It is not difficult to know when you’ve met one.

Here are a few of Schopenhauer’s logical fallacies, so you can be ready to point them out and avoid these traps:

  1. The Homonymy: extend the understanding of a particular word, and the refute it triumphantly. Claiming credit for having refuted the original stament.

“You are not yet initiated into the mysteries of the Kantian philosophy.”
…”Oh, if it’s mysteries you’re talking of, I’ll have nothing to do with them.”

  1. Generalize your opponent’s specific statements: Take a proposition which has been said concretely, as though it had been said with absolute application.

“A Moor is black; but in regard to his teeth he is white; therefore, he is black and not black at the same moment.”

  1. Bandwagon Fallacy: Arguments that appeal to the growing popularity of an idea as a reason for accepting it is true.

“Increasingly, people are coming to believe that Eastern religions help us to get in touch with our true inner being. Therefore: Eastern religions help us to get in touch with our true inner being.”

  1. Fallacy of Division: If the whole has a property, then every part has this property.

“Water is liquid, therefore H20 molecules are liquid”, “Atoms are invisible, I am made of Atoms, therefore I am invisible”

  1. Straw Man Fallacy: Misrepresent a position to make it appear weaker than it actually is. Refute the misrepresentation and claim the real position has been refuted.

After Will said that we should put more money into health and education, Warren responded by saying that he was surprised that Will hates our country so much that he wants to leave it defenceless by cutting military spending.

  1. False Cause: Explain correlation as causation

Pointing to a fancy chart, Roger shows how temperatures have been rising over the past few centuries, whilst at the same time the numbers of pirates have been decreasing; thus pirates cool the world and global warming is a hoax.

  1. Slippery Slope: If we allow A to happen, then Z could happen. Therefore A should not happen.

Colin Closet asserts that if we allow same-sex couples to marry, then the next thing we know we’ll be allowing people to marry their parents, their cars and even monkeys.

  1. Ad Hominem: attack your opponent’s personal traits in an attempt to undermine their argument.

After Sally presents an eloquent and compelling case for a more equitable taxation system, Sam asks the audience whether we should believe anything from a woman who isn’t married, was once arrested, and smells a bit weird.

We need to work together in search of the solutions to our daily struggles, hence a positive Aristotelian attitude is helpful and very appreciated, whereas trying to “win” conversations is damaging and discouraging.

shopenhauer

 

Emergent behaviors and IT Projects

Did you know that the largest known ant colony goes from northern Italy to the Spanish Atlantic coast? Yet ants don’t have an architect overseeing their construction, or a centralized coordination group which tells the rest of the ants what they have to do.

Ants are simple individuals with very limited communication skills, yet they are capable of forming minimum paths from the colony to the food and form efficient ant chains moving the food to the colony.

Grasscutter ants harvest tons of grass every year which they can’t digest, bring it to their colony, cut it to the right size and place it into a garden of fungus, which eats the grass and the ants eat the fungus. It’s not one or two intelligent outliers that do this. It’s the colony that does this to feed it’s 5.000 individuals.

Termites create 6 meter high “cathedrals”, with no central coordination, just simple rules that are wired into each individual’s DNA guiding them to release certain chemicals in response to stimuli such as proximity to other chemicals.

Birds fly in organized flocks without having radio communication to coordinate their positions and speeds, following 3 simple rules: 1) avoid getting too close to neighbor, 2) steer towards average heading of neighbors 3) steer towards average position of neighbors.

Wolves hunt in packs circling the prey with no communication needed, just following two rules: 1) get close to the prey 2) when close enough to the prey, move away from other wolves.

Fish swim in groups, homogeneous groups are called schools and heterogeneous are called schoals. This reduces their chance of being eaten by a predator. This chance is further reduced by joining a schoal of bigger fish, which will be preferred by predators. One puzzling aspect of schoal selection is how a fish can choose to join a schoal of fish similar to themselves, given that they cannot know their own appeareance.

The set of rules that the individuals follow is easy to understand, but the emerging behavior of the group is in no transparent way derived from this set of rules.

Would there be a set of rules that would enable us to work efficiently in projects without the need for central coordination?

ants

Ease with uncertainty using the cosmic scale

“The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents. We live on a placid island of ignorance in the midst of black seas of infinity, and it was not meant that we should voyage far. The sciences, each straining in its own direction, have hitherto harmed us little; but some day the piecing together of dissociated knowledge will open up such terrifying vistas of reality, and of our frightful position therein, that we shall either go mad from the revelation or flee from the deadly light into the peace and safety of a new dark age.”

The Call of Cthulhu – H.P. Lovecraft

As you read this, sitting on your chair, sipping on your coffee, you are hurling through a dark, cold and incomprehensibly vast space on a gigantic ball of dirt which is rotating around our sun at 30 km/second. Us and our neighboring galaxies are rushing at 1,000km/second towards a structure we call the great attractor, with a mass of 100 quadrillion times that of our Sun and 150 million light-years away.

You are not an individual. The visible universe is composed of 1080 atoms. You are composed of 1027 of these same atoms, 99% of which form hydrogen, oxygen and carbon. These atoms that compose you, group in molecules, which group in cells, which create you. These cells are living and performing tasks like digesting your food, transporting endorphins to make you happy, or killing other beings which are inside your body so you don’t get sick.

Check out below, a kinesin protein which is walking around inside one of your cells right now, transporting some vesicles to keep the cell working.

kinesin

The universe has existed for over 14 billion years, and will exist for many billion years to come. If we compare the age of the universe to one calendar year, on the first of January we would have had the big bang, around September the solar system would have formed. Dinosaurs would have become extinct on 29th of December, and Jesus Christ would have been born on the 31st of December 5 seconds before midnight. Columbus would have reached the Americas 1.2 seconds before midnight. Your whole life, with all your trials and tribulations will have gone by in less than 0.23 cosmic seconds.

Think about this when you are worried about your performance review or your project getting delayed.

Why do we get angry?

“Anybody can become angry – that is easy, but to be angry with the right person and to the right degree and at the right time and for the right purpose, and in the right way – that is not within everybody’s power and is not easy. “
Aristotle

Wouldn’t it be great if we could control our temper at all times? If emails or conversations never resulted in our anger emotion being triggered and us feeding this feeling by responding with an aggressive language or a snappy, self-serving response?

Humans have a common set of primary emotions that become triggered due to external circumstances:

  1. Happiness: Happiness is triggered by things we like. Too little happiness is bad, causes depression and lack of will to live. Too much Happiness can be bad, it can make us take unreasonable risks and pay the consequences.
  2. Sadness: Sadness is triggered by a loss we don’t accept. Too little sadness is bad, sadness helps cope and empathise with others. Too much sadness causes depression.
  3. Fear: Fear is triggered by a threat. Being unable to feel fear will lead to foolishness and taking unreasonable risks and pay the consequences. Being too fearsome will incapacitate you from living a normal life.
  4. Disgust: Disgust helps us avoid certain parts of something. For example I may not like the noise someone makes while chewing food, but I can separate that from the whole person, I don’t reject the whole person, just a small part.
  5. Anger: Anger is triggered by disrespect of boundaries, either someone does not respect a limit you impose on them or someone is imposing a limit on you that you don’t accept.

Us humans cannot control feeling the emotion, it being triggered, what we can work on is what we do with it after it has been triggered.

  1. When happiness is triggered we can work on taking care of how we express it to avoid making others feel sad or angry. For example it’s important to be a good winner and not rub it in your opponent’s face when you win.
  2. When sadness is triggered we can work on understanding what loss we are not accepting, and finding ways to cope.
  3. When fear is triggered we can work on measuring the size of the threat. More often than not the scenarios we play in our minds are worse than the real outcome.
  4. When disgust is triggered we can work on understanding which part of the whole we don’t like and make a differentiation. Accept the person even if they wear a watch of your rival football team.
  5. When anger is triggered we can analyse which boundary the other person is breaching or imposing on you. Figure out why and what stories are you telling yourself: Is the other person a villain? (Is the other evil or stupid?) Are you a victim? (I am good, this is happening to me) Are you helpless? (Are all courses of action pointless?) Is the boundary being pressed immovable? Should you not accommodate?

In particular, email is a wonderful tool to ignite the flames of angry discussion, since email is always interpreted (what did he mean by “fine”, does he think I’m stupid? I’m sure he thinks I’m stupid! Arggg, I’ll respond copying his boss!). It would be great if we were all more conscious of our emotional intelligence, and used it to remove the obstacles limiting us from perfect collaboration.

anger

Bitcoin Algorithmic trading

I’ve been playing for the last three weeks with a fun project: Bitcoin algorithmic trading.

Kraken.com has a super easy restful api which allows to place orders with just a few lines of code. Using the api is free and you only need to pay 0.26% per trade.

For example, I can query my balance with three lines of code

<?php require_once ‘header.php’;
$res = $kraken->QueryPrivate(‘Balance’);
print_r($res);
?>

I can place an order to buy or sell bitcoin with nine lines

<?php require_once ‘header.php’;
$res = $kraken->QueryPrivate(‘AddOrder’, array(
‘pair’ => ‘XXBTZEUR’,
‘type’ => ‘sell’,
‘ordertype’ => ‘limit’,
‘price’ => ‘1200’,
‘volume’ => ‘0.0001’
));
print_r($res);
?>

I can query the last trades executed in the market in three lines

<?php require_once ‘header.php’; $res = $kraken->QueryPublic(‘Trades’, array(‘pair’ => ‘XXBTZEUR’,’since’=>’1486857244103748648′));
print_r($res);
?>

These three functions are all is needed to be able to build a program that looks at the direction the trades are going, check my balance and place an order.

I had a stroke of insight, an algorithm which could not fail: “If the last three trades are going up, buy it all. If the last three trades are going down, sell it all, else wait” I thought to myself my first lamborghini would be orange while I got to work building the program.

Instead of letting it loose with my money I thought it would be a good idea to backtest it first, to simulate how my algorithm would fare.

You can download the whole history of bitcoin trades for each market here. The following script scheduled with cron to run every morning at 5:00 am downloads the whole history of prices, loads it into a mysql table, runs my algorithm and outputs a file with each decision taken.

#!/bin/bash
cd /home/roge/programando/kraken/histdata
wget http://api.bitcoincharts.com/v1/csv/krakenEUR.csv.gz
gunzip -f krakenEUR.csv.gz
cd ..
mysql kraken <truncate_krakenEUR.sql
mysqlimport kraken –local histdata/krakenEUR.csv –columns timestamp,price,volume –fields-terminated-by=’,’
mysql kraken <create_ruleofthree.sql
php backtest_ruleofthree.php >backtest_ruleofthree.output

the output is 4.8 million lines long so I thought I’d use big data analysis tools such as jupyter/pandas/matplotlib to see what my algorithm had done in a nice chart. Below you can see how my algorithm is super efficient at giving all my money to kraken in fees. In less than 30.000 ticks I would have blown through all my savings. Back to the drawing board 🙂

bitcoinalgotrading

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Leadership and CPR

To learn certain lessons a price must be paid. Eggs may have to be broken. 

Ten years ago, I started my MBA in Instituto de Empresa, a Spanish business school. The first weekend we had a kind of offsite, to get to know each other and start working together in a fun way.

In one of the exercises, each team was given one raw egg, 10 straws, 1 meter of duct tape and scissors. We had one hour to invent a way for the egg to be dropped from two meters and not break.

Being an MBA student I was obsessed with the idea of leadership, I took charge and convinced my team to choose my idea over the others: we would build three layers of straw protection around the egg, the air inside the straws would surely protect the egg from breaking when hitting the ground.

We worked for one hour cutting the straws, putting them together with duct tape, and carefully ensuring the egg was fully covered with this air cushion. All under my upbeat leadership, guidance and weeding out of the other, lesser ideas.

Time was up, it was go time, I stood in front of the whole class, with my team backing me and let the egg fly, sure that we would triumph where others had fallen.

Splat. The egg broke making our structure look like something an intellectually challenged three year old would have thought of, totally ignoring my leadership. I had imposed my leadership on the team, imposed my idea on the team, and led them to jump off the cliff. All with a smile on my face, nice manners, and convincing words.

I was hit with a realisation I have still not forgotten:

  1. Leadership is about convincing everyone to do what you think is best. You may be totally wrong about what is best and you will only realise this once it’s too late.
  2. Let the experts lead. Listen to the experts, they will probably have better ideas than you do.
  3. The universe will act regardless of what you think it will do.
  4. Your actions and decisions have very real consequences. 

I have the utmost respect for knowledge, I believe knowledge should be in the lead. When I hire members of my team, expert knowledge is the key driver. 

If you see a man having a heart attack on the street, you may have the best leadership attitude and jump in trying to save him, but if you don’t know CPR the man will die. A bad leader will pretend to know CPR until the man is dead. A good leader will call someone who knows CPR. An amazing leader, a Leonidas, an Achilles, a John Mclane, an Optimus Prime, the stuff legends are made of, will know CPR.

Fighting over an orange

There was a mother who had two children. One day, these two children were fighting over the last orange. They both wanted it, but there was only one.
The mother weighed how to mediate in the fight, she could:

  1. Punish both and none of them have any orange.
  2. Split the orange and give half to each.
  3. Decide to give the orange to the small child because the big brother had to learn to share.
  4. Let one child split the orange and the other choose which half he prefers

Instead, the mother calmed both of them and asked them why they wanted the orange. It turned out one of them wanted an orange juice, and the other wanted an orange peel to bake muffins.

The solution became evident and the mother had successfully solved the problem. Both children were happy with the output.

I believe when there is a conflict, it usually is due to lack of understanding of the global situation. If both parties instead of venting, fussing and complaining about the lack of collaboration of the other party, calm down and aim to understand all the pieces of the problem at hand with the good will to find the best solution for all instead of overpowering the other, usually, an obvious win-win solution appears.

For this sometimes an independent third party can step in to mediate. If this party mediates, the goal will be to find this win-win. If this third party arbitrates, usually the outcome will be imposed, and not be satisfactory for both, or for any.

Let’s stop fighting about oranges 🙂

children_fight

Unskilled and unaware of it

19 April 1995. Pittsburgh. Pennsylvania. McArthur Wheeler decided to rob two savings banks. He had an infallible plan.

Since lemon juice can be used to write invisible letters which are only revealed when the letter is heated, by smearing lemon juice on his face, McArthur was certain that he would be invisible to the security cameras. He even tested it by taking a selfie with a polaroid, which for some reason came out blank. When he was caught by the police after being identified by reviewing the security footage, his comment was: “But I was wearing the Juice!”

Psychologists Dunning and Kruger studied this case and arrived at the conclusion that the less competent an individual is at a specific task, the more likely they are to inflate their self-appraised competence in relationship to that task. This phenomenon is today known as the Dunning-Kruger effect.

We can see examples of the Dunning-Kruger effect in :

  • Shows like American Idol where we see people who clearly can’t sing, who are surprised and complain when they get rejected.
  • Nobel prize winning economists losing $4.6Bn in 4 months in Long-Term Capital Management.
  • Billionaire businessmen running for president of the USA
  • Amateur investors losing money in bitcoin investments

To some degree we all suffer the Dunning-Kruger effect. It is wise to acknowledge this and be self-critical when evaluating the work of others.

dunningkruger