Next Article in Journal
Exploiting the Regularized Greedy Forest Algorithm Through Active Learning for Predicting Student Grades: A Case Study
Previous Article in Journal
Research–Teaching Nexus in Electronic Instrumentation, a Tool to Improve Learning and Knowledge of Marine Sciences and Technologies
Previous Article in Special Issue
An Active Approach for Teaching and Learning Electrical Technology
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dynamic Decision Trees

1
School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213, USA
2
Computer Science Department, New York University, New York, NY 10012, USA
3
Department of Computer Science, Duke University, Durham, NC 27705, USA
4
Computer Science Department, New York University Abu Dhabi, Abu Dhabi P.O. Box 129188, United Arab Emirates
*
Author to whom correspondence should be addressed.
Knowledge 2024, 4(4), 506-542; https://doi.org/10.3390/knowledge4040027
Submission received: 27 June 2024 / Revised: 13 September 2024 / Accepted: 8 October 2024 / Published: 16 October 2024
(This article belongs to the Special Issue Decision-Making: Processes and Perspectives)

Abstract

:
Knowledge comes in various forms: scientific, artistic, legal, and many others. For most non-computer scientists, it is far easier to express their knowledge in text than in programming code. The dynamic decision tree system is a system for supporting the authoring of expertise in text form and navigation via an interface that limits the cognitive load on the reader. Specifically, as the reader answers questions, relevant tree nodes appear and irrelevant ones disappear. Searching by a keyword can help to navigate the tree. Database calls bring in information from external datasets. Links bring in other decision trees as well as websites. This paper describes the reader interface, the authoring interface, the related state-of-the-art work, the implementation, and case studies.

1. Introduction

People invent rules all the time. There are laws, rules for medical diagnosis, techniques for computing lengths in trigonometry, and debate arguments, to name a few. Historically, computer scientists developed expert systems to encode such rules [1]. The problem with such systems was that they were challenging to author for non-programmers, and they generally had a text-only reader interface [2]. Modern systems require “knowledge engineers” (alongside subject matter experts) to author expert systems using various shells, programming languages, and specialized software [3]. State-of-the-art knowledge-based systems such as MangoApps https://www.mangoapps.com/ (Issaquah, WA, USA, accessed on 11 August 2024), HelpJuice https://helpjuice.com/ (Washington, DC, USA, accessed on 11 August 2024) and FreshWorks https://freshworks.com (San Mateo, CA, USA, accessed on 11 August 2024) are primarily used for customer support and ticket tracking rather than complex decision-making. They generally require dedicated technical support [4,5,6].
Target Audience and Contributions:
The dynamic decision tree system is aimed at using non-programming domain experts (e.g., negotiators, doctors, policy makers) as authors and people without domain expertise as readers. The technical contributions are:
  • Support for a simple-to-author text description of the expert system for domain experts who are non-programmers. The text source code is also easy to maintain because authors can use standard text editors.
  • The text description is highly functional, allowing for callouts to other dynamic decision trees, to websites, and to databases.
  • The reader interface guides the reader through questions starting at the root of the decision tree. The interface makes visible to the reader only those nodes that are still possible based on the answers to those questions, thus limiting the cognitive load to the reader.
At a theoretical level, one can ask which kinds of knowledge should be encoded in human-designed rules rather than being inferred by large language model-style machine learning. The general answer, we believe, is that dynamic decision trees enjoy a comparative advantage in settings, where there are many variables and where each variable can take one or more values. We re-visit this assertion in the conclusion. Let us start by showing the functionality of dynamic decision trees.

Plan of the Paper

We first show how readers and authors interact with the system in Section 2 as well as the user interface guidelines we followed; we present special authoring commands in Section 3, a case study in Section 4, closely related work in Section 5, and functionality comparisons with similar systems in Section 6.
To see how to interact with the system both as a reader and writer, please see the site http://ec2-3-95-178-149.compute-1.amazonaws.com:8080/ (accessed 15 April 2024). Click on a radio button corresponding to an application you are interested in, and then click "Submit" to explore. Alternatively, you can create text for an application of your choice in the format described here below, paste that text into the window, and hit “Submit”.

2. Dynamic Decision Trees in Action

A decision tree is conventionally (e.g., in patents) represented as a diagram. In this case, a very primitive decision tree starts by posing the question of whether a reader is happy. If the reader says “yes”, then the reader arrives at the decision tree node “Then great”. Otherwise, if the reader says “meh”, then they are told to “get a lollipop”, and if that helps (the “yes” branch from the lollipop diamond), they are again told “Then great”; otherwise, they are told to “get more lollipops”. If the answer to the original question is “no”, then the reader is told to “see a psychologist” (a “shrink” in English slang).
Knowledge 04 00027 i001
In our system, decision trees are authored in a certain text format. Here is the same decision flowchart as an authored text file.
  • Are you happy?
  • --if yes, Then great
  • --if meh, Then get a lollipop. Did that help?
  • ----if a lot, Then great
  • ----if a little, Then get another one
  • --if no, Then see a shrink
In this format, a question q ends with a question mark and is prefixed with k hyphens, where k is an even number 0 or greater. Such a question q must be followed by at least one non-question or a question preceded by k + 2 hyphens.
Thus, two hyphens indicate a level in the tree. This means that if the reader is at the fourth level of the tree, the syntax for that line begins with eight hyphens.
All questions must end with a question mark, and all non-questions must not. Each line after question q begins with “if X”. When the reader views the box containing question q, “X” is shown to the reader in the box’s drop-down menu corresponding to the current question q. If readers select X, they view the new box containing a question or possible conclusion in addition to the previous box containing question q.
The decision tree is displayed to reader users as a flowchart that unfolds as the user selects answers to decision questions as shown in Figure 1, Figure 2, Figure 3 and Figure 4. When the reader does not know the answer, the reader can choose “NotSure”, which results in arrows pointing to all possible child nodes, as we see in Figure 5.

2.1. Searching

In addition to answering questions, a reader can search for keyword phrases and select from among the boxes that contain that phrase. Each box represents one node. There are three categories of nodes to choose from:
(i)
Boxes in the tree so far (already visited nodes).
(ii)
Boxes reachable from the current tree (nodes reachable from visited nodes).
(iii)
Other boxes (neither reachable nor visited nodes).
Searching can help readers find a path to a desirable destination node. This could be useful in a legal argument, for example, where a reader wants to frame strategies that result in an admission by a witness. If exactly one box in the larger decision tree contains the keyword, the system immediately displays the box containing the keyword. Otherwise, as in the example of Figure 6, we see the results of searching for the word “great” in our example application.

2.2. User Interface Guidelines Followed

While our interface is far from flashy, our design follows common principles of user interface design [7], as we discuss here below:
  • Consistency and standards: The decision tree adheres to the principle of consistency, using similar colors, shapes, and layouts across all nodes. This helps readers navigate through the interface without surprises.
  • Visibility of system status: The decision tree clearly indicates the current step in the process and offers alternative paths forward in the form of possible answers to the current question, thus asking readers to make local decisions in modifying the current state of their search. Readers can navigate non-locally by using the "Search" function.
  • User control and freedom: The UI allows readers to select their choices through drop-downs, checkboxes, text input, and radio buttons. So, readers control their navigation through the decision tree.
  • Labeling and instruction clarity: The question boxes pose questions and offer pull-downs that are entirely standard. The zoom capability and the instructions within the search box are self-contained. Our philosophy has been to eliminate the need for instructions by making the choices clear.
There are several aesthetic improvements that we plan for future work.
  • Color coding: Using a color-coding scheme to differentiate between decision points and outcomes could help users better understand the flow through the tree.
  • Visual cues: Implementing visual cues such as highlighting the current step and allowing selective zooming are among the enhancements we are considering.
  • Dynamic box layouts: Resizing and repositioning boxes based on the number of boxes displayed and the amount of text in each box could minimize the need for users to scroll both within the page and within each box.
Other areas of improvement include enhancements for the visually impaired. The current design relies heavily on visual elements like drop-downs and radio buttons, which pose challenges to screen readers. Furthermore, because the content and structure are not presented in a linear manner, screen readers will have trouble determining what to read. We currently envision three enhancements in future work:
  • Eliminate dependency on the mouse: It should be possible to manipulate the system entirely from the keyboard.
  • Screen reader compatibility: To enable a screen reader to help a visually impaired person navigate through a dynamic decision tree, it would be essential to ensure that all elements, such as drop-downs and buttons, are labeled with descriptive text that screen readers can interpret. This includes ensuring that the order of elements in the DOM (Document Object Model) matches the logical flow of the decision tree.
  • An alternative enhancement for the visually impaired is to support a purely voice-controlled interface.

3. Authoring a Dynamic Decision Tree

