Decision Trees
by @evgyur
Decision tree analysis for complex decision-making across all domains. Use when user needs to evaluate multiple options with uncertain outcomes, assess risk/reward scenarios, or structure choices systematically. Applicable to business, investment, personal decisions, operations, career choices, product strategy, and any situation requiring structured evaluation. Triggers include decision tree, should I, what if, evaluate options, compare alternatives, risk analysis.
clawhub install decision-treesπ About This Skill
name: decision-trees description: Decision tree analysis for complex decision-making across all domains. Use when user needs to evaluate multiple options with uncertain outcomes, assess risk/reward scenarios, or structure choices systematically. Applicable to business, investment, personal decisions, operations, career choices, product strategy, and any situation requiring structured evaluation. Triggers include decision tree, should I, what if, evaluate options, compare alternatives, risk analysis.
Decision Trees β Structured Decision-Making
Decision tree analysis: a visual tool for making decisions with probabilities and expected value.
When to Use
β Good for:
β Not suitable for:
Method
Decision tree = tree-like structure where:
Process: 1. Define options β all possible actions 2. Define outcomes β what can happen after each action 3. Estimate probabilities β how likely is each outcome (0-100%) 4. Estimate values β utility/reward for each outcome (money, points, utility units) 5. Calculate EV β expected value = Ξ£ (probability Γ value) 6. Choose β option with highest EV
Formula
EV = Ξ£ (probability_i Γ value_i)
Example:
Classic Example (from Wikipedia)
Decision: Go to party or stay home?
Estimates:
Tree:
Decision
ββ Go to party
β ββ Take jacket
β β ββ Cold (70%) β 9 utility (party)
β β ββ Warm (30%) β 9 - 2 = 7 utility (carried unnecessarily)
β β EV = 0.7 Γ 9 + 0.3 Γ 7 = 8.4
β ββ Don't take jacket
β ββ Cold (70%) β 9 - 10 = -1 utility (froze)
β ββ Warm (30%) β 9 utility (perfect)
β EV = 0.7 Γ (-1) + 0.3 Γ 9 = 2.0
ββ Stay home
ββ EV = 3.0 (always)
Conclusion: Go and take jacket (EV = 8.4) > stay home (EV = 3.0) > go without jacket (EV = 2.0)
Business Example
Decision: Launch new product?
Estimates:
Tree:
Launch product
ββ Success (40%) β +$500K
ββ Failure (60%) β -$200KEV = (0.4 Γ 500K) + (0.6 Γ -200K) = 200K - 120K = +$80K
Don't launch
ββ EV = $0
Conclusion: Launch (EV = +$80K) is better than not launching ($0).
Trading Example
Decision: Enter position or wait?
Estimates:
Tree:
Enter position
ββ Rise (60%) β +$100
ββ Fall (40%) β -$50EV = (0.6 Γ 100) + (0.4 Γ -50) = 60 - 20 = +$40
Wait
ββ No position β $0
EV = $0
Conclusion: Entering position has positive EV (+$40), better than waiting ($0).
Method Limitations
β οΈ Critical points:
1. Subjective estimates β probabilities often "finger in the air" 2. Doesn't account for risk appetite β ignores psychology (loss aversion) 3. Simplified model β reality is more complex 4. Unstable β small data changes can drastically alter the tree 5. May be inaccurate β other methods exist that are more precise (random forests)
But: The method is valuable for structuring thinking, even if numbers are approximate.
User Workflow
1. Structuring
Ask:
2. Probability Estimation
Help estimate through:
3. Visualization
Draw tree in markdown:
Decision
ββ Option A
β ββ Outcome A1 (X%) β Value Y
β ββ Outcome A2 (Z%) β Value W
ββ Option B
ββ Outcome B1 (100%) β Value V
4. EV Calculation
For each option:
EV_A = (X% Γ Y) + (Z% Γ W)
EV_B = V
5. Recommendation
Option with highest EV = best choice (rationally).
But add context:
Application Examples by Domain
Trading & Investing
Position Sizing:
Entry Timing:
Business Strategy
Product Launch:
Hiring Decision:
Personal Decisions
Career Change:
Real Estate:
Operations
Capacity Planning:
Vendor Selection:
Calculator Script
Use scripts/decision_tree.py for automated EV calculations:
python3 scripts/decision_tree.py --interactive
Or via JSON:
python3 scripts/decision_tree.py --json tree.json
JSON format:
{
"decision": "Launch product?",
"options": [
{
"name": "Launch",
"outcomes": [
{"name": "Success", "probability": 0.4, "value": 500000},
{"name": "Failure", "probability": 0.6, "value": -200000}
]
},
{
"name": "Don't launch",
"outcomes": [
{"name": "Status quo", "probability": 1.0, "value": 0}
]
}
]
}
Output:
π Decision Tree AnalysisDecision: Launch product?
Option 1: Launch
ββ EV = $80,000.00
ββ Success (40.0%) β +$500,000.00
ββ Failure (60.0%) β -$200,000.00
Option 2: Don't launch
ββ EV = $0.00
ββ Status quo (100.0%) β $0.00
β
Recommendation: Launch (EV: $80,000.00)
Final Checklist
Before giving recommendation, ensure:
Method Advantages
β Simple β people understand trees intuitively β Visual β clear structure β Works with little data β can use expert estimates β White box β transparent logic β Worst/best case β extreme scenarios visible β Multiple decision-makers β can account for different interests
Method Disadvantages
β Unstable β small data changes β large tree changes β Inaccurate β often more precise methods exist β Subjective β probability estimates "from the head" β Complex β becomes unwieldy with many outcomes β Doesn't account for risk preference β assumes risk neutrality
Important
The method is valuable for structuring thinking, but numbers are often taken from thin air.
What matters more is the process β forcing yourself to think through all branches and explicitly evaluate consequences.
Don't sell the decision as "scientifically proven" β it's just a framework for conscious choice.