From Surf Wiki (app.surf) — the open knowledge base
Binary decision
A binary decision is a choice between two alternatives, for instance between taking some specific action or not taking it.
Binary decisions are basic to many fields. Examples include:
- Truth values in mathematical logic, and the corresponding Boolean data type in computer science, representing a value which may be chosen to be either true or false.
- Conditional statements (if-then or if-then-else) in computer science, binary decisions about which piece of code to execute next.
- Decision trees and binary decision diagrams, representations for sequences of binary decisions.
- Binary choice, a statistical model for the outcome of a binary decision.
Binary decision diagrams
A binary decision diagram (BDD) is a way to visually represent a boolean function. One application of BDDs is in CAD software and digital circuit analysis where they are an efficient way to represent and manipulate boolean functions.
The value of a boolean function can be determined by following a path in its BDD down to a terminal, making a binary decision at each node where a solid line is followed if the value of the variable at the node is true and a dotted line if it is false. A BDD is said to be 'ordered' if the order of the variables tested is fixed. A BDD is said to be 'reduced' if the two following conditions are true:
- Each successor of each node is distinct.
- There are no two distinct nodes of the same variable with the same successors. BDDs that are ordered and reduced can be called Reduced Ordered Binary Decision Diagrams (ROBDD). An example of a ROBDD is the figure to the right, which represents the function f(x_1,x_2,x_3)=\bar{x}_1\bar{x}_2\bar{x}_3+x_1x_2+x_2x_3. The order of the variables along any path is always x_1, x_2, then x_3, all nodes have distinct successors, and there are no two nodes of the same variable and the same successors.
Conditional statements
In computer science, conditional statements are used to make binary decisions. A program can perform different computations or actions depending on whether a certain boolean value evaluates to true or false.
The if-then-else construct is a control flow statement which runs one of two code blocks depending on the value of a boolean expression, and its structure looks like this: if condition then code block 1 else code block 2 end if condition 1 then code block 1 else if condition 2 then code block 2 else code block 3 end This can be represented by the flow diagram on the right. If one condition is found to be true, then the rest are skipped, so only one of the three code blocks above can be executed.
A while loop is a control flow statement which executes a code block repeatedly until its boolean expression becomes false, making a decision on whether to continue repeating before each loop. This is similar to the if-then construct, but it can executing a code block multiple times.
References
References
- (2007). "Making Critical Decisions: A Practical Guide for Nonprofit Organizations". John Wiley & Sons.
- Dixit, J. B.. (2009). "Computer Fundamentals and Programming in C". Firewall Media.
- Yourdon, Edward. (March 19, 1975). "Clear thinking vital: Nested IFs not evil plot leading to program bugs". [[Computerworld]].
- (1999). "Model Checking". MIT Press.
- (1985). "Discrete Choice Analysis: Theory and Application to Travel Demand". MIT Press.
- Kukreja, Jyoti. "Application of Binary Decision Diagram in digital circuit analysis".
- Pfenning, Frank. (October 28, 2010). "Lecture Notes on Binary Decision Diagrams".
- "Binary Decision Diagrams".
- "Programming - Conditionals".
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Binary decision — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report