The following authoring commands allow authors to include hyperlinks, references to other dynamic decision trees and databases, and input and output to databases. As mentioned in the introduction, you can test this functionality by placing text into the box and clicking “Submit” at this website: http://ec2-3-95-178-149.compute-1.amazonaws.com:8080/ (accessed on 15 April 2024).
  • Hyperlinks: If the authored text contains the keyword DOCUMENT, the system converts everything after “DOCUMENT:” into a clickable hyperlink. For the command to work as intended, all text after “DOCUMENT:” must be a valid URL. For example, if the author wrote “If Yes, Check out this link: DOCUMENT: https://apple.com, the current node would contain “Check out this link: DOCUMENT: https://apple.com”, where “https://apple.com” is a hyperlink to the URL “https://apple.com”.
  • Reducing repetition in authoring: When constructing decision trees, authors may find that they have to repeat subtrees. For example, if two sequences of answers lead to the same diagnosis, the treatment options to present to a patient may be the same. Repeating text is both time-consuming and may result in inconsistencies if that text is changed in one place but not in another. The DECISIONTREE command solves this by allowing authors to repeat subtrees without rewriting them multiple times. The subtree is first stored in a text file in the text format of a complete dynamic decision tree. To insert a subtree into the larger decision tree, authors can use the DECISIONTREE command in the line followed by the URL of the subtree’s text file. The system then extracts the subtree text file from the link in the node and combines the decision tree from the link with the current one, forming a larger decision tree. When the reader clicks “show next”, they can continue interacting with the linked subtree as if it was a part of the original decision tree. See the box at the beginning of Section 4, as well as Figure 7 and Figure 8 for an example.
  • Collecting data from the reader: If the author’s line contains the keyword INPUT, the system displays a message to input a number to the reader. The prompt message is the substring after the first colon following the INPUT keyword and before the next special keyword. The system waits until something is input. Pressing “cancel” or the escape key prompts the reader to input a value again. Only by pressing the “OK” button can the reader avoid recording an input value. That in turn may cause an error later if a query that should include the reader’s input is executed. The author can set up several inputs, each having a distinct name. Names can be individualized by adding any characters after an INPUT keyword and before a following semicolon. For example, if the author’s line is “INPUT123: Enter a number:”, the reader is prompted to “Enter a number:” and the value the reader enters is stored in a dictionary of inputs with the key-value pair “INPUT123” and the reader-entered value. See the box at the beginning of Section 4 and Figure 9 for an example.
  • Accessing a database: Suppose the author’s line contains the keyword QUERY. In that case, the system passes the substring between “QUERY:” and the following RETURN keyword into the back end, along with the dictionary of inputs mentioned above. The system then replaces all instances of dictionary keys (e.g., INPUT123) in the query with their corresponding values. Finally, the system executes a SQLite query, which can include any inputs previously received from the reader. For example, if the author’s line is “QUERY: SELECT (INPUT1 * INPUT2)", the system passes the string “SELECT (INPUT1 * INPUT2)” into the back end. Then, “INPUT1” and “INPUT2” in the query are replaced with their corresponding values, and the query is executed. See the box at the beginning of Section 4 and Figure 10 for an example.
  • If the author’s line contains the keyword RETURN, the system displays a message with “RETURN:”. Note that this command applies only when using the QUERY command. If a return message includes the keyword RESULT, the RESULT keyword is replaced by the query results. The system then displays the author’s return message, including the query results. For example, the line “QUERY: SELECT (1 + 1) RETURN: The answer is RESULT” shows the reader “The answer is 2” in the current node.
The following steps reflect how the system receives user inputs, executes queries, and returns a message to the user based on query results:
  • User Input Handling: If the line contains the keyword “INPUT”, the user is prompted to input a string, and the user input is stored. Note that one line can contain multiple “INPUT” keywords, in which case the system prompts the user for an input multiple times and stores each input.
  • Query Extraction: If the line contains the keywords “QUERY” and “RETURN”, The substring between “QUERY:” and “RETURN:”, along with any previous user inputs, is passed into the back end.
  • Query Processing: If the query contains an “INPUT” keyword, the system replaces each input keyword with the user’s corresponding input.
  • Query Execution: The back end executes the query substring as an SQLite query and stores the result as a string.
  • Return Message Processing: The return message is defined as the substring after “RETURN”. If the return message contains the keyword “RESULT”, the query result replaces the keyword “RESULT”.
  • Final Output: The user sees the updated return message in the current node.
User input and database query functionality are demonstrated in a case study on home appraisal, explained in Appendix A. The software architecture enabling our system’s functionality for authors and readers is detailed in Appendix B.

4. Fully Functional Dynamic Decision Tree: Case Study

Let us explore a decision tree that asks the reader basic questions and uses all of the special authoring commands above. You can access this decision tree by clicking the “Test Input” radio button on our site.
  • Are you happy?
  • --if yes, Then great
  • --if meh, Then get a lollipop. did that help?
  • ----if a lot, Then great
  • ----if a little, Then get another one
  • --if no, Would any of these topics cheer you up: NYU, myeloma, Apple?
  • ----if interested in NYU, DOCUMENT: https://www.nyu.edu
  • ----if interested in myeloma, DECISIONTREE: https://elliot2878.github.io/decision_tree.github.io/myeloma.txt
  • ----if interested in Apple, Which category of Apple products are you interested in?
  • ------if interested in iPhone, QUERY: SELECT product_name FROM apple_products WHERE category = ‘iPhone’ RETURN: Which of the following iPhones are you interested in: RESULT?
  • --------If iPhone 15 Pro, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 15 Pro’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------If iPhone 15, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 15’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------If iPhone 14, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 14’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------If iPhone 13, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 13’ RETURN: You can find this product here: DOCUMENT: RESULT
  • ------if interested in iPad, QUERY: SELECT product_name FROM apple_products WHERE category = ‘iPad’ RETURN: Which of the following iPads are you interested in: RESULT?
  • --------if iPad Pro, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPad Pro’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if iPad Air, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPad Air’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if iPad (10th Generation), QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPad (10th Generation)’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if iPad (9th Generation), QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPad (9th Generation)’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if iPad Mini, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPad Mini’ RETURN: You can find this product here: DOCUMENT: RESULT
  • ------if interested in Mac, QUERY: SELECT product_name FROM apple_products WHERE category = ‘Mac’ RETURN: Which of the following Macs are you interested in: RESULT?
  • --------if Mac Pro, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘Mac Pro’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if Mac Studio, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘Mac Studio’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if Mac Mini, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘Mac Mini’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if iMac, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iMac’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if Mac MacBook Pro 16, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘MacBook Pro 16’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if Mac MacBook Pro 14, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘MacBook Pro 14’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if Mac MacBook Air M1, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘MacBook Air M1’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if MacBook Air 13-inch M2, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘MacBook Air 13-inch M2’ RETURN: You can find this product here: DOCUMENT: RESULT
  • --------if MacBook Air 15-inch M2, QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘MacBook Air 15-inch M2’ RETURN: You can find this product here: DOCUMENT: RESULT
  • ------if interested in Apple Watch, INPUT1: Enter the name of the Apple Watch you are interested in. Your options are ‘‘Apple Watch Series 9’’, ‘‘Apple Watch Ultra 2’’, or ‘‘Apple Watch SE’’ QUERY: SELECT product_link FROM apple_products WHERE lower(product_name) = lower(INPUT1) RETURN: You can find this product here: DOCUMENT: RESULT
The figures below show how readers might interact with the tree.
If the reader selects “not interested” to “Are you happy?” and the reader is “interested in myeloma”, they reach the node represented by the following authored text:
  • DECISIONTREE: https://elliot2878.github.io/decision_tree.github.io/myeloma.txt
By selecting “show next”, the reader can interact with the correctly formatted decision tree in the hyperlink after “DECISIONTREE:” as if it was a subtree in the larger decision tree.
By answering that they are not happy but are interested in Apple, a reader can select their favorite Apple product in the drop-down and view links to their chosen Apple product on Apple’s website. Authoring these capabilities begins in the Python back end. By executing an SQLite query in the back end, the author creates a table called “apple_products”, with columns “category”, “product”, and “link”. The author then populates the table with all of the Apple products [8] included in the decision tree text file below (e.g., iPhone 15 Pro, Mac Studio, Apple Watch SE) along with their corresponding links and categories. Once the table is created and populated, the rest of the decision tree can be developed with simple text authoring.
If the reader indicates an interest in iPhones, for example, the node corresponding to that choice has the following text:
  • QUERY: SELECT product_name FROM apple_products WHERE category = ‘iPhone’ RETURN: Which of the following iPhones are you interested in: RESULT?
