Navigation
SYSTEM ANALYSIS AND DESIGN Decision Trees and Decision Tables
Unit 1: Decision Trees and Decision Tables
1. Introduction
In system analysis, many processes involve conditional logic:
- If customer is gold member and order > $100 and product is in stock, then apply 15% discount and free shipping.
- Else if customer is gold member but order < $100, then apply 10% discount only.
- Else …
When there are multiple conditions (3, 4, or more) and many possible combinations, writing nested IF‑THEN‑ELSE statements in structured English becomes confusing, error‑prone, and hard to validate with users.
Two graphical/textual techniques help:
- Decision Trees – Visual, hierarchical diagram.
- Decision Tables – Tabular, matrix format.
Both represent the same logic; the choice depends on audience preference and complexity.
2. Decision Tree
2.1 What is a Decision Tree?
A decision tree is a diagram that shows the sequence of decisions (conditions) and the resulting actions. It looks like an upside‑down tree:
- Root node – the first condition to evaluate.
- Branches – possible outcomes of a condition (yes/no, value ranges).
- Leaf nodes – final actions (or sometimes further conditions).
2.2 Basic Symbols
| Symbol | Meaning |
|---|---|
| Rectangle (or circle) | Condition node (decision point) |
| Lines (branches) | Possible values (e.g., Yes/No, High/Medium/Low) |
| Oval (or rounded rectangle) | Action (final outcome) |
2.3 When to Use a Decision Tree
- Number of conditions is small (typically 3–5) because the tree grows exponentially.
- You want to visually show the sequence of decisions (order matters).
- The logic has asymmetric paths – some conditions are skipped depending on earlier answers.
- You are presenting to non‑technical users who find trees intuitive.
2.4 Example Decision Tree
Business rule: Calculate shipping cost for an online store.
Conditions:
- Membership: Gold, Silver, None
- Order total: >= $100, < $100
- Shipping speed: Standard, Express
Actions:
- Free shipping, $5.99, $9.99, $14.99, $19.99, $24.99 shipping.
2.5 Steps to Build a Decision Tree
- Identify the decision – What are we trying to decide? (e.g., shipping cost, loan approval).
- List all conditions – Order them from most important to most specific.
- List all possible actions – Outcomes.
- Draw root condition – Branches for each possible value.
- Attach condition/action – For each branch.
- Check completeness – Ensure every combination leads to an action.
2.6 Advantages & Disadvantages
| Advantages | Disadvantages |
|---|---|
| Easy to understand visually | Becomes huge with >4–5 conditions |
| Shows sequence (order matters) | Redundant subtrees (same pattern repeated) |
| Good for asymmetric logic | Difficult to verify completeness visually |
3. Decision Tables
3.1 What is a Decision Table?
A decision table is a matrix listing all conditions, combinations, and actions. It is a complete, compact representation of logic.
3.2 Structure of a Decision Table
A decision table has four quadrants:
- Condition Stubs – List of all conditions (e.g., Membership, Order Total).
- Condition Entries – Specific values for each rule (column).
- Action Stubs – List of all possible actions.
- Action Entries – Which actions are taken for each rule (X).
Number of rules = product of the number of values for each condition ($2^n$ if binary).
3.3 Types of Decision Tables
- Limited entry: Only True/False (Y/N). Most common.
- Extended entry: Multiple values (e.g., Gold/Silver/None).
- Mixed entry: Combination of both.
3.4 When to Use a Decision Table
- Number of conditions is moderate (3–6).
- You need a complete, verifiable specification.
- The order of conditions does not matter.
- Compact representation that can be automated (e.g., code).
3.5 Example Decision Table (Shipping Cost)
3.6 Rule Reduction (Merging)
Rules that have the same action and differ in only one condition can be merged by replacing that condition with a "don’t care" (- or *****).
3.7 Steps to Build a Decision Table
- Identify the decision and factors.
- List all conditions and possible values.
- List all actions.
- Calculate number of rules.
- Fill combination systematically.
- Determine actions for each rule.
- Reduce table by merging identical action rules.
- Validate completeness and check for contradictions.
4. Decision Tree vs. Decision Table Comparison
| Feature | Decision Tree | Decision Table |
|---|---|---|
| Best for | Small number of conditions (≤4) | Larger number of conditions |
| Readability | High (visual, intuitive) | Medium (requires training) |
| Completeness | Hard to verify | Easy to verify |
| Order | Important (sequential) | Not important |
5. Summary and Practical Tips
- Start with a Decision Tree for user workshops and interviews.
- Convert to a Decision Table for formal specification and developer validation.
- Keep tables manageable – if >20 columns, split into sub-tables.
- Rule reduction is essential for readability – use don't cares early.
DECISION TREES AND DECISION TABLES
1. Introduction
In system analysis, many processes involve conditional logic:
- If customer is gold member and order > $100 and product is in stock, then apply 15% discount and free shipping.
- Else if customer is gold member but order < $100, then apply 10% discount only.
- Else …
When there are multiple conditions (3, 4, or more) and many possible combinations, writing nested IF‑THEN‑ELSE statements in structured English becomes confusing, error‑prone, and hard to validate with users.
Two graphical/textual techniques help:
- Decision Trees – Visual, hierarchical diagram.
- Decision Tables – Tabular, matrix format.
Both represent the same logic; the choice depends on audience preference and complexity.
2. Decision Tree
2.1 What is a Decision Tree?
A decision tree is a diagram that shows the sequence of decisions (conditions) and the resulting actions. It looks like an upside‑down tree:
- Root node – the first condition to evaluate.
- Branches – possible outcomes of a condition (yes/no, value ranges).
- Leaf nodes – final actions (or sometimes further conditions).
2.2 Basic Symbols
| Symbol | Meaning |
|---|---|
| Rectangle (or circle) | Condition node (decision point) |
| Lines (branches) | Possible values (e.g., Yes/No, High/Medium/Low) |
| Oval (or rounded rectangle) | Action (final outcome) |
2.3 When to Use a Decision Tree
- Number of conditions is small (typically 3–5) because the tree grows exponentially.
- You want to visually show the sequence of decisions (order matters).
- The logic has asymmetric paths – some conditions are skipped depending on earlier answers.
- You are presenting to non‑technical users who find trees intuitive.
2.4 Example Decision Tree
Business rule: Calculate shipping cost for an online store.
Conditions:
- Membership: Gold, Silver, None
- Order total: >= $100, < $100
- Shipping speed: Standard, Express
Actions:
- Free shipping, $5.99, $9.99, $14.99, $19.99, $24.99 shipping.
2.5 Steps to Build a Decision Tree
- Identify the decision – What are we trying to decide? (e.g., shipping cost, loan approval).
- List all conditions – Order them from most important to most specific.
- List all possible actions – Outcomes.
- Draw root condition – Branches for each possible value.
- Attach condition/action – For each branch.
- Check completeness – Ensure every combination leads to an action.
2.6 Advantages & Disadvantages
| Advantages | Disadvantages |
|---|---|
| Easy to understand visually | Becomes huge with >4–5 conditions |
| Shows sequence (order matters) | Redundant subtrees (same pattern repeated) |
| Good for asymmetric logic | Difficult to verify completeness visually |
3. Decision Tables
3.1 What is a Decision Table?
A decision table is a matrix listing all conditions, combinations, and actions. It is a complete, compact representation of logic.
3.2 Structure of a Decision Table
A decision table has four quadrants:
- Condition Stubs – List of all conditions (e.g., Membership, Order Total).
- Condition Entries – Specific values for each rule (column).
- Action Stubs – List of all possible actions.
- Action Entries – Which actions are taken for each rule (X).
Number of rules = product of the number of values for each condition ($2^n$ if binary).
3.3 Types of Decision Tables
- Limited entry: Only True/False (Y/N). Most common.
- Extended entry: Multiple values (e.g., Gold/Silver/None).
- Mixed entry: Combination of both.
3.4 When to Use a Decision Table
- Number of conditions is moderate (3–6).
- You need a complete, verifiable specification.
- The order of conditions does not matter.
- Compact representation that can be automated (e.g., code).
3.5 Example Decision Table (Shipping Cost)
3.6 Rule Reduction (Merging)
Rules that have the same action and differ in only one condition can be merged by replacing that condition with a "don’t care" (- or *****).
3.7 Steps to Build a Decision Table
- Identify the decision and factors.
- List all conditions and possible values.
- List all actions.
- Calculate number of rules.
- Fill combination systematically.
- Determine actions for each rule.
- Reduce table by merging identical action rules.
- Validate completeness and check for contradictions.
4. Decision Tree vs. Decision Table Comparison
| Feature | Decision Tree | Decision Table |
|---|---|---|
| Best for | Small number of conditions (≤4) | Larger number of conditions |
| Readability | High (visual, intuitive) | Medium (requires training) |
| Completeness | Hard to verify | Easy to verify |
| Order | Important (sequential) | Not important |
5. Summary and Practical Tips
- Start with a Decision Tree for user workshops and interviews.
- Convert to a Decision Table for formal specification and developer validation.
- Keep tables manageable – if >20 columns, split into sub-tables.
- Rule reduction is essential for readability – use don't cares early.
