260 likes | 538 Views
Boolean Algebra. Topics. Binary Number System AND, OR, NOT, Exclusive OR, and Implications operations Truth Tables and Algebraic Laws Boolean Logic and Circuits Application in Internet Searching Boolean Logic and Fallacies. Binary. OFF 0. ON 1. Counting Binary. AND.
E N D
Topics • Binary Number System • AND, OR, NOT, Exclusive OR, and Implications operations • Truth Tables and Algebraic Laws • Boolean Logic and Circuits • Application in Internet Searching • Boolean Logic and Fallacies
Binary OFF 0 ON 1
AND Usually denoted with ^ Example: 1 ^ 1 = 1 1 ^ 0 = 0
OR Usually denoted with ∨ Example: 1 ∨ 1 = 1 0 ∨ 0 = 0
Example 1 • For x = 1 and y = 0 • (x ^ y ) ∨ (x ^ y) • (1 ^ 0) ∨ (1 ^ 0) • 0 ∨ 0 • 0
NOT Usually denoted with ~ Example: ~1 = 0 ~0 = 1
EXCLUSIVE OR Usually denoted with ⊕ Example: 1 ⊕ 1 = 0 0 ⊕ 1 = 1 c
Example 2 • For x = 1, y = 1, z = 0 • ~(x ^ z) ⊕ ( y ∨ ~z) • ~(1 ^ 0) ⊕ ( 1 ∨ ~0) • ~0 ⊕ ( 1 ∨ 1) • 1 ⊕ 1 • 0
Implication Usually denoted with => Example: 1 => 1 = 1 0 => 1 = 1
Truth Tables • Table that lists ALL possible values for a particular equation. • Ex: (x ^ y ) ∨ (x ∨ y)
Algebraic Laws • Associativity => x ∨ (y ∨ z) = (x ∨ y) ∨ z • Commutativity => x ∧ y = y ∧ x • Distribution => x ∧ ( y ∨ z ) = (x ∧ y) ∨ (x ∧ z) • De Morgan => (~x) ^ (y) = ~(x ∨ y)
Transistors and Gates • Gates – A single entity that usually take in two inputs and produces an output. • Transistors – Works the same way as logical gates, but is an actual device. Building blocks a computer. • Number of Transistors in a modern CPU: 10 Million
Example: Half Adder • Adds 2 bits • 0 + 0 = 0 • 0 + 1 = 1 • 1 + 0 = 1 • 1 + 1 = 0 + 1 (carry_ • 0 + 0 + 1 = 1 • … • …
Searching Primitives • “pizza restaurants” “Mexican restaurants” • Both pizza restaurants and Mexican restaurants must appear as your result. • “respiration” OR “photosynthesis” • At least one of these results must appear as your result. This can mean only respiration, both, or only photosynthesis.
Searching Primitives • “William Shakespeare” -hamlet • Search for anything William Shakespeare related that does not include hamlet. Analogues to the NOT operator. • “Natural Disasters” +earthquakes • Search for anything that involves natural disasters, but the term earth quakes must be included.
Example: Searching Techniques • Suppose I am interested in scholarships, but I don’t want to search for any women or grade based scholarships. • Scholarships AND NOT minority OR need based • scholarships –minority OR –grades
Example 2: Searching Techniques • Let’s search for graduate school that are NOT in Alabama, but are in Georgia OR Florida • graduate schools -"Alabama" +"Florida" OR +"Georgia"
Fallacy I • A caused B therefore B caused A • Ex: Bill sets out several plates with bread on them. After a couple days, he notices that the bread has mold growing all over it. Bill concludes that the mold was produced by the bread going bad. • A => B must be equal to B => A. Let’s test that out!
Fallacy II • Is this a fallacy? • A cause B therefore B did not cause A • A=>B must be equal to ~(B=>A)