# Algorithms: How to Program Yourself for Good Decisions

In his book, Homo Deus, historian Yuval Noah Harari writes1:

Algorithm’ is arguably the single most important concept in our world. If we want to understand our life and our future, we should make every effort to understand what an algorithm is, and how algorithms are connected with emotions.

So, what is an algorithm?

The dictionary defines it as “a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.”

If you’ve ever wondered how a Tesla can drive itself, the answer is algorithms — millions of them.

But there are also more relatable, everyday occurrences of algorithms.

Each time you bake a cake, for example, the recipe you use is an algorithm.

## Mental Algorithms

Interestingly, psychologists have found that you can also use algorithms to program yourself for better decision making.

Psychology professor Peter Gollwitzer refers to this strategy as “if-then planning,”2 and to use it, all you have to do is fill out this simple formula:

`If [situation] – Then I will [behavior].`

The beauty of if-then planning is that it forces you to turn vague intentions into clear algorithms.

“I want to eat healthier” becomes “If I’m buying lunch, then I will order a salad.”

It sounds ridiculously simple, but don’t let that fool you.

## The Power of If-Then Planning

More than 200 scientific studies show that if-then planners are about 300% more likely to achieve their goals.

The reason it works so exceptionally well, according to psychologist Heidi Grant, is that3:

“Contingencies are built into our neurological wiring. Humans are very good at encoding information in “If X, then Y” terms, and using those connections (often unconsciously) to guide their behavior.”

In other words: Much like computers, our minds respond very well to algorithms.

If-then plans allow you to act the way you want without thinking, and that saves a lot of mental energy for other decisions.

Instead of hesitating and deliberating, you just follow the algorithm whenever the situation arises.

Rather than relying on vague intentions, purposely install the responses that will lead you to your goals. Here are some examples:

• “I want to move more.” → If I’m at work, then I will take the stairs.
• “I want to be more productive.” → If I arrive at the office, then I will do two hours of deep work.
• “I want to improve my relationships.” → If I come home from work, then I will share the best thing that happened to me that day.
• “I want to be happier” → If I wake up in the morning, then I will think about one thing I’m grateful for.

Think of yourself as a robot and the if-then plans as the algorithms you use to program yourself.

It seems silly, I know, but it’s a remarkably effective way of putting good decisions on autopilot. 🙂

## Improve Your Life in 5 Minutes a Week

Get my free One Percent Better newsletter.

It’s short, actionable, and loved by 7,000+ subscribers.