This line can be split into two parts:
1.
QUERY: SELECT product_name FROM apple_products WHERE category = ‘iPhone’
Because the “QUERY” keyword appears, the system automatically passes the substring after “QUERY:” and before the following RETURN keyword into the back end. The system executes the query, resulting in “‘iPhone 15 Pro’, ‘iPhone 15’, ‘iPhone 14’, ‘iPhone 13”’.
2.
RETURN: Which of the following iPhones are you interested in: RESULT?
The return message, defined as the substring after “RETURN:”, is also passed into the back end. Once the query is executed, the string result of the query replaces the “RESULT” keyword in the return message. If the author wanted to return the exact query result to the reader, they would end the line with “RETURN: RESULT”.
In this case, the return message is converted from “Which of the following iPhones are you interested in: RESULT?” to “Which of the following iPhones are you interested in: ‘iPhone 15 Pro’, ‘iPhone 15’, ‘iPhone 14’, ‘iPhone 13’?”. The new box representing a node is created and shown to the reader, containing the modified return message. After the reader indicates they are interested in iPhones, they can select one of the current iPhone models in the drop-down. If they select iPhone 15, for example, the author’s line corresponding to the current node reads,
  • QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 15’ RETURN: You can find this product here: DOCUMENT: RESULT
This line can also be split into two parts:
  • 1. QUERY: SELECT product_link FROM apple_products WHERE product_name = ‘iPhone 15’
This part executes a simple query that results in “https://www.apple.com/iphone-15/”.
  • 2. RETURN: You can find this product here: DOCUMENT: RESULT
After the query is executed, the query results replace the RESULT keyword in the back end, and then the modified return message is passed to the front-end. The modified return message is “You can find this product here: DOCUMENT: https://www.apple.com/iphone-15/”. The system’s front-end then detects the DOCUMENT keyword and converts the text following “DOCUMENT:” into a hyperlink. Finally, the reader sees “You can find this product here: DOCUMENT: https://www.apple.com/iphone-15/” in the current node, and the URL is a clickable hyperlink.
  • INPUT1: Enter the name of the Apple Watch you are interested in. Your options are ‘‘Apple Watch Series 9’’, ‘‘Apple Watch Ultra 2’’, or ‘‘Apple Watch SE’’ QUERY: SELECT product_link FROM apple_products WHERE product_name = INPUT1 RETURN: You can find this product here: DOCUMENT: RESULT
This line can be split into three parts:
  • 1. INPUT1: Enter the name of the Apple Watch you are interested in. Your options are ‘‘Apple Watch Series 9’’, ‘‘Apple Watch Ultra 2’’, or ‘‘Apple Watch SE’’
When the INPUT keyword is detected, the system prompts the reader to input a value. The user sees the substring after the first colon that follows “INPUT” and before the next keyword. (If no subsequent keyword is found, the prompt message ends at the end of the author’s line.) Here, the reader sees the prompt: “Enter the name of the Apple Watch you are interested in. Your options are “Apple Watch Series 9”, “Apple Watch Ultra 2”, or “Apple Watch SE””. The reader then enters a value.
Note that the author can write any string between “INPUT” and its following colon. This allows the system to store a unique key-value pair for each user input, so that keys may be referenced within queries of descendant nodes. This functionality is further demonstrated through a case study in Appendix A.
  • 2. QUERY: SELECT product_link FROM apple_products WHERE product_name = INPUT1
The system replaces all instances of input keys with their corresponding values. Here, “INPUT1” is replaced with the user’s input string. The query is then executed and its results are stored.
If the reader inputs the value “Apple Watch SE”, for example, the query becomes “SELECT product_link FROM apple_products WHERE product_name = ‘Apple Watch SE’". The query is then executed, resulting in the plain text URL for the Apple Watch SE. In this case, the URL would be “https://www.apple.com/apple-watch-se/”.
  • 3. ‘‘RETURN: You can find this product here: DOCUMENT: RESULT’’
The final part of the line works similarly to the previous examples. “RESULT” is replaced with the plain text URL from the query result, such as “https://www.apple.com/apple-watch-se/”, and the DOCUMENT keyword converts the URL to a valid hyperlink. The reader then displays “You can find this product here: DOCUMENT: https://www.apple.com/apple-watch-se/” in the current node.

5. Related Work

This section first considers the uses of decision trees in various fields. Then, it describes some other decision-making software tools that provide at least some of the features we seek: (i) easy to author, (ii) limited cognitive load on the reader, and (iii) capable of conveying expertise.

5.1. Uses of Decision Trees

Many researchers use decision trees for analysis in specific fields. For instance, the VIBEX (VIBration EXpert) system helps factory operators diagnose the causes of abnormal vibrations in rotating machinery [9]. In reverse engineering, Dugerdil and Sennhauser developed a new execution trace format and a tool to generate decision trees for each use case scenario, analyzing these trees to identify possible variants from the main scenario [10]. Other researchers use decision tree analysis to propose a formal procedure to accelerate decision making for urban sustainability [11]. Medical researchers introduced a decision tree approach to diagnose congestive heart failure [12]. Education researchers propose using decision tree models to analyze student data [13].
Thibault Schrepel proposes utilizing a decision tree system as part of a larger analysis in antitrust law [14]. His paper aims to assist antitrust agencies in creating a decision tree-based antitrust compliance API for market participants. This includes developing an open-access prototype that automates compliance with citation 102 of the TFEU. Specifically, after tracing the answers to a series of questions in the decision tree, users can determine whether they comply with citation 102 of the Treaty on the Functioning of the European Union (TFEU). This provision of EU competition law is designed to prevent companies from abusing a dominant position within the internal market.
Thus, decision trees are used for all kinds of specific applications. This makes sense because they are easily understandable and are excellent at encoding rules. That is why it is helpful to have a tool to encode them easily and navigate them in a cognitively intuitive way.
Tree-based systems are often extended to forests for the purposes of machine learning, e.g., [15,16]. Such systems are not directly comparable with ours because dynamic decision trees are primarily concerned with expressing rules and strategies rather than inferring a model from data.

5.2. Interactive Decision Tree Tools

The following tools ask readers to make evaluations based on specific categories; then, the tools make a recommendation by combining those ratings. The decision-making tool Protagonist (accessed 11 August 2024) [17] assists readers in making real-world evaluations. Protagonist offers a set of options and a set of categories that are pertinent to those options. For each category, readers evaluate each option from 1 to 10 in that category. Readers may optionally weigh each category from 1 to 10. (By default, each category is assigned the minimum weight.) Then, Protagonist calculates a weighted sum for each option and recommends the highest weighted option.
For example, in the “buy a house” decision process shown in Figure 11, Protagonist asks readers to rate features they like or dislike about the house. These properties include short-term affordability, desirable location, etc.
Once the reader has rated the categories of each home, the reader may weight each category. After entering “Analysis” mode, Protagonist recommends a house based on the reader’s preferences, as shown in Figure 12.
In the Figure 11 above, home 2 is recommended. In the case that a prospective author chooses their own topic, they must create categories they deem important. Readers would then evaluate each option within each category and assign a weight to each category.
The tool Best Decision (accessed 11 August 2024) [18] offers decision-making services for pre-selected topics. Similar to Protagonist, Best Decision allows readers to rank categories on a scale of 1–5. Best Decision then recommends a conclusion based on the reader’s preferences.
As shown in Figure 13 above, Best Decision offers decision-making services to help readers find a laptop. The reader begins by indicating the laptop models they are considering.
Next, as seen in Figure 14, the reader ranks the listed features based on importance from 1 to 5. The reader can also add features that the reader deems important in the decision-making process.
As shown in the Figure 15 and Figure 16, Best Decision then recommends a laptop for readers to buy based on their preferences. This process works for a variety of pre-selected and author-created decision topics.
In contrast to Protagonist and Best Decision, Zingtree (accessed 11 August 2024) utilizes a decision tree structure [19]. For example, in Figure 17, the system begins by assisting users in selecting iPhone models and then presents this decision tree in a question-and-answer format. If the user clicks on “iPhone is running slowly”, Zingtree displays the corresponding solution for this issue and then asks whether the provided solution is helpful.
Zingtree supports integration with various systems, apps, and websites. Zingtree authors can present information to users that is stored in a Google Sheet using a “webhook”. Zingtree can perform mathematical operations for users as shown in Figure 18.
One distinction between Zingtree and our dynamic decision tree system lies in reader navigation. Zingtree does not display the relevant part of the decision tree structure to readers, nor does it permit readers to jump to a specified node, other than the previous or the first node. By contrast, our system’s search functionality offers readers the ability to navigate far from the current node.
Yonyx (accessed 11 August 2024) is quite similar to Zingtree [20]. Yonyx supports API calls to read and write data from various applications, as well as mathematical operations. Figure 19 shows the Yonyx system in action for a health insurance fee estimator.
Yonyx has a graphical authoring interface that incorporates search functionality. Authors can search the entire tree using various parameters; e.g., authors can use them to find nodes containing specific text. However, Yonyx does not allow readers to search within a decision tree.

5.3. Analytical Hierarchy Process

