Decision Tree Builder

Build any decision tree in your browser, fold it back, check your own fold, and find how far one estimate can move before the best first move changes.

Before you build

Draw the tree on paper first, the way Week 5 teaches it, then build it here to check your fold or to take on a tree too big to fold by hand. A square is a decision you make, a circle is chance, and a triangle ends a branch with its payoff. The builder folds back the way you do: it averages at every circle and keeps the best branch at every square. Everything runs in your browser, and nothing you build is uploaded anywhere.

New to it? Take the two-minute tour. It works on a small practice tree, and your own tree comes back when it ends.

Build a tree

  • Start from the File menu: New tree, one of the examples, a saved file, or Start from a payoff table, which turns a table pasted from Excel or Google Sheets into one square, a circle for each decision, and an end for each cell.
  • Select a node by clicking it. A dashed ring marks it, the bar above the tree names it, and the Node tab of the side panel shows its branches.
  • Add a branch by clicking the dashed + branch under a selected square or circle, or + Option or + Outcome in the bar above the tree.
  • Change a node’s shape with the square, circle and triangle buttons in that bar. Turning a node into an end removes everything to its right, and Undo brings it back.
  • Edit on the tree: double-click a branch name, a probability, a cost or a payoff to change it where it is.
  • Edit in the side panel: every field is in the Node tab too, with Insert a square before and Insert a circle before, which slide a new decision or chance node in front of the selected one.
  • Copy and paste part of a tree: Copy takes the selected node and everything to its right, and Paste puts it over another node.
  • Collapse a square or circle to tuck away everything to its right while you work on another part of a big tree. A badge such as +6 stands for the hidden nodes; click it, or Expand, to bring them back. Hidden nodes still count when the tree folds back.

Tab moves from the page into the tree. With a node selected there, the keyboard does the same things:

Key What it does
+ or A Add a branch
D, C or E Make the node a square, a circle or an end
H Collapse or expand everything to the right of the node
Delete Delete the branch that leads to the node
Ctrl+C, then Ctrl+V Copy from this node, then paste over another node
Enter Edit the node in the side panel
Arrow keys Move between nodes; the right arrow also expands a node
Ctrl+Z, Ctrl+Shift+Z Undo and redo; on a Mac, Cmd works in place of Ctrl

Right-clicking a node selects it and moves you to the bar above the tree.

Room to work

  • Zoom with − and + in the corner of the tree, or hold Ctrl (Cmd on a Mac) and scroll. Fit shows the whole tree at once.
  • Move around a big tree by dragging an empty part of the drawing, or with the scroll bars.
  • Hide panel gives the tree the full width. Show panel brings the side panel back, and so does double-clicking a node.
  • Full screen gives the builder the whole browser window; Esc leaves it.

How it reads your tree

  • The squares and circles are numbered the way Taylor numbers the nodes in his figures: 1 is the first node, and the count runs down one column at a time, left to right, so node 3 on the screen is node 3 in your working. View turns the numbers off.
  • A cost goes on the branch where it is paid, as a negative number in Cash on this branch. The builder subtracts it at that branch, as Taylor does in his sequential example (Taylor 13e, pp. 593–595), so the value at every node matches a hand fold. Type the minus sign: -60, not (60). Brackets alone do not make a number negative, so the builder asks for the sign.
  • The probabilities out of each circle must add to 1. Type # as one outcome’s probability and it takes whatever the others leave: 0.3 on one branch and # on the other makes the second 0.7, and it keeps up when you change the first. Anything that stops the tree from folding is listed in the Answer tab, with a Show me button that takes you to the box to fix.
  • Any box that takes a number takes arithmetic too: 1-p, 0.6*80, 40%, 1,200,000. A named input can be built from others, so a posterior can be written straight from a prior and a track record by Bayes’ rule, as the Week 6 survey example does.
  • On a cost tree, lower is better. In View, set Best is to the lowest value, and every square keeps its cheapest branch. View also sets the units, such as $ before each number and M after it.

Fold it back, then check yourself

  • Fold back shows the value at every node. The line under the tree gives the tree’s value and the best first move, and the Answer tab adds the plan at every later square. Step one layer reveals the values from the right, one layer at a time, with the arithmetic for each, and Hide values puts them away again.
  • Check hides the values; you type your own at every square and circle, and the builder marks each one without giving the answer away.
  • Risk lists every way the recommended plan can end, with the total on that path and its chance, and gives the plan’s expected value, its standard deviation, its lowest and highest totals, and the chance of ending below 0. Pick a different first move to see how its spread compares.
  • What if sweeps a named input. Give an input a name such as p, put p and # on a circle’s two branches, and the chart shows where the best first move changes: Week 5’s flip probability. Put a name on a cost instead, such as the price of a forecast, and the price at which buying stops paying is the most that information is worth.

Keeping your work

The link in your address bar holds the whole tree and updates as you edit, so Copy a link to this tree in the File menu gives you a link that reopens it exactly, and this browser keeps your last tree until you start a new one. Save as a file downloads a .json file that Open a saved file brings back, and the File menu’s PNG and SVG downloads give you a picture for a report: the whole tree on a white background, with any collapsed part drawn out. Press Fold back first if you want the values in it. The Week 5 and Week 6 take-homes ask for this picture, uploaded with the workbook.

The builder checks your work; it does not replace the method. The exams give you a calculator and no software, and the Week 5 and Week 6 take-homes want their Excel work as well as the picture, so keep folding by hand until you can say why each pruned branch was pruned.