courtesy indiana university southeast

What we learn from computer science about making the best decisions

Agency, or the power to choose, is the great problem to be solved

Matt Holt
8 min readNov 23, 2013

--

A brief introduction

Computers are really good at solving problems. Usually.

A lot of computer science research is devoted to algorithms, or step-by-step procedures for solving problems.The way you learned to multiply numbers in grade school is an algorithm. Food recipes are algorithms. Musical scores are algorithms. You get the idea.

“Computer science is no more about computers than astronomy is about telescopes.” —Dijkstra (possibly)

Some algorithms are very efficient: for example, finding a student’s paper in a stack of papers sorted by name. It should only take you a few seconds to thumb through that stack and find what you need.

On the other hand, some algorithms are harder, or less efficient. How did you sort that stack of papers? Did you just throw them in the air until they landed in sorted order? Probably not; that would take too long.

Bubble sort. Source: Wikipedia

Maybe you looked at two papers at a time, ordered them, and kept doing that until you went through the whole stack enough times that all the pages were in the right order. (Still incredibly slow. There are faster ways.)

Sorting is easy. Some problems are so hard that, without certain constraints, it would take today’s fastest computers longer than the age of the universe to solve precisely.

What do you do with choice and uncertainty?

Many of the hardest problems we ask computers to solve are about decisions we should make. (Not all hard problems involve decisions. Factoring prime numbers, finding the discrete logarithm of part of an elliptical curve, and others, are also very difficult.)

There’s a class of problems studied and applied in computer science called sequential decision-making problems. These problems ask the question, “What should I do now and in the future to reach my goal?” Retailers ask this question a lot when considering inventory: “How many things should I order today so that my costs are minimized?”

Generally, decision problems relate one day (or period) to another using three variables:

  1. Current state
  2. A decision that affects the next state
  3. Uncertainty (things you can’t control)

In the retailer example, respectively:

  1. How many items are currently in stock
  2. The choice of how many items to stock for tomorrow
  3. Customer demand (either too many items in stock or not enough)