Other decision aids work in a bottom-up manner using a weighted quantitative approach. A prominent technology is called an analytic hierarchy process (AHP) [21]. The idea is to come to a decision by evaluating several criteria about each alternative through pairwise comparisons. AHP calculates weights for each criterion based on user responses and then calculates a weighted sum for each option. For example, to choose a car, one might evaluate different alternative car models based on criteria such as fuel economy, resale value, price, comfort, and roominess. An AHP assigns a weight to each criterion and arrives at a numerical score for each model type. As another example, Dey shows a quantitative method for managing construction risks using AHPs [22].
Thus, AHPs are bottom-up approaches for breaking down the considerations leading to a decision. By contrast, dynamic decision trees, when used for a product choice as in the example of purchasing Apple products in Section 4, gather selection criteria and then choose relevant products that the reader can evaluate as a whole. In environments where tradeoffs should be considered, AHPs are better. In environments where users are still uncertain but can express basic requirements to narrow the choices, dynamic decision trees enjoy a comparative advantage. Dynamic decision trees also enjoy a comparative advantage when expressing strategies, as in a legal argument.

5.4. Decision Tree Drawing Tools

Some software systems, such as Miro, Diagrams, and Creately, (accessed 11 August 2024) allow users to draw and edit decision trees [23,24,25]. However, these decision trees are not interactive. Users simply view the entire decision tree structure at once. For small decision trees, this works well, as we can see in Figure 20, Figure 21 and Figure 22. However, this may result in a high cognitive load and navigation troubles to the reader when viewing larger decision trees.

6. Functionality Comparison with State of the Art Systems

Dynamic decision trees differ in their authoring interface from the above systems by allowing a simple text input. Dynamic decision trees extend the functionality of these services by offering functionalities like a search for readers. This enables dynamic decision trees to provide roadmaps to end with a possibly desirable or undesirable conclusion. For example, in a legal context, a dynamic decision tree could provide a line of questioning that might lead a witness to admit to some guilty act. The database functionality allows access to large collections of data (e.g., about housing, as we show in Appendix A).
We will now explore two use cases requiring expertise: trigonometry and debate arguments. We start with trigonometry.
Find the value of a in the triangle below (note: image not drawn to scale).
Knowledge 04 00027 i002
In the problem above, one is given the length of the hypotenuse and the angle between the hypotenuse and a leg. One must use the cosine function to find the adjacent leg.
c o s ( 32 ) = a 20 a = 20 c o s ( 32 )
Suppose that someone understood the question but did not know how to solve this problem. Our trigonometry decision tree (Figure 23 and Figure 24) could assist in solving this problem. The text file for this decision tree can be found in Appendix C.
The leaf box in this subtree provides a formula and an example to help the user solve the problem. Here is the text:
  • Calculate the length of the leg by multiplying the hypotenuse length by the cosine of the given angle (Ex: If Hypotenuse = 5, angle = 60, find Adjacent side: Adjacent = 5 ∗ cos(60) = 2.5).
A reader thus learns that a = 20 c o s ( 32 ) , which can be approximated if necessary. Such information can easily be encoded in a dynamic decision tree by a subject matter expert without programming experience.
Decision trees can also be used to encode debate arguments but also to arrive at a desired goal as the debate evolves. That is, party A in a debate could benefit from using a decision tree to track opponent B’s arguments and then respond. For example, consider the question of whether technology makes people more antisocial and more lonely. The decision tree we created can be used to argue that technology does not create that result. The text file for this decision tree can be found in Appendix D.
When the reader selects “Yes” to the initial question in Figure 25, it is as if our opponent has engaged in the debate. To counter that assertion, the dynamic decision tree leads us to the node “Why would this be the case?”. When the “opponent” selects a reason, the dynamic decision tree proceeds to a node with an apt response.
For example, if the reader selects “social media creates unrealistic expectations”, the following box contains a response:
  • Social media is also a place where people with similar struggles can interact and support each other. Many digital groups are dedicated towards mental health and support. However, doesn’t this seem like social media is trying to solve the insecurities it creates?
The reader may make this counterargument. The final sentence in the box is a follow-up question the opponent reader may ask.
The reader can also use our search functionality to quickly locate particular arguments. For example, by searching “self-esteem”, a reader can immediately find a study within the decision tree stating that teenagers believe that social media boosts their confidence.
In combination, as shown in Table 1, dynamic decision trees contain unique features that support both authoring and reading subject matter that requires expertise.

7. Conclusions

