Ch 7. Trees
7.3 Decision Trees
In IT and business, important decisions often need to be made, and they involve arranging criteria hierarchically to predict a classification or value. This is often achieved using a decision tree, which consists of
- a root node, which is the starting point of the decision process,
- internal nodes, which represent tests or conditions (e.g., “Is temperature [latex]> 20^{\circ} C[/latex]?”),
- branches, which represent the outcomes of tests (e.g., “Yes” or “No”), and
- leaf nodes, which represent final decisions or classifications (e.g., “Turn on heater”).
Each path from the root to a leaf represents a unique sequence of decisions leading to a conclusion.
Example 7.13
Many computer networks use decision trees to determine whether a user should be granted access to a secure resource. The system evaluates three conditions:
Condition 1: Is the user authenticated?
Condition 2: Is the user an administrator?
Condition 3: Is the resource classified as sensitive?
The decision tree models the logic as follows:

From this decision tree, note that access is immediately denied if the user is not authenticated. If the user is authenticated and is an administrator, then they are granted access regardless of resource sensitivity. On the other hand, if the user is authenticated but not an administrator, their access depends on whether the resource is sensitive.
This example illustrates that decision trees help enforce policies through a clear, rule-based structure. These rules can be implemented in code using nested if-else statements or switch-case logic.
Real-World Example 7.3: IT Helpdesk Troubleshooting System
At IT helpdesks, decision trees are often used to guide support agents through diagnosing and resolving common technical issues. Consider the scenario of troubleshooting a network connectivity issue. The decision tree evaluates the following conditions:
- Is the device connected to Wi-Fi or Ethernet?
- Can the device ping the default gateway?
- Can the device resolve DNS queries?
- Is the issue affecting multiple users or just one?
The decision tree might look like the following:

There are four outcomes as follows:
- Check the network adapter if the device is not connected
- Restart the router if the device is connected but cannot ping the gateway
- Flush the DNS cache if ping works but DNS fails
- Conclude the issue may be server-side if all checks pass
The benefits of this approach are that it reduces resolution time by guiding agents through a structured diagnostic path, ensures consistency in troubleshooting across support staff, and can be implemented as a rule-based expert system or integrated into chatbot support.