Ideally, you would hand the store owner a sheet of paper with a list of all the decisions to make: on day 1, order __ items, on day 2, order __ items; etc. This is only possible if there was no uncertainty (#3)—you would have to know precisely how many items would actually be bought by customers every day. The store owner doesn’t have any choices to make then: just follow the programme without variation.

In reality, we’re faced with uncertainty. Customers may not buy all the stock. Or they may buy all of it and the rest go to competitors to buy it. Either way, it’s not optimal and the store suffers because of it.

How is the answer delivered, then? We’ll end up handing the store owner a table of optimal decisions that relates where they’re at to which decision to make. Computing this table can be very hard, but making the decision using the table is much easier: the store owner simply crosses the day with how many items are in stock, and makes the decision that’s in that cell of the table.

The decision may not always appear to make sense, but it can be proven that it is, in fact, the optimal choice to get you where you want to go in the long run. (We can choose another option in that table, but it may be less-than-optimal and we have to make up for it later if we want to stay on the right track.)

Solving the decision problem

Computer scientists call the solution to the decision problems dynamic programming. It’s an algorithm which relates one day to another, considering where you’re currently at, where you want to go, things out of your control, and the cost/consequences if you make a poor choice.

A simplified dynamic programming problem graph

It’s a very interesting analogy to real life.

Dynamic programming actually starts at the last day or time period, as if you have already reached your goal. It then steps back one period and considers all the possible ways for the uncertainty (customer choices, etc) to play out. And for each possibility, it computes the expected results of all the possible choices you could make. The choices which drive you closest to your goal get written into the table of optimal decisions.

“Life can only be understood going backwards, but it must be lived going forwards.” —Kierkegaard

As you might imagine, this algorithm branches out very quickly as the uncertainties and timeframes grow. It’s one of those problems that could take a computer millions of years to solve accurately if tight limits are not defined.

I should mention: merely owning a table of decisions does not pre-define or determine one’s choices: you’re not limited to the choices computed. Any other possible choices not on the list or table are still valid, but have not been analyzed for consequences.

What makes all these choices, so many that we literally cannot count them, possible? Is that good or detrimental?

The “curse” of dimensionality

Answering those questions will lead us to important points about agency.

Recall that uncertainty is comprised of outside forces we can’t control, such as other people’s choices, market conditions, the weather, etc.

Our retailer friend is considering only one element of uncertainty in our example: customers’ buying actions. But there are any number of factors that are out of the retailer’s control which affect sales. What happens if we consider all of them, too?

Knowing how hard it can be to produce a 2-dimensional table where one axis is the time period and the other axis is the one element of uncertainty we’re considering (customers’ actions), imagine producing a 3-dimensional table considering just one more element of uncertainty. Now consider all possible uncertainties. The resulting table is unfathomable.

Dimensionality. Image courtesy Yoshua Bengio

Computers simply cannot produce such a table. For that, dimensionality is a curse. For the myriad of seemingly infinite choices available, it is great freedom.

Lessons learned

So, what do we take away from all this?

Lesson 1: Agency is a mutual contract

We exercise agency by making decisions. The decisions we make affect others, directly or not. These effects translate into uncertainty for other people’s decision problems, because you are an outside force they cannot control.

When we make choices that restrict or limit other people’s agency, we, in effect, limit our own. With a new element of uncertainty that adds a dimension to our decision table comes a profusion of new possible choices. If that element of uncertainty is removed (because, for example, someone’s agency is limited), then we lose that whole dimension of choices. It’s not that we are merely not considering them in our computation, but they are gone.

To illustrate with a contrived example, imagine that your friend, for whatever reason, could never wear a red shirt; it’s not that he/she chooses not to, it’s just simply not on the programme. As a result, you will never be able to choose how to respond to him/her wearing a red shirt. Thus, that whole dimension of choices disappears for you.

So we see that agency is, in some sense, a mutual contract. If no one around you had any agency, your own degree of choices would be severely limited because the possibilities from uncertainty in your decision problem are also drastically reduced.

Lesson 2: Optimal decisions → Optimal result

The correctness of the dynamic programming algorithm proves that making optimal decisions in sequence produces the optimal result.

What is your optimal end? Are your choices getting you there?

Lesson 3: There are no shortcuts

As inefficient as the dynamic programming algorithm is, it is a very effective way of solving such decision problems accurately. We cannot shortcut our way to our desired result; we must face every decision point along the way and welcome the consequences of those decisions.

Lesson 4: Wrong decisions can be recovered

Dynamic programming was proven correct (see the link in Lesson 2 above) because it solves smaller versions of the same problems (called sub-problems) correctly. For example, the best route from Salt Lake City to Los Angeles goes through Las Vegas. Once you get to Las Vegas, what’s the best route from there to Los Angeles? It’s the same one as part of your original route starting from Salt Lake City.

The point is, it doesn’t matter where you start or what happens to you, and it especially doesn’t matter how you got to where you’re at. It’s just a new part of the same decision problem: agency.

Even if you took a wrong turn, you can still find the best route to where you’re going from where you’re at. True, it will be more costly than if you had made all optimal decisions, but an optimal path does exist from wherever you’re at.

Lesson 5: Begin with the end in mind

Making the best decisions is only feasible when you know where you want to end up. Dynamic programming starts at that end and works backward, so to speak, until it reaches the starting point. And the starting point is always where you’re currently at.

By doing this, the end result is considered above all else. It’s the big picture. It’s driving to a known destination. It’s taking the next step with a higher vision than just that step. It’s altering course when necessary to achieve your goal. It’s the opposite of flying blind!

Solving the great decision problem: agency

How will we use our agency? We are lucky to face such a problem, in that we’re not handed a list of decisions already pre-made for us. There is uncertainty, there is complexity, and there’s plenty of good choices (and bad ones) to go around.

Our agency is incredible. Though it is truly ours, the breadth and depth of possibilities is unknown to us. It is nigh impossible for us to predict or compute with complete certainty the table of optimal decisions.

We must simply make the best decisions at every point along the way.

So what are those optimal decisions? What is that table?

I suppose that’s up to you. As for me, I believe that we all have access to a table, so to speak, to help us get where we want to be, or to become who we want to become. I believe there is a series of choices that will make us ultimately happy.

--

--