Pl 158 - 2006 BOOLEAN SYSTEMS Definitions: Sets: Sets are collections of things; two sets are said to be identical if they have the same members and to be different if they don’t. Therefore, if two sets X and Y are different, there is something that is in one but not in the other. Hence all empty sets (those without members) are identical (or, there is only one empty set). X = Y means that X and Y are the same set. 0 will be used to designate the empty set. Logical operations on sets: Logical addition: the logical addition of X and Y is the set that contains all of the things that are in either set. The logical addition of X and Y is written as X Y. Logical multiplication: the logical multiplication of X and Y is the set of just those objects that are members of both sets. The logical multiplication of X and Y is written as X Y. Complementation: Y is the complement of X if all and only the things that are not members of X are members of Y. The complement of X is written as X'. To specify a complement requires a universe, the set of all things. 1 will be used to designate the universe. X is a subset of Y: all members of X are members of Y. This is written: X Y. Principles: Laws of commutativity: 1. X Y = Y X 2. X Y = Y X Law of double complement: 3. X'' = X Laws of idempotence: 4. X X = X 5. X X = X Laws of association: 6. (X Y) Z = X (Y Z) 7. (X Y) Z = X (Y Z) 2 Laws of distribution: 8. X (Y Z) = (X Y) (X Z) 9. X (Y Z) = (X Y) (X Z) DeMorgan's Laws: 10. (X Y)' = X' Y' 11. (X Y)' = X' Y' Boole’s Laws of Thought: The law of excluded middle: For any object a and any set X, a is either a member of X or is a member of X' 12. X X' = 1 The law of non-contradiction: For any object a and any set X, a cannot both be a member of X and of X' 13. X X' = 0 Subset laws: 14. X X 15. X Y if and only if Y' X' 16. if X Y and Y Z then X Z 17. X Y if and only if X' Y = 1 18. X Y if and only if X Y' = 0 ----------------------------------------Exercise I: (transposition) (hypothetical syllogism) (Boolean implication) 1. Explain why in Boole’s system of sets and operations (a) there must be an empty set and (b) all empty sets are the same set (that is, there is only one empty set). 2. True or false? (Give a short explanation of your answer) a. If X = Y, then X' = Y' b. (X Y)' = X' Y' c. If X Y then X' Y' = 1 3. a. b. c. d. e. f. True or false? (Give a short explanation of your answer) 11=0 10=0 01=1 00=0 11=1 10=0 3 g. 0 1 = 1 h. 0 0 = 1 ----------------------------------------Now we turn to an application of Boole's system, which has significant contemporary importance. First, a little about numeral systems. Numbers are abstract objects; numerals are their representations. So the number we ordinarily write as 2 is actually not the same as this character in the so-called Arabic numeral system. The number two can be represented as II in the Roman system and also as 1 + 1 (or by 3 - 1) in our common system. In the equation 1 + 1 = 3 - 1, the equals sign is functioning in the same way it is used by Boole; X = Y here means that "X" and "Y" represent the same thing. Our common numeral system is base 10. We use ten basic numerals 0, 1, 2, …,9 to represent all whole numbers. We do so by assigning meaning to place. So 123 is our way of writing the number one hundred twenty three by the convention that the right most place represents 1s, the next place represents 10s, the next represents 100s, and so on. So 123 is one hundred, two tens (i.e., 20) and 3 ones. Each place in the base 10 system is a power of 10: 100 = 1; 101 = 10; 102 = 100, 103 = 1,000, 104 = 10,000, and so on. Thus our standard way of writing 123 in base 10 is really the following expression (1 x 102 ) + (2 x 101 ) + (3 x 100 ) 100 + 20 + 3 This same scheme can be used for any number as the base of the entire representation system. The essential ingredients are that number of digits and the use of places as exponents of the base number. Of particular interest here is the binary -- or base 2 -system which uses two digits: 0 and 1. To write a number we express it in terms of exponents of 2. So let's take 4. This number is equal to 22 . The third place to the left is for exponent 2 (in base 10, it would the 100s place). Since 4 equals exactly 22, we just put 0 in the other places. So 4, in binary form, is expressed as 100, which means: (1 x 22 ) + (0 x 21 ) + (0 x 20 ) All whole numbers can be expressed in binary form as strings of 1s and 0s. Here is a more complicated example: express 123 in binary. It is handy to have a table of the exponents of 2 for such purposes; below is such a table through exponent 11: 4 20 = 1 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 27 = 128 28 = 256 29 = 512 210 = 1024 211 = 2048 So, to express 123 in binary we form a string of 1s and 0s corresponding to the place pattern used above. On the left side, we use the exponent of 2 that is equal to or smaller than the number to be represented: in this case 26 = 64 (since 27 would be too large). And then we fill in each place working to the right, as follows: (1 x 26 ) + (1 x 25 ) + (1 x 24 ) + (1 x 23 ) + (0 x 22 ) + (1 x 21 ) + (1 x 20 ) this is equal to the following: 64 + 32 + 16 + 8 + 0 + 2 + 1 (= 123). So the binary representation of 123 is: 1111011. ----------------------------------------Exercise II: 1. Express each of the following in binary form: a. 2 b. 7 c. 15 d. 41 2. Figure out how to use base 6 representation. Express 15 and 41 in the system. ----------------------------------------The binary system was of no particular interest in Boole's day; it was just one of many possible alternatives to the base 10 system, and certainly was not an attractive way to represent numbers. But if all one has to work with is two states, like “on” and “off,” then the binary system allows any number to be represented as a series of ons and offs (or 1s and 0s); this realization in the early 20th century made digital computers possible. If we look deeper into the binary numerals we see a surprising connection to Boole's system of sets. Adding numbers together follows rules that respect the places of each digit. So, in base 10, to add 23 and 45 we do as follows: add 3 and 5 to get 8--that is in the first place; then we add 2 and 4 to get 6---that is in the second place; the result is 68. If we need to do so, we carry a 1 from one place to the next (try adding 27 and 45 just to see this point). The same general rules apply to binary addition: we add by places and carry a 1 if necessary. Here is a non-carry example of adding 100 to 1011 (4 added to 11) 100 1011 1111 5 1111 is, of course, 15: (1 x 23 ) + (1 x 22 ) + (1 x 21 ) + (1 x 20 ). The "rules" that allow this addition are as follows: 0+0=0 0+1=1 1+0=1 Note that if we substitute 0 and 1 and , we have Boolean principles. In other words, binary addition is, fundamentally, a Boolean system based upon the same principles as the elementary theory of sets. Boolean equivalencies work for multiplication of binary numerals as well. The binary multiplication rules are: 0x0=0 0x1=0 1x0=0 1x1=1 Again, substituting 0 and 1 and , turns these into Boolean principles. The multiplication rules are employed just as in the base 10 case. So take the multiplication of 4 and 11 (which, of course, equals 44): 100 (x) 1011 100 100 000 100 101100 The only aspect of binary arithmetic that doesn't fit exactly Boole's system is where a carry digit is necessary. The fourth rule for + in the binary system is, of course, 1 + 1 = 10 which is really the corresponding Boolean rule 1 + 1 = 1 plus the instruction to carry the 1 to the next place (try adding 5 and 11 to see how this works). To see the convergence between Boole’s system and binary arithmetic, here are the addition and multiplication rules and their Boolean counterparts: 6 binary addition 1 + 1 = 10 (carry the 1) 1+0=1 0+1=1 0+0=0 binary multiplication 1x1=1 1x0=0 0x1=0 0x0=0 Boolean addition 11=1 10=1 01=1 00=0 Boolean multiplication 11=1 10=0 01=0 00=0 In fact, Boolean logical addition follows exactly the same rules as binary addition if we think of ourselves as being restricted to just one place (i.e., 1 or 0). ----------------------------------------Exercise III: 1. Add each pair of numbers in binary form: a. 2, 5 b. 7, 10 c. 15, 6 d. 41, 9 2. Multiply 7 and 10 in the binary system ----------------------------------------- 7 ANSWERS TO EXERCISES Exercise I: 1. (a) There are several ways to get to empty sets. For example, in Boole’s system, an empty set is required by the definition of logical multiplication. Let X and Y be sets with no members in common (such pairs of sets are called “disjoint”). Then their logical multiplication, XY, has no members. (b) As all empty sets have no members, and sets are identified by their members, all empty sets must be the same set. To see this, let W and Z be any two empty sets. If these sets were not the same, then there would be some member of W that was not a member of Z, but there is no such member, as neither set has members. Similarly, there are no members of Z that are not members of W. Therefore W and Z are identical. So there can be only one empty set. 2. (a) True 3. (a) (b) False False. (c) False (it contradicts the law of idempotence (b) True. The universal set and the empty set have no members in common, as the empty set has no members, and so multiplication of these two sets results in a set with no members: an empty set. (c) False (d) True. The empty set has no members, so there are no members an empty set can have in common with and empty set; therefore, multiplication of two empty sets is empty. (e) True. (due to idempotence) (f) False. The universal set has all things in it, and the empty set has nothing in it. Add everything and nothing, and you get everything (that is, the universal set). (g) True. Same reasoning as above (commutativity) (h) False. The empty set has no members. The set resulting from adding a set with no members with a set 8 with no members is another set with no members. Exercise II : 1. (a) 10 (b) 111 (c) 1111 (d) 101001 2) Base 6 uses the numerals: 0, 1, 2, 3, 4, 5. 10 is decimal 6 20 is decimal 12 100 is decimal 36. decimal 15 is 23 in base 6. decimal 41 is 105 in base 6. Exercise III: 1 To simplify matters, use the same number of digits in each number by adding on initial 0s. (a) 010 (2) +101 (+5) 111 (7) (b) 0111 +1010 10001 (c) (d) 2 1111 + 0110 10101 (7) (+10) (17) (15) (+6) (21) 101001 (41) +001001 (+9) 110010 (50) 0111 x 1010 0000 (7) (x10) 9 0111 0000 0111 1000110 (70)