The dynamic decision tree system allows non-programmers to author decision trees for rule-based topics in an intuitive format. Readers navigate the decision tree both locally by answering a question at the current node or globally through the search functionality. To reduce cognitive load, at any moment, only the nodes that are still possible (i.e., that have not been excluded by previous answers) of the decision trees are visible.
Implications of this Work
While dynamic decision trees present a way to express rule-based knowledge, there may be other ways to represent this knowledge. The common current methods are as articles and videos. Large language models extract knowledge from text at a high level of proficiency in medicine (e.g., OpenEvidence (https://www.openevidence.com/, accessed 3 August 2024)) and other areas [26]. A fair question to ask is what place an expert system like dynamic decision trees has given to the capabilities of machine intelligence. As we have seen in our examples, laws, strategies, and other areas of expertise may entail complex combinations of conditions, some of which may have never been seen before and may require precise answers. Because deep reasoning and hallucinations are weaknesses of LLMs, there is still a need for readers to be sure that a trusted expert author has entered the rules properly. At the same time, domain experts such as lawyers and doctors do not want to have to learn to program in order to convey their expertise. Dynamic decision trees thus fill an unmet need.

Future Work

Reader Shortcomings and Future Work
The reader interface is currently clear but not attractive and not friendly to the visually impaired. Future work therefore involves aesthetic and usability improvements, including:
  • Support for advanced text formatting using TeX typesetting. This would allow for more versatile authoring capabilities, such as including complex mathematical formulas.
  • Interfaces for mobile devices.
  • Deeper improvements include support for the visually impaired as outlined in Section 2.2.
Authoring Future Work
Though we have removed the need for authors to write program code, the ideal remains a natural language approach that could take text from documents and encode the information into the hyphenated format of dynamic decision trees. We have in fact tried this, but it has not worked in our hands with the tools available at present. As large language models improve, so will their deep reasoning abilities.
A possible use of dynamic decision trees is to have multiple authors create decision trees about the same topic and then compare them either quantitatively using analytic hierarchy processes (AHPs) [21] or qualitatively. The qualitative comparison could determine whether some authors included criteria that others did not. Comparing decision trees semantically is an intriguing area for future work.

Author Contributions

Conceptualization, D.S.; software, J.V., S.J., Z.L. and B.S.D.; validation, J.V.; data curation, E.D. and J.V.; writing—original draft preparation, J.V., E.D., Z.L., S.J. and D.S.; writing—review and editing, J.V., E.D., Z.L., S.J. and D.S.; supervision, D.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was partly supported by NYU Wireless.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Our code is available on GitHub at https://github.com/sprihajha/DynamicDecisionTree. The system is published on an HTTP website: http://ec2-3-95-178-149.compute-1.amazonaws.com:8080/.

Acknowledgments

This research was carried out at New York University’s Courant Institute of Mathematical Sciences and at NYU Abu Dhabi. The authors also wish to thank NYU Wireless for support.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Home Appraisal Case Study

Appendix A.1. Full Decision Tree Source Text for Appraisal

Home appraisal is typically an expensive and time-consuming process. Let us explore an advanced decision tree that tells the reader what information they need in order to draft an appraisal report and estimates the value of the reader’s property. Here is the author’s text for the decision tree:
  • Do you have a valid legal description that is sufficient to identify the exact residential property?
  • --If Yes, Have you inspected the interior and exterior of the residential property in person and documented its results (ex: condition, age, construction type)?
  • ----If Yes, Have you documented the home’s structural elements (e.g., foundation, roof, walls) and its key systems (like plumbing, electrical, heating)?
  • ------If Yes, Have you documented the value of the actual land (based on prices of similar empty lots nearby)?
  • --------If Yes, Have you documented local amenities (like distance to schools, parks, malls) and distinctive elements (like a garden, unique design)?
  • ----------If Yes, Have you documented any zoning or usage restrictions (e.g., limits on extensions or business activities)?
  • ------------If Yes, Have you documented all upcoming projects (like new highways or shopping districts) that might affect the residential property’s value?
  • --------------If Yes, Is your property in the state of Washington?
  • ----------------If Yes, INPUT1: Enter the zip code of your residential property: INPUT2: Enter the number of bedrooms in your residential property: QUERY: SELECT COUNT(price) FROM comps WHERE zipcode = INPUT1 AND bedrooms = INPUT2 RETURN: There were RESULT comparable properties found with this criteria. If the number of properties found is 0, please answer ‘‘No’’. Otherwise, will you please respond ‘‘Yes’’?
  • ------------------If Yes, QUERY: SELECT(ROUND(AVG(price), 2)) AS avg_price FROM comps WHERE zipcode = INPUT1 AND bedrooms = INPUT2 RETURN: Based on comparable properties in the area, your property is worth approximately RESULT. Use this number to determine your property’s value. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
  • ------------------If No, Can you determine your property’s purchase price and its total depreciation since being purchased?
  • --------------------If Yes, INPUT3: Enter your property’s purchase price: INPUT4: Enter the total depreciation amount since the property was purchased: QUERY: SELECT(ROUND(INPUT3 - INPUT4, 2)) RETURN: Your property’s salvage value is RESULT. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
  • --------------------If No, Can you calculate your property’s capitalization rate (based on the rate of return for similar properties in the area) and its potential yearly net operating income (by subtracting all costs, such as property taxes, mortgage payments, and capital expenditures, from all sources of revenue, such as rental income and any fees collected from the tenant)?
  • ----------------------If Yes, INPUT5: Enter the potential yearly net operating income from renting your property: INPUT6: Enter your property’s capitalization rate: QUERY: SELECT(ROUND(INPUT5/INPUT6, 2)) RETURN: Your property’s value can be determined by dividing the net operating income by the capitalization rate. Based on this formula your property is worth approximately RESULT. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
  • ----------------------If No, You are missing key information required to get the value of the property. Gather more information, such as the estimated cost to build the house, the depreciation rate, and the potential net income from renting the property. Once done, revisit the decision tree.
  • ----------------If No, Can you determine your property’s purchase price and its total depreciation since being purchased?
  • ------------------If Yes, INPUT3: Enter your property’s purchase price: INPUT4: Enter the total depreciation amount since the property was purchased: QUERY: SELECT(ROUND(INPUT3 - INPUT4, 2)) RETURN: Your property’s salvage value is RESULT. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
  • ------------------If No, Can you calculate your property’s capitalization rate (based on the rate of return for similar properties in the area) and its potential yearly net operating income (by subtracting all costs, such as property taxes, mortgage payments, and capital expenditures, from all sources of revenue, such as rental income and any fees collected from the tenant)?
  • --------------------If Yes, INPUT5: Enter the potential yearly net operating income from renting your property: INPUT6: Enter your property’s capitalization rate: QUERY: SELECT(ROUND(INPUT5/INPUT6, 2)) RETURN: Your property’s value can be determined by dividing the net operating income by the capitalization rate. Based on this formula your property is worth approximately RESULT. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
  • --------------------If No, You are missing key information required to get the value of the property. Gather more information, such as the estimated cost to build the house, the depreciation rate, and the potential net income from renting the property. Once done, revisit the decision tree.
  • --------------If No, Research upcoming developments that may affect the property’s value and restart the decision tree once finished. (e.g., a nearby gym being built may boost the property’s value.)
  • ------------If No, Research and document any zoning or usage rules affecting the property and revisit the decision tree once done. (e.g., if the house is in a heritage zone, the value of the property might be diminished due to limited extension options)
  • ----------If No, Research and document local amenities, unique elements, and any environmental factors that could affect value. Then, refer back to the decision tree. (e.g., Proximity to a lake or special architectural facets may boost the property’s value, so this information should be included in the appraisal report).
  • --------If No, Document the value of the land. The value can be calculated based on similar empty lots nearby. Resume the decision tree once done. (e.g., if comparable vacant lots are priced at 80 per square foot, and your property is 1000 square feet, your land is worth 800,000. Consider using multiple other vacant lots and averaging the price per square foot to get a more accurate value)
  • ------If No, Document the home’s structure and essential systems. Then, come back to this decision tree. (e.g., check the basement for moisture issues, check the HVAC system, and review wiring. Any major issues must be included in the final appraisal report.)
  • ----If No, Inspect the property thoroughly, document its results, then redo the decision tree.
  • --If No, First obtain a legal description for the residential property. A legal description can usually be found in the most recent deed to the property. Consult local authorities or check legal documentation for the correct legal description. Once obtained, redo the decision tree.
In this decision tree, the reader is asked seven “Yes” or “No” questions to see if the reader has gathered specific information on the home. All information inquired by the system must be included in the eventual appraisal report, i.e., a legal description, inspection results, local amenities, etc. If the reader answers “No” to any of the initial questions, they are instructed to gather the relevant information and revisit the decision tree. If the reader answers “Yes” to all seven questions, they can subsequently input additional information about their home to receive an estimate of their property’s value.
There are three primary methods used by property appraisers, reflected in this decision tree, to estimate the property’s value.

Appendix A.2. Comparables Approach

The first method is the comparables approach. Given properties comparable in size, location, condition, etc., this method calculates a value estimate for the property based on the values of comparable properties. This decision tree uses a table in the database called “comps”, which contains information about over 21,000 comparable properties in the state of Washington [27] (accessed 11 August 2024). The columns used in this decision tree are the zip code, number of bedrooms, and sale price.
Let us examine the author’s lines associated with the comparables approach.
  • --If Yes, INPUT1: What is your zip code? INPUT2: How many bedrooms does your property contain? QUERY: SELECT COUNT(∗) FROM comps WHERE zipcode = INPUT1 AND bedrooms = INPUT2 RETURN: There were RESULT comparable properties found with this criteria. If the number of properties found is 0, please answer ‘‘No’’. Otherwise, will you please respond ‘‘Yes’’?
Through this line, the reader enters the zip code and the number of bedrooms of a property of interest. A database query returns how many properties were found with the same criteria.
The system requires more than one query to estimate the property’s value if no comparable properties are found in the table. The reason for this is that the results of a query can affect only the message displayed in the current node. To determine the next node, the system could ask the reader to select an option based on the results of the most recent query. In this instance, the author wrote two queries on two lines: the first determines how many comparable properties are found, and the second estimates the value of the reader’s property only if matching properties were found.
If one or more properties are found, the next line reads:
  • QUERY: SELECT(ROUND(AVG(price), 2)) AS avg_price FROM comps WHERE zipcode = INPUT1 AND bedrooms = INPUT2 RETURN: Based on comparable properties in the area, your property is worth approximately RESULT. Use this number to determine your property’s value. Draft the appraisal report, including the property’s value as calculated. Include the other information in your appraisal report, but do not use it to calculate the value of the property directly.
The query in this line implements a simplified version of the comparables approach to estimate the value of the reader’s residential property. The query averages the sale price of all properties in the database that contain the same zip code and number of bedrooms. The reader sees the message following the RETURN keyword, where the query result replaces the RESULT keyword.
Suppose the query returns no properties. In that case, the reader can then select a different method to estimate the value of their property.

Appendix A.3. The Cost Approach

The cost approach estimates the property value using the formula
P r o p e r t y V a l u e = T o t a l C o s t o f B u i l d i n g a n I d e n t i c a l H o m e T o t a l D e p r e c i a t i o n S i n c e P u r c h a s e
If the reader inputs the total cost of building an identical home and total depreciation since purchase, the system executes a simple query following the formula above. The query does not access values in the database; it simply subtracts two reader inputs and rounds them.

Appendix A.4. Income Approach

Suppose the reader cannot provide the required information to use the cost approach. In that case, they may use the income approach, which follows the formula:
P r o p e r t y V a l u e = P o t e n t i a l Y e a r l y N e t O p e r a t i n g I n c o m e / C a p i t a l i z a t i o n R a t e
Potential Yearly Net Operating Income is defined as the expected annual cost of renting out the property (including maintenance fees, cleaning fees, property taxes, etc.) subtracted from the expected annual rental income. The Capitalization Rate is defined as the expected rate of return on a property.
Suppose the reader enters the Potential Yearly Net Operating Income and Capitalization Rate. In that case, the system executes a query that follows the income approach formula and returns an estimated value for the reader’s property.

Appendix B. Software Architecture

The system consists of a front-end part and a back-end part. The front-end web page is written in HTML, CSS, and JavaScript. In addition, the MindFusion framework is responsible for the graphics and animation of the dynamic decision tree for the reader.
The back end is written in JavaScript, Python, and Flask. The JavaScript converts the text input to a general tree structure. It incorporates several functionalities, including error detection, searching, and automatically feeding the text input to the tree.
Flask is a framework that connects the Python back end to the HTML front-end. The Python code receives the path generated by JavaScript and saves the path to a text file.
  • datasets
    federal_tax_brackets.csv
    kentucky_comps.csv
  • input
    ESG.txt
    collect_social.txt
    commercialPropertyAppraisal.txt
    derivatives.txt
    dynamicAntibiotic.txt
    federal_tax_rates.txt
    housing.txt
    immigration.txt
    laptopRepair.txt
    macbookrepair.txt
    myeloma.txt
    residentialPropertyAppraisal.txt
    seriesConvergence.txt
    social_helper.txt
    tax_free_exchange.txt
    test_input.txt
    trigonometry.txt
    visa.txt
  • static
    MindFusion.Common.js
    MindFusion.Diagramming.js
    homepage.css
    homepage.js
    tree.css
    tree.js
  • templates
    index.html
    sql.html
    tree.html
  • app.py
  • dt.db
  • requirements.txt
  • root_to_curr.txt
  • The datasets folder includes, in the appraisal example, kentucky_comps.csv and federal_tax_brackets.csv, two datasets that are used in the Python back end to create SQL tables.
  • The input folder includes the decision tree text files, many of which are accessible by clicking the corresponding radio buttons on the website.
  • The static folder includes all of the JavaScript and CSS files used, namely homepage.css, homepage.js, MindFusion.Common.js, MindFusion.Diagramming.js, tree.css, and tree.js.
  • The templates folder includes all of the HTML files, namely index.html, tree.html, and sql.html. The back-end Python file named app.py and the database named dt.db are not stored in an additional folder.
  • The MindFusion libraries are in two JavaScript files, MindFusion.Common.js and MindFusion.Diagramming.js. Both HTML and JavaScript files refer to these library files.
  • The system imports Mindfusion.Diagramming, MindFusion.Drawing, and MindFusion.Animations.
  • Each box in a dynamic decision tree (e.g., the “Are you happy?” box) is a node.
  • For each box that needs to be created:
    (i)
    Mindfusion.Diagramming creates the node objects.
    (ii)
    Mindfusion.Drawing draws a rectangle for each node.
    (iii)
    Mindfusion.Animations draws arrows between nodes.
Besides the functions that generate new nodes, other functions provide diverse functionalities of the system.
  • The code for error detection is in a function called input, which converts the text input to a general tree structure in homepage.js. input is called when authors click “Submit” in the index.html page. It can detect the following types of errors: incorrect number of hyphens, having a question but no answer, having an answer but no question, and a question having duplicated answers.
  • The jump function in homepage.js moves the input text to the line containing errors so authors can correct the error conveniently.
  • The keywordSearch, findPath, and inputSearch functions are called when readers click the “search” button in the tree.html. They are responsible for searching for phrases in nodes.
  • keywordSearch in tree.js searches the nodes by phrase.
  • findPath in tree.js finds the path from the root to the node containing that phrase.
  • inputSearch in tree.js renders the search results.
    After a search is completed, the reader has the option to see the text of the subtree of the node that has been searched thanks to the subtree function. The subtree’s text format is in the same form as the input: text with hyphens.
  • The dragElement function is called in tree.js when readers click “Click here to move this box” in the search box. It allows the reader to drag the search box. In this way, readers can move the search box when the tree and the search box overlap.
  • The rootNode function is called in tree.js whenever the page is loaded. rootNode displays the root.
  • The nextOption is called in tree.js when a single answer in the drop-down menu is selected. The function creates and shows a single next node.
  • The notSure function is called in tree.js where the reader clicks “notSure” in the drop-down menu. This function creates and shows all possible children of the current node.
  • The showCheckbox function is called in tree.js when readers click the “Submit” button in a node containing a checkbox. A node will contain a checkbox when there are more than five child nodes, potential answers. This function thus gives finer control of the branching than “notSure” does because it allows the reader to choose among possible outcomes, rejecting those that the reader deems impossible. After the reader selects their desired answers and clicks “Submit”, the system will display all of the children nodes that have been checked.
The above four functions rootNode, nextOption, notSure, and showCheckbox can also detect the reserved keywords in the nodes DOCUMENT, DECISIONTREE, INPUT, QUERY, RETURN, and RESULT.
The static folder contains the JavaScript and CSS files. The templates folder contains the HTML pages. Each HTML page has its corresponding CSS and JavaScript files. To run the whole system, we need to run app.py with Flask and open the HTML homepage.

Appendix C. Trigonometry Decision Tree Text File

  • Are you dealing with a right triangle?
  • --If Yes, What are you asked to find?
  • ----If Side length, Are you given the other 2 side lengths?
  • ------If Yes, Solve for a^2 + b^2 = c^2 where a and b are the respective leg lengths and c is the hypotenuse length (Ex: If a = 3, b = 4, find c: c = sqrt(32 + 42) = 5).
  • ------If No, Are you given a side length and an angle?
  • --------If Yes, Are you given the hypotenuse or a leg??
  • ----------If Hypotenuse, Are you asked to find the leg length adjacent or opposite to the given angle?
  • ------------If Adjacent, Calculate the length of the leg by multiplying the hypotenuse length by the cosine of the given angle (Ex: If Hypotenuse = 5, angle = 60°, find Adjacent side: Adjacent = 5 ∗ cos(60°) = 2.5).
  • ------------If Opposite, Calculate the length of the leg by multiplying the hypotenuse length by the sine of the given angle (Ex: If Hypotenuse = 5, angle = 60°, find Opposite side: Opposite = 5 ∗ sin(60°) ≈ 4.33).
  • ----------If Leg, Is the given angle adjacent or opposite to the leg whose length you are asked to find?
  • ------------If Adjacent, Calculate the length of the missing side by dividing the length of the given leg by the cosine of the given angle (Ex: If Adjacent side = 3, angle = 60°, find Hypotenuse: Hypotenuse = 3/cos(60°) = 6).
  • ------------If Opposite, Calculate the length of the missing side by dividing the length of the given leg by the sine of the given angle (Ex: If Opposite side = 3, angle = 60°, find Hypotenuse: Hypotenuse = 3/sin(60°) ≈ 3.46).
  • --------If No, Try to use other methods to gain more information and help you find the side length.
  • ----If Angle, Are you given the length of the 2 sides of the triangle?
  • ------If Yes, Which 2 side lengths were you given?
  • --------If 2 legs, Calculate the angle by taking the arctangent of the leg length opposite the angle divided by the leg length adjacent to the angle (Ex: If Opposite side = 4, Adjacent side = 3, find angle: Angle = arctan(4/3) ≈ 53.13°).
  • --------If 1 leg and 1 hypotenuse, Is the given leg length adjacent or opposite to the angle you are trying to find?
  • ----------If Adjacent, Calculate the angle by taking the arccosine of the leg length adjacent to the angle divided by the length of the hypotenuse (Ex: If Adjacent side = 3, Hypotenuse = 5, find angle: Angle = arccos(3/5) ≈ 53.13°).
  • ----------If Opposite, Calculate the angle by taking the arcsine of the leg length opposite the angle divided by the length of the hypotenuse (Ex: If Opposite side = 4, Hypotenuse = 5, find angle: Angle = arcsin(4/5) ≈ 53.13°).
  • ------If No, Are you given the other acute angle?
  • --------If Yes, Calculate the the angle by subtracting the given acute angle from 90 (Ex: If one acute angle is 30°, find other acute angle: Other Angle = 90 − 30 = 60°)
  • --------If No, Try to use other methods to gain more information and help you find the angle.
  • ----If Area, Are you given the lengths of two sides that form the right angle?
  • ------If Yes, Calculate the area as 1/2 ∗ first leg length ∗ second leg length (Ex: If leg one = 4 and leg 2 = 3, Area = 1/2 ∗ 4 ∗ 3 = 6).
  • ------If No, Try to use other methods to gain more information and help you find the area.
  • ----If Height, Are you given the length of the hypotenuse and an angle?
  • ------If Yes, Calculate the height as hypotenuse ∗ sin(angle) (Ex: If hypotenuse = 5 and angle = 60°, height = 5 ∗ sin(60°) ≈ 4.33).
  • ------If No, Try to use other methods to gain more information and help you find the height.
  • --If No, What are you asked to find?
  • ----If Side length, Are you given all three angles and one side or two sides and one included angle?
  • ------If All three angles and one side, Use the Law of Sines to find the unknown side: a/sin(A) = b/sin(B) = c/sin(C) (Ex: If angle A = 30°, side a = 2, angle B = 60°, find side b: b = sin(60°) ∗ (2/sin(30°)) = 4)
  • ------If Two sides and one included angle, Use the Law of Cosines to find the unknown side: c2 = a2 + b2 − 2abcos(C) (Ex: If a = 3, b = 4, angle C = 60°, find c: c = sqrt(32 + 42 − 2 ∗ 3 ∗ 4cos(60°)) = 1).
  • ----If Angle, Are you given all three sides or two angles?
  • ------If All three sides, Use the Law of Cosines to find the unknown angle: Take the arccosine of [a2 + b2 − c2]/2ab to find the unknown angle (Ex: If a = 3, b = 4, c = 5, find angle A: A = arccos((32 + 42 − 52)/(2 ∗ 3 ∗ 4)) ≈ 36.87°)
  • ------If Two angles, Subtract the sum of the two known angles from 180° to find the unknown angle (Ex: If angle A = 60° and angle B = 50°, find angle C: C = 180 − 60 − 50 = 70°).
  • ----If Area, Are you given two sides and the included angle?
  • ------If Yes, Use the formula 1/2 ∗ a ∗ b ∗ sin(C) to find the area (Ex: If a = 3, b = 4, and C = 60°, Area = 1/2 ∗ 3 ∗ 4 ∗ sin(60°) = 3.46).
  • ------If No, Are you given all three sides?
  • --------If Yes, Use Heron’s formula to find the area: sqrt[s(s − a)(s − b)(s − c)] where s is half the perimeter of the triangle given by (a + b + c)/2 (Ex: If a = 2, b = 3, and c = 4, s = (2 + 3 + 4)/2 = 4.5, then Area = sqrt[4.5(4.5 − 2)(4.5 − 3)(4.5 − 4)] = 2.9).
  • --------If No, Try to use other methods to gain more information and help you find the area.
  • ----If Height, Are you given the longest side and its opposite angle?
  • ------If Yes, Use the relationship h = a ∗ sin(B) where h is the height, a is the side length, and B is the opposite angle (Ex: If a = 3 and B = 60°, height = 3 ∗ sin(60°) ≈ 2.6).
  • ------If No, Try to use other methods to gain more information and help you find the height.
  • ----If Solution To Trigonometric Equation/Expression, Which identity or formula category does it belong to?
  • ------If Pythagorean (Ex: cos^2(θ) + sin^2(θ) = ?), Do you know sin(θ) or cos(θ)?
  • --------If sin(θ) (Ex: sin(θ) = 0.6), Use the identity: cos(θ) = sqrt(1 − sin^2(θ)) (Ex: If sin(θ) = 0.6, cos(θ) = sqrt(1 − 0.6^2) = 0.8).
  • --------If cos(θ) (Ex: cos(θ) = 0.5), Use the identity: sin(θ) = sqrt(1 − cos^2(θ)) (Ex: If cos(θ) = 0.5, sin(θ) = sqrt(1 − 0.5^2) = 0.87).
  • ------If Angle Sum or Difference (Ex: sin(45° + 30°) = ?), Are you working with sine, cosine, or tangent?
  • --------If Sine (Ex: sin(45° + 30°) = ?), Use the identity: sin(A ± B) = sin(A)cos(B) ± cos(A)sin(B) (Ex: If A = 30° and B = 60°, sin(A + B) = sin(30°)cos(60°) + cos(30°)sin(60°)).
  • --------If Cosine (Ex: cos(45° − 30°) = ?), Use the identity: cos(A ± B) = cos(A)cos(B) ± sin(A)sin(B) (Ex: If A = 30° and B = 60°, cos(A − B) = cos(30°)cos(60°) + sin(30°)sin(60°)).
  • --------If Tangent (Ex: tan(45° + 30°) = ?), Use the identity: tan(A ± B) = (tan(A) ± tan(B))/(1 ± tan(A)tan(B)) (Ex: If A = 45° and B = 30°, tan(A + B) = (tan(45°) + tan(30°))/(1 − tan(45°)tan(30°))).
  • ------If Double Angle (Ex: sin(230°) = ?), Are you working with sine, cosine, or tangent?
  • --------If Sine (Ex: sin(230°) = ?), Use the identity: sin(2θ) = 2sin(θ)cos(θ) (Ex: If θ = 30°, sin(2θ) = 2sin(30°)cos(30°)).
  • --------If Cosine (Ex: cos(230°) = ?), Use the identity: cos(2θ) = cos^2(θ) − sin^2(θ) or 2cos^2(θ) − 1 or 1 − 2sin^2(θ) (Ex: If θ = 30°, cos(2θ) = 2cos^2(30°) − 1).
  • --------If Tangent (Ex: tan(230°) = ?), Use the identity: tan(2θ) = (2tan(θ))/(1 − tan^2(θ)) (Ex: If θ = 30°, tan(2θ) = 2tan(30°)/(1 − tan^2(30°))).
  • ------If Product-to-Sum (Ex: 2sin(30°)sin(45°) = ?), Are you working with sine, cosine, or a mix of both?
  • --------If Sine (Ex: 2sin(30°)sin(45°) = ?), Use the identity: 2sin(A)sin(B) = cos(A − B) − cos(A + B) (Ex: If A = 45° and B = 30°, 2sin(45°)sin(30°) = cos(15°) − cos(75°)).
  • --------If Cosine (Ex: 2cos(30°)cos(45°) = ?), Use the identity: 2cos(A)cos(B) = cos(A + B) + cos(A − B) (Ex: If A = 45° and B = 30°, 2cos(45°)cos(30°) = cos(75°) + cos(15°)).
  • --------If Mix of both (Ex: 2sin(30°)cos(45°) = ?), Use the identity: 2sin(A)cos(B) = sin(A + B) + sin(A − B) or 2cos(A)sin(B) = sin(A + B) − sin(A − B) (Ex: If A = 45° and B = 30°, 2sin(45°)cos(30°) = sin(75°) + sin(15°)).

Appendix D. Technology Debate Decision Tree Text File

  • Does technology make us more antisocial and more lonely?
  • --If Yes, Why would this be the case?
  • ----If Digital communication reduces in-person interactions that are essential to relationship building, Technology also allows people to maintain relationships over long distances through video calls and virtual meetings. It is about how people decide to use technology. According to Business Insider, 35% of Gen Zers agree social media has made them less lonely, whereas only 29% claimed social media made them more lonely. However, Isn’t it true that most relationships could not rely solely on digital interactions due to their inferior depth and satisfaction?
  • ------If Yes, Digital communication allows long-distance friends or romantic partners to remain connected until they eventually meet in person.
  • ------If No, A recent study shows nearly 1/3 of newlyweds met online! This simply shows the success of technology in sparking social bonds.
  • ----If Social media creates unrealistic expectations, Social media is also a place where people with similar struggles can interact and support each other. Many digital groups are dedicated towards mental health and support. However, doesn’t this seem like social media is trying to solve the insecurities it creates?
  • ------If No, A study by Common Sense Media found that one in five teens said social media makes them feel more confident, compared with 4% who said it makes them feel less so. Social media is overall beneficial in boosting the self-esteem of its users.
  • ----If The ease of making connections on social media prevents deep relationships from forming, The ease of connecting with others on social media is a benefit, because it acts as a foundation for building deeper relationships in person. According to Business Insider, 35% of Gen Zers agree social media has made them less lonely, whereas only 29% claimed social media made them more lonely.
  • ----If People often replace essential face-to-face time with screen time, Frank Herbert, an American author, once said, ‘‘Technology is both a tool for helping humans and for destroying them. This is the paradox of our times which we’re compelled to face.’’ Technology is a tool, and it is our choice whether to use it for good or bad. Unhealthy screen time habits are not the fault of technology, but of the user.
  • --If No, We are in agreement. There is no debate here.

References

  1. DeTore, A.W. An Introduction to Expert Systems. J. Insur. Med. 1989, 21, 233–236. [Google Scholar]
  2. Ferrara, J.M.; Parry, J.D.; Lubke, M.M. Expert Systems Authoring Tools for the Microcomputer: Two Examples. Educ. Technol. 1985, 25, 39–41. [Google Scholar]
  3. Aleksandrovich, K.D. Research of the methods of creating content aggregation systems. Softw. Syst. Comput. Methods 2022, 9–31. [Google Scholar] [CrossRef]
  4. MangoApps. Issaquah, WA, USA. Available online: https://mangoapps.com/ (accessed on 11 August 2024).
  5. HelpJuice. Washington DC, USA. Available online: https://helpjuice.com/ (accessed on 11 August 2024).
  6. Freshworks. San Mateo, CA, USA. Available online: https://freshworks.com/ (accessed on 11 August 2024).
  7. Mirkowicz, M.; Grodner, G. Jakob Nielsen’s Heuristics in Selected Elements of Interface Design of Selected Blogs. Soc. Commun. 2018, 4, 30–51. [Google Scholar] [CrossRef]
  8. Apple Inc. 2024. Available online: https://www.apple.com/ (accessed on 6 January 2024).
  9. Yang, B.S.; Lim, D.S.; Tan, A.C.C. VIBEX: An expert system for vibration fault diagnosis of rotating machinery using decision tree and decision table. Expert Syst. Appl. 2005, 28, 735–742. [Google Scholar] [CrossRef]
  10. Dugerdil, P.; Sennhauser, D. Dynamic decision tree for legacy use-case recovery. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, New York, NY, USA, 18–22 March 2013; pp. 1284–1291. [Google Scholar] [CrossRef]
  11. Ciumasu, I.M. Dynamic decision trees for building resilience into future eco-cities. Technol. Forecast. Soc. Chang. 2013, 80, 1804–1814. [Google Scholar] [CrossRef]
  12. Son, C.S.; Kim, Y.N.; Kim, H.S.; Park, H.S.; Kim, M.S. Decision-making model for early diagnosis of congestive heart failure using rough set and decision tree approaches. J. Biomed. Inform. 2012, 45, 999–1008. [Google Scholar] [CrossRef] [PubMed]
  13. Gomes, C.M.A.; Almeida, L.S. Advocating the Broad Use of the Decision Tree Method in Education. Pract. Assessment Res. Eval. 2017, 22, 10. [Google Scholar] [CrossRef]
  14. Schrepel, T. The Making of an Antitrust API: Proof of Concept; Stanford University CodeX Research Paper; Stanford University: Stanford, CA, USA, 2022. [Google Scholar]
  15. Thakur, N.; Han, C.Y. A Study of Fall Detection in Assisted Living: Identifying and Improving the Optimal Machine Learning Method. J. Sens. Actuator Netw. 2021, 10, 39. [Google Scholar] [CrossRef]
  16. Le, T.M.; Tran, L.V.; Dao, S.V.T. A Feature Selection Approach for Fall Detection Using Various Machine Learning Classifiers. IEEE Access 2021, 9, 115895–115908. [Google Scholar] [CrossRef]
  17. Symbolic Frameworks, L. Protagonist: Decision Making. Available online: https://apps.apple.com/us/app/protagonist-decision-making/id1562381604 (accessed on 11 August 2024).
  18. Kowalski, L. Best Decision—Decision Maker. Available online: https://apps.apple.com/us/app/best-decision-decision-maker/id792954009 (accessed on 11 August 2024).
  19. Zingtree Inc. Zingtree. Available online: https://zingtree.com/en/resources/example-trees (accessed on 11 August 2024).
  20. Yonyx Inc. Yonyx. Available online: https://corp.yonyx.com (accessed on 11 August 2024).
  21. Ernest, H.; Forman, S.I.G. The Analytic Hierarchy Process—An Exposition. Oper. Res. 2001, 49, 469–486. [Google Scholar] [CrossRef]
  22. Dey, P. Project risk management: A combined analytic hierarchy process and decision tree approach. Cost Eng. 2002, 44, 13–26. [Google Scholar]
  23. Miro. Available online: https://miro.com (accessed on 11 August 2024).
  24. Structured Path GmbH. Diagrams. Available online: https://diagrams.app (accessed on 11 August 2024).
  25. Cinergix Pty Ltd. (Australia). Creately. Available online: https://creately.com (accessed on 11 August 2024).
  26. OpenEvidence. Cambridge, Massachusets. Available online: https://www.openevidence.com/ (accessed on 3 August 2024).
  27. KC House Data. 2022. Available online: https://www.kaggle.com/datasets/astronautelvis/kc-house-data (accessed on 11 August 2024).
Figure 1. Initial display of a simple decision tree.
Figure 1. Initial display of a simple decision tree.
Knowledge 04 00027 g001
Figure 2. After “yes” is clicked.
Figure 2. After “yes” is clicked.
Knowledge 04 00027 g002
Figure 3. After “meh” is clicked.
Figure 3. After “meh” is clicked.
Knowledge 04 00027 g003
Figure 4. After “a little” is clicked.
Figure 4. After “a little” is clicked.
Knowledge 04 00027 g004
Figure 5. After “NotSure” is clicked, there is branching based on all other possible answers.
Figure 5. After “NotSure” is clicked, there is branching based on all other possible answers.
Knowledge 04 00027 g005
Figure 6. The search box shows the results of searching the keyword “great”.
Figure 6. The search box shows the results of searching the keyword “great”.
Knowledge 04 00027 g006
Figure 7. After the reader selects “interested in myeloma” and “show next”, through the DECISIONTREE command, the reader is presented with a subtree teaching (Figure 8) about myeloma that was not present in the original decision tree text file.
Figure 7. After the reader selects “interested in myeloma” and “show next”, through the DECISIONTREE command, the reader is presented with a subtree teaching (Figure 8) about myeloma that was not present in the original decision tree text file.
Knowledge 04 00027 g007
Figure 8. Continuation of the myeloma subtree.
Figure 8. Continuation of the myeloma subtree.
Knowledge 04 00027 g008
Figure 9. After the reader indicates an interest in Apple Watches, they are prompted to input the name of the Apple Watch they are interested in.
Figure 9. After the reader indicates an interest in Apple Watches, they are prompted to input the name of the Apple Watch they are interested in.
Knowledge 04 00027 g009
Figure 10. After the reader inputs “Apple Watch SE” in the input box shown in the previous figure, the system executes a query and shows a new node with the correct link to the Apple Watch SE.
Figure 10. After the reader inputs “Apple Watch SE” in the input box shown in the previous figure, the system executes a query and shows a new node with the correct link to the Apple Watch SE.
Knowledge 04 00027 g010
Figure 11. Protagonist house-choosing example.
Figure 11. Protagonist house-choosing example.
Knowledge 04 00027 g011
Figure 12. Protagonist house-choosing result.
Figure 12. Protagonist house-choosing result.
Knowledge 04 00027 g012
Figure 13. Best Decision: choosing a laptop model.
Figure 13. Best Decision: choosing a laptop model.
Knowledge 04 00027 g013
Figure 14. Best Decision: choosing criteria and weight.
Figure 14. Best Decision: choosing criteria and weight.
Knowledge 04 00027 g014
Figure 15. Best Decision: choosing a laptop to buy.
Figure 15. Best Decision: choosing a laptop to buy.
Knowledge 04 00027 g015
Figure 16. Best Decision: result graph.
Figure 16. Best Decision: result graph.
Knowledge 04 00027 g016
Figure 17. Zingtree troubleshooting.
Figure 17. Zingtree troubleshooting.
Knowledge 04 00027 g017
Figure 18. Zingtree supports calculation.
Figure 18. Zingtree supports calculation.
Knowledge 04 00027 g018
Figure 19. Reader interface for Yonyx.
Figure 19. Reader interface for Yonyx.
Knowledge 04 00027 g019aKnowledge 04 00027 g019b
Figure 20. Miro-decision tree drawing tool.
Figure 20. Miro-decision tree drawing tool.
Knowledge 04 00027 g020
Figure 21. Diagrams decision tree drawing tool.
Figure 21. Diagrams decision tree drawing tool.
Knowledge 04 00027 g021
Figure 22. Creately decision tree drawing tool.
Figure 22. Creately decision tree drawing tool.
Knowledge 04 00027 g022
Figure 23. Trigonometry decision tree leading the reader to a solution for a.
Figure 23. Trigonometry decision tree leading the reader to a solution for a.
Knowledge 04 00027 g023
Figure 24. Continuation of the trigonometry subtree.
Figure 24. Continuation of the trigonometry subtree.
Knowledge 04 00027 g024
Figure 25. The reader selects “Yes” to the initial question and can select an answer to the current question.
Figure 25. The reader selects “Yes” to the initial question and can select an answer to the current question.
Knowledge 04 00027 g025
Table 1. Each product and its capabilities for readers. “Yes” means the product has the capability to support the application in the column; “No” means that it does not. For authors, dynamic decision trees are unique in allowing for a purely textual input.
Table 1. Each product and its capabilities for readers. “Yes” means the product has the capability to support the application in the column; “No” means that it does not. For authors, dynamic decision trees are unique in allowing for a purely textual input.
Product
Name
Product Choice
Application
Problem-Solving
e.g., Trigonometry
Complex Rules
e.g., Debate
External Data
Integration
Search
Functionality
ProtagonistYesNoNoNoNo
Best DecisionYesNoNoNoNo
ZingTreeYesYesYesYes, using Google Sheets webhook integrationNo
YonyxYesYesYesYes, through API callsYes, but for authors only
Dynamic decision treeYesYesYesYes, using an SQL databaseYes
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Vidal, J.; Jha, S.; Liang, Z.; Delgado, E.; Deneke, B.S.; Shasha, D. Dynamic Decision Trees. Knowledge 2024, 4, 506-542. https://doi.org/10.3390/knowledge4040027

AMA Style

Vidal J, Jha S, Liang Z, Delgado E, Deneke BS, Shasha D. Dynamic Decision Trees. Knowledge. 2024; 4(4):506-542. https://doi.org/10.3390/knowledge4040027

Chicago/Turabian Style

Vidal, Joseph, Spriha Jha, Zhenyuan Liang, Ethan Delgado, Bereket Siraw Deneke, and Dennis Shasha. 2024. "Dynamic Decision Trees" Knowledge 4, no. 4: 506-542. https://doi.org/10.3390/knowledge4040027

APA Style

Vidal, J., Jha, S., Liang, Z., Delgado, E., Deneke, B. S., & Shasha, D. (2024). Dynamic Decision Trees. Knowledge, 4(4), 506-542. https://doi.org/10.3390/knowledge4040027

Article Metrics

Back to TopTop