Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Decision Modeling Using Boolean Algebra in Spreadsheets Bryan Barney Reagan, Ph.D. Saint Leo University Law of Excluded Middle Aristotle (384 – 322 BC) “For every assertion must, as is admitted, be either true or false, ….” - Aristotle, Section 1, Part 4, “Categories”, The Organon, Translated by E. M. Edghill (2011) Page 15. Bust of Aristotle. Marble, Roman copy after a Greek bronze original By Lysippos from 330 BC; Photo http://commons.wikimedia.org/wiki/Lysippos Roots of X*X = X George Boole (1815 -1864 A.D.) Founded the field of Boolean Algebra in his two works: Mathematical Analysis of Logic (1847) and An Investigation of the Laws of Thought (1854) http://www.maa.org In order to use simple mathematical operations to model logic. In order for X*X to equal X, he used the values zero (0) and one (1) for false and true. (Boole, George, Investigation of the Laws of Thought, Chapter 3. pp. 39-51) Boole’s Notation Negation 𝑩 = 𝟎, 𝟏 (∀ 𝐛) 𝐛 ∈ 𝑩 → (∃ 𝟏 − 𝒃 ∈ 𝑩) ((𝟏 − 𝒃) ≠ 𝒃) Conjunction ∀𝐛 𝐛∈𝑩 → 𝒃∗𝟏=𝒃 𝒃∗𝟎=𝟎 ∀ 𝐚, 𝐛 𝐚, 𝐛 ∈ 𝑩 → 𝒂 ∗ 𝒃 = 𝒃 ∗ 𝒂 Disjunction Disjunction is denoted with +, but it is not simple addition since it must not produce results greater than 1. We can derive an expression for “A + B” using DeMorgan’s Thereom, with which Boole was familiar. A + B = 1 – ((1-A)*(1-B)) = 1 – (1 – A – B + AB) = 1 – 1 + A + B – AB = A + B - AB Disjunction ∀𝐛 𝐛∈𝑩 → 𝒃+𝟏=𝟏 𝒃+𝟎=𝒃 ∀ 𝐚, 𝐛 𝐚, 𝐛 ∈ 𝑩 → 𝒂 + 𝒃 = 𝒃 + 𝒂 Distributive Properties in Boolean Algebras ∀ 𝐚, 𝐛, 𝐜 𝐚, 𝒃, 𝒄 ∈ 𝑩 → 𝒂 ∗ 𝒃 + 𝒄) = (𝒂 ∗ 𝒃) + (𝒂 ∗ 𝒄 ∀ 𝐚, 𝐛, 𝐜 𝐚, 𝒃, 𝒄 ∈ 𝑩 → 𝒂 + 𝒃 ∗ 𝒄) = (𝒂 + 𝒃) ∗ (𝒂 + 𝒄 Logical Values in Spreadsheets Modern spreadsheets such as Excel support the Logical Values TRUE and FALSE , which may be entered as text or the result of comparisons using relational operators. Logical /Boolean Operators in Excel Operator Excel Notation Negation =NOT(B12) Conjunction =AND(B12, C12) =AND(B12:C12) Disjunction =OR(B12, C12) =OR(B12:C12) Conditional Formulas in Excel =IF( Test Expression, Value if True, Value if False) =IF(B12>500, 400, 0) =IF(AND(B12>500,C12>0), 400, 0) =IF(B12=MAX($B$2:$B$26),”*”,””) Conversion Between Logical and Binary Values • To convert from Logical to Binary, Excel allows multiplication of the values {False, True} by 1 to produce {0, 1}. = B12 * 1 • To convert from Binary values to Logical, you can use the OR function with a single parameter to convert an value from {0, 1} to {False, True}. = OR(C12) Solver Constraints Thank you [email protected]