**Q:** How are the values displayed decision trees calculated?

**A:** The following algorithm is used:

- Expand all reference nodes (internal and external).
- Enumerate all the possible paths through the tree.
- For each path calculate the end value associate with this path.
The end value is the sum of all the branch values on that path. If a payoff function is specified for any of the nodes, this is applied to the branch before the summation.**Cumulative Trees**:The end value is calculated by evaluating either the default formula specified at the tree root or the custom formula specified at the end node.*Formula Trees:*Walking through the tree along the path, from left to right, substitute each branch value into the cell specified as the linked cell for the parent node (i.e. the node which the branches originate from). The old contents of the cells which are replaced by these branch values are stored internally so they can be restored at the end of the calculation. When an end node is reached, the spreadsheet is recalculated, and the end value for that particular node is taken from the cell specified for the end node. Notice, if two branch values along a path are sent to the same cell, the first one is overwritten by the second, and thus the first value will have no effect.**Linked Trees**: - If a utility function was specified, convert each of the end values into their corresponding utility.
- Now "Rollback" the tree by following these steps
- For each node which only has end nodes as successors, determine the expected value (or expected utility) by
Take the average of the end values weighted by their corresponding probabilities.**Chance Nodes**:Use the value of the optimal branch (maximum or minimum). Ties are always broken by selecting the topmost branch.**Decision Nodes**:Use the expected value of the path specified as "TRUE" by the branch logic statements. If no branches are "TRUE", an error value is returned. If more than one logic statement evaluates to "TRUE", then the expected value is the average of all the branches that are "TRUE" (in other words, the logic node is treated like a Chance Node with probabilities equally distributed among all the branches that evaluate to "TRUE").**Logic Nodes**: - The value (or utility) calculated in A) is displayed next to the node. The optimal branch chosen for any Decision Nodes is indicated by a "TRUE" or "FALSE" statement next to the branches.
- Once all such nodes have been resolved, conceptually convert the calculated nodes into end nodes, with end values (or utilities) equal to the values determined in A).
- Repeat Step A) until there is only a single end node left in the tree.

- For each node which only has end nodes as successors, determine the expected value (or expected utility) by

- If a utility function is used and the output display is set to "Certainty Equivalent", the expected utilities are mapped back into "value units" before being displayed by using the inverse utility function.
- For each path, determine the end probabilities by multiplying all the probabilities of each branch along that path. If a branch emanated from a decision or logic branch which was not taken, the probability is zero.