Upload
elfreda-webster
View
214
Download
2
Embed Size (px)
Citation preview
Decision Modeling Using Boolean Algebra in
SpreadsheetsBryan Barney Reagan, Ph.D.
Saint Leo University
Law of Excluded MiddleAristotle (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 = XGeorge 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)
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)
http://www.maa.org
Boole’s Notation
Operation English BooleNegation NOT (1-A)
Conjunction AND A*B
Disjunction OR A+B
Aristotle BooleFalse 0
True 1
Negation
A NOT AFalse True
True False
A NOT A = (1-A)0 1
1 0
Conjunction
A B A AND BFalse False FalseFalse True FalseTrue False FalseTrue True True
A B A*B0 0 00 1 01 0 01 1 1
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
A B A OR BFalse False FalseFalse True TrueTrue False TrueTrue True True
A B A + B – (A*B)0 0 00 1 11 0 11 1 1
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.
Comparison Type SampleEquality =(B12 = 42)
Non-Equality =(B12 <> 42)Less Than =(B12 < 42)
Less Than or Equal to =(B12 <= 42)Greater Than =(B12 > 42)
Greater Than or Equal To =(B12 >= 42)
Logical /Boolean Operators in Excel
Operator Excel NotationNegation =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]