basic boolean concepts

Upload: sssbulbul

Post on 03-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Basic Boolean Concepts

    1/27

    BOOLEAN UNIT: BBC

    BASIC BOOLEAN CONCEPTS

    Developed by The Center for Conceptual Studies

    Presented by: Richard Singer [email protected]

    Phone Number: (314) 721-2779

    Edition Date: 1/00

    This is the first in a collection of units on boolean algebra. Appendix 2 gives an outline describingthese units and showing the relationship between them.

    Notation &: and : or : not : belongs to the set

    Boolean Lattice Laws This unit will introduce some specific structures called boolean lattices.The main laws that such structures satisfy are listed below for easy reference. You are notexpected to understand them untillater.

    xy = yx x+y = y+x commutative(xy)z = x(yz) (x+y)+z = x+(y+z) associative1x = x x1 = x 0+x = x x+0 = x identityx(y+z) = (xy)+(xz) x+(yz) = (x+y)(x+z) distributive0x = 0 x0 = 0 1+x = 1 x+1 = 1 annihilatorx+(xy) = x x(x+y) = x absorptionxx = x x+x = x idempotentx/x = 0 /xx = 0 x+/x = 1 /x+x = 1 complement(xy)+(x/y) = x (x+y)(x+/y) = x reduction/(xy) = /x+/y /(x+y) = /x/y /(/x/y) = x+y /(/x+/y) = xy DeMorgan//x = x double

    complement

    Briefs Parentheses and multiplication signs may be omitted according to the usual conventions ofordinary algebra.

    Boolean Inequality : The relation is defined by: x y iff xy = x

    x x reflexivex y & y x x = y antisymmeticx y & y z x z transitive0 x, x 0 x = 0 minimumx 1, 1 x x = 1 maximum

    x y xz yz, x y & w z xw yz additionx y x+z y+z, x y & w z x+w y+z multiplication

  • 7/28/2019 Basic Boolean Concepts

    2/27

    SECTION 0 INTRODUCTION

    Algebra When a collection of mathematical systems satisfy similar algebraic laws, we can classifythem as being of a certain type and study the laws common to this type of system. The ordinaryalgebra studied in secondary school focuses on laws for the integers, the rationals, the reals, andcertain other algebraic structures. Students are seldom aware of this point of view. They just thinkthey are studying algebra. They dont even have a special name for this type of algebra andprobably wouldnt even call it ordinary algebra, having never encountered another type of algebra

    and recognized it as such. The structures to which much of ordinary applies are examples of whatmathematicians call rings. There are many less familiar examples of rings, so ordinary algebra canbe considered as the study of the algebra common to some special kinds of numerical rings.

    Boolean Algebra What is boolean algebra? Why would anyone study it? Compared to themathematics normally taught in school, boolean algebra is new. It was invented in the 19th centurywhen George Boole investigated set operations and the operations of propositiona llogic. Booleanalgebra was later found to apply to the design of digital control systems. This present unit focuseson the concepts of boolean algebra by using these concepts to describe solutions for attributepuzzles. It also introduces the application of boolean algebra to digital design.

    The puzzles in this unit are stated as if they involved a challenge, but this is only to illustrate the

    idea of an attribute puzzle and to introduce boo

    lean concepts. Attribute puzz

    les invo

    lving some rea

    l

    challenges can be found in Various Attribute Puzzles. A more direct application of boolean algebrato logic can be found in Various Logic Puzzles. Likewise the digital design problem in this presentunit is simplistic. It is given only to illustrate boolean concepts. More significant design problemsare suggested in Digital Control Devices.

    Before illustrating the application of boolean algebra we exhibit some structures whose algebra isboolean, and we describe the laws they satisfy.

    BIT Operations The only competencies required for the study of boo lean algebra is anunderstanding of the basic concepts of ordinary algebra, and a flexible attitude towards the use ofnotation. The core structure for boolean algebra is a simple one, involving a set with only twoelements, denoted as 0 and 1. We shall refer to this set as BIT. The ordinary product of two bitsgives a bit. This is not the case for the ordinary sum, since the ordinary sum of 1 and 1 is 2. For asum operation that only gives bits, we must use either 1+1 = 1 or 1+1 = 0. It is the first of thesewhich will be the main focus of these units on boolean algebra, although the other sum is also usedin some of them. Boolean arithmetic also includes a unary operation /, called complementation,which is not suggested by any operation from ordinary arithmetic. Thus the main operations forBIT which we apply in this unit are given below.

    00 = 0 01 = 0 10 = 0 11 = 1 0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 1 /0 = 1 /1 = 0

    The set BIT is called a boolean lattice with respect to these operations, and the sum indicated aboveis called the boolean lattice sum. BIT is called a boolean ring with respect to the product above andthe sum operation for which 1+1 = 0. Unit Boolean Lattice Theorems, described in Appendix 4,gives a detailed discussion of the two types of operational structure for BIT. Both play an importantrole in contemporary mathematics.

  • 7/28/2019 Basic Boolean Concepts

    3/27

    Remark The main reason some people have difficulty with 1+1 = 1, is that they you associate thesymbol + exclusively with numerical addition. The convention above merely gives another use tothis symbol. We could use a different symbol for the lattice sum, but using + simplifies the notationfor boolean operations. It also makes it easy to transform habits learned in ordinary algebra tosimilar habits needed for boolean algebra. The use of the same name for different things that areclosely related is a common practice. For instance, new towns are sometimes named by theirsettlers, using names of the towns they left behind.

    Boolean Lattice Laws To use the operations for BIT, we focus on the algebraic laws satisfied bythese operations. The coverlists some of the main laws that are useful for BIT. Some of thesefollow immediately from the definition of BIT operations. For example, the identity law for sums isimmediate, since the only elements of BIT are 0 and 1, and since 0+0 = 0, 0+1 = 1, 1+0 = 1. Forlaws that are not as immediate, we can use BIT arithmetic on the expressions invo lved.

    These 2 tables show that bothparts of the distributive law aresatisfied.

    The first one shows whathappens when we use BITarithmetic to calculate x(y+z)and xy+xz for all possible bittriples for the variables (x, y, z).

    x y z x(y+z) xy+xz x y z x+yz (x+y)(x+z)

    0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

    00000111

    00000111

    0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

    00011111

    00011111

    These 2 table uses all possible bit pairs (x, y) toshow that both x+xy and x(x+y) are equal to x.

    Thus both parts of the absorption law are satisfied.

    x y x+xy x y x(x+y)

    0 0

    0 1

    1 0

    1 1

    0

    0

    1

    1

    0 0

    0 1

    1 0

    1 1

    0

    0

    1

    1

    Some of the boolean laws are the same as the laws of ordinary algebra, but BIT also satisfies someotherlaws that are not the laws of ordinary algebra. For instance, BIT satisfies the absorption lawas indicated in the preceding bit table, and the idempotent laws which are immediate from thedefinition of BIT operations since 00 = 0, 11 = 1, 0+0 = 0, 1+1 = 1. BIT also satisfies a strangeannihilatorlaw x+1 = 1, where 1 acts for sums the wayy0 act for products. While these laws mayseem strange when first encountered, once you are fami liar with them, you can use them as a majortools for transforming boolean expressions.

    Since ordinary algebra does not have an operation like the complement, this operation is also asource of some laws not found in ordinary algebra. That //x = x is immediate from the definition ofBIT operations. To show x+/x = 1, note that 0+/0 = 0+1 = 1 and that 1+/1 = 1+0 = 1. Thereduction laws can be easily verified by a bit table.

  • 7/28/2019 Basic Boolean Concepts

    4/27

    Boolean algebra can be considered as the study of the a lgebra common to some special kinds oflattices. For a general definition of ring and lattice, see Boolean Lattice Theorems. In this presentunit we will take a less abstract algebraic perspective. Note that boolean and ordinary algebra sharesome common laws. For both types of algebra, + and are commutative and associative, 0 and 1are identity elements for + and respectively, distributes over +. However in boolean algebra +also distributes over. Perhaps the most apparent difference is the idempotent law. Also theboolean complement does not behave like a numerical inverse. The similarities in laws allow sometechniques from ordinary algebra to be carried over into boolean algebra. Because there are

    differences, this must be done with some caution. Furthermore these differences allow fortechniques not available in ordinary algebra. One of the main purposes of this unit will be to exploitthe similarities and develop the differences in more detail.

    Bit String Lattices The laws on the cover are called boolean lattice laws rather than BIT laws, sinceBIT is only one of many structures that satisfy them. In particular, let BIT2 be the set of all bitstrings oflength 2, and define operations with the tables below. This can be generalized to bitstrings of any length.

    x /x 00 01 10 11 + 00 01 10 11

    If we denote 00 as 0and 11 as 1, then BIT2is a boolean lattice withrespect to these operations.

    0001

    10

    11

    1110

    01

    00

    0001

    10

    11

    00 00 00 0000 01 00 01

    00 00 10 10

    00 01 10 11

    0001

    10

    11

    00 01 10 1101 01 11 11

    10 11 10 11

    11 11 11 11

    Note that for bit strings x and y, we have xy = x iff all the bits in x are less than or equal to thecorresponding bits in y. This is one of the observations that motivated the definition of the relation on the cover. At times we want to focus on the fact that x y but x y. We denote this asx < y. An element of a boolean algebra is called an atom iff the only element less than it is 0. For abit string lattice the atoms are those elements having exactly one bit which is a 1.

    Set Lattices Let X and Y be any subsets of the set {a, b, c}. Denote this set by 1 and the empty setby 0. Denote the union and intersection and of X with Y as X+Y and XY respectively. Denote thecomplement of X as /X. It is easy to show the set of all subsets of {a, b, c} satisfies the booleanlattice laws. Furthermore, the boolean defined on the cover is merely the subset relation and theatoms are the sets with exactly one element. Of course from an algebraic perspective there isnothing special about the subsets of {a, b, c} The collection of subsets of any set forms a boo leanlattice in a similar manner, and in contemporary mathematics the study of sets is the mainapplication of boolean concepts.

    Def of for Boolean Lattices The subset relation can be described in terms of the intersectionoperation. In particular x is a subset of y if and only if the intersection of x with y is x. Thissuggests the definition of the relation for boolean inequalities given on the cover. Thisdefinition allows us to change an inequality to an equation, and thus easily mix the use ofinequalities and equations in boolean algebra.

  • 7/28/2019 Basic Boolean Concepts

    5/27

    Def of Atoms For Boolean Lattice The intersection any set A having exactly one element with anyother set is either A or 0. The concept of an atom can also be defined in terms of a lattice products,Thinking of an atom as element with only 0 as smaller is more intuitive than the one given below,however it is less algebraic.

    a is an atom iff a 0 and for any x either ax = a or ax = 0.

    Note that that the product of 2 different atoms is 0 follows from this definition.

    Terminology Note that any set is the union of all its single element subsets. Thus it is the sum ofthe atoms it contains. Likewise a bit string is the sum of the atoms it contains. The fact that allother elements of a boolean lattice can be built by adding atom is what suggests the concept of anatom.

    Bit String Names Name any subset X of {a, b, c} by writing a 1 in bit 1 if aX, a 1 in bit 2 if bX,a 1 in bit 3 if cX. Let denote the function that maps a set to its bit string name. The bit stringnames for the subsets of {a, b, c} are given below. A similar coding method can be used for thesubsets of any finite set.

    {} = 000, {a} = 100, {b} = 010, {c} = 001,

    {a, b} = 110, {a, c} = 101, {b, c} = 011, {a, b, c} = 111

    Side Remark Since (/{a, b} = 001 and /{a, b} = 001Thus (/{a, b} = /{a, b}. Also note that({a, c}{a, b}) = {a, c}{a, b}, and ({a, c}+{a, b}) = {a, c}+{a, b}. This can begeneralized as below, allowing us to use bit strings arithmetic to do set arithmetic. Since computershave machine level instructions for bit string arithmetic, this gives an efficient method forprogramming computers to work with sets. Such programs can also be written in higherlevellanguage, as indicated by the project in Appendix ??.

    /(X) = (/X) (XY) = (X)(Y) (XY) = (X)(Y)

    Propositional Logic The boolean system BIT can be related to logic by letting variables representpropositional formulas and letting 0 and 1 represent false and true. Since a+b = 1 if a = 1 or b = 1,

    the lattice sum represents the logical operation of inclusive alternation and we may read a+b asa or b. Likewise the boolean product represents the logical operation of conjunction and we mayread ab as a and b, while the boolean complement represents logical negation and we may read /aas not a. Because of this application to logic some books use the logical symbols & and ratherthan and + for these operations. Some applications of boolean algebra to logic are given inVarious Logic Puzzles. For an extensive application of boolean algebra to propositionallogic, seethe our units on mathematicallogic.

    A Broader Perspective on Mathematics The main reason we have developed the units on booleanalgebra is to bring a broader perspective on mathematics to a wider audience. For a brief discussionthis see Appendix 1.

  • 7/28/2019 Basic Boolean Concepts

    6/27

    SECTION 1 BIT VARIABLES AND BIT STRINGS

    Attribute Item Puzzles This section applies boolean algebra to some simple attribute puzzles. Thesimplest of these puzzles refer to the set BAS. BAS contains 8 elements: a small red diamond, asmall blue diamond, a small red circle, a small blue circle, a large red diamond, a large blue diamond,a large red circle, a large blue circle. BAS stands for Binary Attribute Set, so named because eachattribute type has 2 possible values. Puzzles that refer to the set BAS are called binary item puzzlesand will be labeled with the letters BI. Using the first letter for each attribute value, we give each

    item a brief name indicating size, color, shape.

    BAS = {srd, src, sbd, sbc, lrd, lrc, lbd, lbc}

    BI0 I am thinking of an item i from BAS. i is not small. i is not red. i is small or i is a circle.Determine this item.

    Manifest Solution Using tokens for elements of BAS, we can use each clue to eliminate itemswhich do not satisfy the clue. Tokens make it fairly easy to solve a puzzle this way, but we can alsodescribe a solution as follows.

    i is not small so keep: lrd, lrc, lbd, lbci is not red so of these keep: lbd, lbc

    i is small or a circle so of these keep: lbcBoolean Table Solutions for Attribute Puzzles

    For any clue, there is a unique subset of BAS thatsatisfies the clue, and which can be coded by a bitstring. This bit table indicates how to solve BI0using BIT8. There is a row for each of the mainsubsets of BAS.

    Using BIT8 arithmetic on these gives rows for the

    satisfaction subset of the clues. The product ofthese gives the final row which the shows that lbc isthe only item satisfied by all the clues.

    lbc lbd lrc lrd sbc sbd src srd

    LBCSRD

    111000

    110001

    101010

    100011

    011100

    010101

    001110

    000111

    /S

    /RS+C

    1

    11

    1

    10

    1

    01

    1

    00

    0

    11

    0

    11

    0

    01

    0

    01

    ALL 1 0 0 0 0 0 0 0

    BIT String Description Except for notation, the BIT8 arithmetic solution to BI0, is similar to themanifest one. The only difference is that a bit table shows items eliminated by each clue. Once youare used to bit tables, it is convenient to abbreviate each row as a string from BIT8. This gives thefollowing brief description of this solution.

    iS 1111 0000 Note: To make bit strings easier to read, we use a space in the middle.

    iR 1100 1100 Names of items are omitted. If you forget which items theiS iC 1010 1111 bits refer to, recall the table for BI0.All 1000 0000lbc

    BIT Variables The main subsets of BAS are denoted by S, L, R, B, D, C. S denotes the smallitems, L the large items, etc. Given a puzzle, we use s, l, r, b, d, c as variables indicating which ofthese subsets the item we want must belong to.

    s = 0 if iS l = 0 if iL r = 0 if iR b = 0 if iB d = 0 if iD c = 0 if iCs = 1 if iS l = 1 if iL r = 1 if iR b = 1 if iB d = 1 if iD c = 1 if iC

  • 7/28/2019 Basic Boolean Concepts

    7/27

    Instead of using BIT8 arithmetic, we could use BIT variables to give an algebraic solution to BI0.For example, the information in the clue iS iC can then be given as s+c = 1. Standardnotational convention from ordinary algebra are also used in boolean algebra.

    Brief Algebraic Description

    (1) s = 0 (2) r = 0 (3) s+c = 1 clues

    (4) l = 1 by (1)

    (5) b = 1 by (2)(6) c = 1 by (1)(3)(7) lbc = 1 by (4)(5)(6) Note: This is brief for (lb)c = 1.

    Algebraic Laws For BAS To see that (4) follows from (1), first take complements to obtain /s = /0.Then use /s = l. These is one of the algebraic laws below which hold for BAS because of themeaning of the variables and the relationships between attributes.

    sl = 0, s+l = 1, /s = l, /l = s, rb = 0, r+b = 1, /r = b, /b = r, dc = 0, d+c = 1, /d = c, /c = d

    BI1 i is large and i is red. i is blue or i is a circle.

    BI2 i is a circle or i is small. i is blue or a diamond. i is red.

    BIT8 Solutions BI1iL & iR 0011 0000iB iC 1110 1110All 0010 0000

    BI2

    iC iS 1010 1111iB iD 1101 1101

    iR 0011 0011All 0000 0001

    BIT Algebra Solution For BI1 we give a detailed explanation for each step. We leave it to you todo the same for BI2.

    BI1

    (1) lr = 1 clue(2) b+c = 1 clue(3) b = 0 (1) mult by b, br = 0, annih(4) c = 1 (3)(2) replace b, ident(5) lrc = 1 (1)(4) mult, 11 = 1

    BI2

    (1) c+s = 1 clue(2) b+d = 1 clue(3) r = 1 clue(4) d = 1 (3)(2)(5) s = 1 (4)(1)(6) srd = 1 (5)(3)(4)

    Details An algebraic description should include enough details to make it easy to follow, but not somany to make it tedious. If we the amount of details doesnt suit your taste, either expand orcontract our description. For more detail we could insert a step with b = 0 before step (4) in thesolution for BI2. However since the only colors are red and blue, b = 0 follows intuitively from (3).From an algebraic perspective, we can complement r = 1 to obtain b = 0. Since br = 0, taking the

    product of r = 1 with b also gives this result. While it is useful to use your intuitive understandingof BAS, it is also useful to develop an algebraic perspective. One main advantages of algebraicreasoning is that it allows you to focus on the form of you reasoning without having to reca ll itscontent. To check your understanding you may want to write both algebraic and arithmeticsolutions for the puzzles below. They are written in a brief fashion using S for iS, R for iR, etc.

    BI3 (1) SB (2) RC (3) S BI4 (1) R S (2) DB (3) C

  • 7/28/2019 Basic Boolean Concepts

    8/27

    Calculating Strings To see which items satisfy a clue, you can think about its meaning, but there isalso a algorithm for calculating its string from the strings of its atomic parts. The clue it is not ablue circle is satisfied by items that are not blue circles, so its string is 01110111. While this iseasily be obtained without using a calculation from atomic parts, writing the details of the bit stringarithmetic illustrates a method that can also be used for more complex clues. Computers containcircuits that can directly perform such calculations.

    (1) iB 1100 1100

    (2) iC 1010 1010(3) iB & iC 1000 1000 BIT8 product of (1) and (2)(4) (iB & iC)0111 0111 BIT8 complement of (3)

    Suppose we want the string foriB & iC. This clue says it is not blue and it is a circle. Itdenies blue while asserting circle, and thus has 00100010 for its bit string. Using (1) and (2) above,this is calculated below. iB & iC differs from (iB & iC) which does not deny or asserteither attribute, but which denies the combination of 2 attributes.

    (5) iB 0011 0011 BIT8 complement of (1)(6) iB & iC 0010 0010 BIT8 product of (2) and (5)

    A More Complex Clue Consider the clue It is not both a red circle and large or blue. This clueonly eliminates the large red circle. Writing this clue as (iR & iC & (iL iB)), we cancalculate its bit string in stages.

    (1) iR 0011 0011(2) iC 1010 1010(3) iR & iC 0010 0010 BIT8 product (1) and (2)(4) iL 1111 0000(5) iB 1100 1100(6) iL iB 1111 1100 BIT8 sum (4) and (5)(7) iR & iC & (iL iB) 0010 0000 BIT8 product (3)and (6)

    (8) (iR&iC&(iLiB)) 1101 1111 BIT8 product

    The Set XAS The preceding puzzles refer to BAS. For slightly more challenging puzzles we use aset of attribute items called XAS. XAS includes these items and 16 more, with green and yellow asadditional colors and triangle as an additional shape. The name of an item indicates its attribute inthe obvious way. For example sgt is the small green triangle. Along with the variables s, l, r, b, d,c; we use y, g, t in the obvious manner. For example, g = 0 means the item is not green. The rest ofthe puzzles in this section are called attribute item puzzles and will be labeled with the letters XI.

    BIT24 As with BI puzzles, we could use bit strings to solve XI puzzles, however we would needstrings from BIT24, such strings 111000000000111000000000 for the blue items. Such strings aretedious to use. Thus we only use algebraic solutions with BIT variables for such puzzles. A way of

    using BIT24 for this puzzles with more compact names is illustrated in the unit Solving AttributePuzzles

    XAS Laws Because there are 2 sizes, 4 colors, 3 shapes XAS laws include:

    s+l = 1, t+d+c = 1, y+r+g+b = 1, sl = 0, td = 0, td = 0 dc = 0, yr = 0, etc.

    We also have laws such as: /s = l, /t = d+c, /y = r+g+b.

  • 7/28/2019 Basic Boolean Concepts

    9/27

    Conditional Clues For a conditional XY we call X the antecedent Y the consequent. Aconditional only eliminate items which satisfy the antecedent but not the consequent. Thus XYcan be described by the boolean equation x/y = 0, where x and y are boo lean values correspondingto X and Y. For instance, the clue if i is red then i is a diamond only eliminates the red items thatare not diamonds. Thus a boolean equation for the clue RD, can be given by r/d = 0. Likewise,the clue SC only eliminates the small items that are not circles, and can be described by s/c = 0.

    Above we expressed the conditional clue RD by r/d = 0. Since this clue is satisfied by a red

    item iff this item is a red diamond, this clue also gives the boolean equation r = rd. The deductionbelow uses the boolean lattice laws to shows that the equations x/y = 0 and x = xy are equivalent.Thus for a clue of the form XY we can use either form. In most cases representations that avoidcomplements make the algebra easier.

    x = xy assume x/y = 0 assumex/y = xy/y mult by /y xy+x/y = xy+0 add xyx/y = 0 compl, annihil x = xy reduct, ident

    XI0a i is red or green. i is not a red diamond. i is not a circle. If i is green then i is a circle.If i is a small then i is a not red.

    Sol

    ution The discussion on conditional

    s indicates that we coul

    d represent cl

    ue 5 either by s

    //r = 0ors = s/r. However since clue 5 eliminates small red items, it can also be represented by the simplerequation sr=0.

    (1) r+g = 1 (2) rd = 0 (3) c = 0 (4) g = gc (5) sr = 0 clues

    (6) g = 0 (3)(4) Note: using g/c = 0 for (4) gives the same result(7) r = 1 (6)(1)(8) d = 0 (7)(2)(9) t = 1 (3)(8) Note: this uses t+d+c = 1(10) l = 1 (7)(5) Note: this uses s+l = 1

    (11)l

    rt = 1 (10)(7)(9)Comment Manifest solutions to XI involve 24 tokens, and a bit table for such puzzles has 24 rows.Since these are tedious to describe, we only present algebraic descriptions for solutions to thesepuzzles. Propositionallogic is another approach that gives fairly brief solutions to these puzzles.Try to solve the next 2 puzzles before looking ahead to their solutions.

    XI0b i is blue or i is red. If i is small then i is not blue. If i is red then i is a diamond. i is small.

    XI0c i is yellow or i is a triangle. If i is a triangle then i is not small. If i is circle then i is red. i issmall.

    Solutions (1) b+r = 1 clue (1) y+t = 1 clue(2) sb = 0 clue (2) ts = 0 clue

    (3) r = rd clue (3) c = cr clue(4) s = 1 clue (4) s = 1 clue(5) b = 0 (4)(2) (5) t = 0 (4)(2)(6) r = 1 (5)(1) (6) y = 1 (5)(1)(7) d = 1 (6)(3) (7) r = 0 (6) This uses yr = 0(8) srd = 1 (4)(6)(7) (8) c = 0 (7)(3)

    (9) d = 1 (5)(8) This uses c+d+t = 1(A) syd = 1 (4)(6)(9)

  • 7/28/2019 Basic Boolean Concepts

    10/27

    Reminder If x and y are boolean variables corresponding to an attribute X and an attribute Yrespectively then a clue of the form XY can be represented, either by x = xy or by x/y = 0.When the conditional is of the form X = Y it could be represented either by x = x/y or by x//y= 0, but it can also be represented more simply by xy = 0.

    XI0d If i is green then i is a small circle. If i isnt a circle then i isnt red. i is neither yellow norblue. If i is not large then i is a triangle.

    Solution Clue 2 could be represented by /cr = 0, but since /cr+cr = r, /cr = 0 is equiva lent to cr = r.

    Clue 3 can be represented by /(y+b) = 1, but /(y+b) = r+g, so we can use r+g = 1. Clue 4 can berepresented by /l/t = 0, but this is equivalent to t+l = 1. Thus each clue can be represented withoutusing complements.

    The comments to the side indicate in more detail how boolean laws and concepts apply. Howeverin these and other comments the use of the associative and commutative laws is ignored.

    (1) g = g(sc) (2) cr = r (3) r+g = 1 (4) l+t = 1 clues

    (5) sc = 0 (4) mult by sc; ct = 0, sl = 0 , ident: (sc)1 = sc(6) g = 0 (5)(1) annihil: g0 = 0(7) r = 1 (6)(3) ident: r+0 = r

    (8) c = 1 (7)(2) ident: c1 = c(9) t = 0 (8) mult by t; ct = 0, ident: 1t = t(10) l = 1 (9)(4) ident: l+0 = l

    Summary for Representing Conditional Clues A conditional clue eliminates items which satisfy theantecedent but not the consequent. Thus we can always represent a conditional clue by equating theproduct of an expression for the antecedent and an expression for the complement of theconsequent to zero. The first row below gives a brief summary for representing conditiona l cluesthis way. In the above puzzles we saw how various conditional clues can also be representedwithout using complements. This is indicated in the second row.

    X

    Y as x/y = 0 X

    Y as xy = 0

    X

    Y as /xy = 0

    X

    Y as /x/y = 0XY as x = xy XY as xy = 0 XY as y = xy XY as x+y = 1

    Remark See the BBC.X if you want more XAS puzzles like those from this section.

  • 7/28/2019 Basic Boolean Concepts

    11/27

    SECTION 2 REPESENTING BIT FUNCTIONS AND CIRCUIT DESIGN

    Digital Control Devices Electronic control devices are built from 3 main components,corresponding to the BIT operations /, , +. Inputs and outputs for these components are indicatedbelow. Since the standard symbols for electronic design diagrams are somewhat tedious to design,we use labeled boxes rather than these symbols.

    0 / 1 and 1 / 0

    0 0

    0 0

    1 0

    1 1

    0 1 0 1

    0

    + 00

    + 11

    + 11

    + 10 1 0 1

    Situation Two switches control a light X. Using either switch changes the light to on if it is off,while using a switch changes the light to off if it is on. Each switch sends an input signal of 1 whenup, 0 when down. The output x is1 if the switches send the same signals, and this results in the lightbeing on. The output x is 0 if the switches send opposite signals, and this results in the light beingoff.

    Input 00 gives output 1 Input 01 gives output 0 Input 10 gives output 0 Input 11 givesoutput 1

    Since the equation x = ab+/b/a can be used tocalculate the relation between the output x and theinputs a and b, the following arrangement of thesecomponents will have the desired output.

    a

    xb

    +

    /

    /

    To see that this has the desired result we can trace the results of the various inputs for this circuit.Note we abbreviate each complement gates by a / followed by is input.

    0

    1

    0

    0

    1

    0

    1

    1

    0 0 1 0 0 0 1 1

    + + + +

    /0

    1 /0

    0/1

    0

    /1

    1

    /0 /1 /0 /1

  • 7/28/2019 Basic Boolean Concepts

    12/27

    General Perspective A bit function is a function whose inputs and output come from {0,1}. Avariety of situations like the light switch one can be described using bit functions, however thealgebra of these functions is independent of any of their app lications. A polynomial contain noparentheses when abbreviated by the usual algebraic conventions for order of operation. Booleanalgebra can be used to transform any boo lean expression into an equivalent boolean polynomial, soany bit function can be represented by a boolean polynomial, and in fact more than one suchpolynomials. For various reasons we may want to select from these alternatives one which has beenreduced to be as simple as possible.

    There are 16 possible bit functions of two variable. Polynomial representations for all but two ofthese are indicated in the table below. The one labeled x is the light switch function, which wehave just shown can be represented by ab+/a/b. The one after it is its complement, and so welabeled it as /x. This means that it can be represented by /(ab+/a/b). However this is not apolynomial. Note that it can also be obtained by adding the columns under /ab and a/b. Thus ithas /ab+a/b as a polynomial representation.

    a b 0 /a/b /ab a/b ab /a /b x /x /a+/b /a+b a+/b a+b 1

    0 0 0 1 0 0 0 1 1 1 0 1 1 1 0 1

    0 1 0 0 1 0 0 1 0 0 1 1 1 0 1 1

    1 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1

    1 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1

    Since each function has 4 outputs each such function can be coded as a bit string from BIT4. Forexample, the 4 functions represented by the polynomials /a/b, /ab, a/b, ab are coded by theatoms 1000, 0100, 0010, 0001 of BIT4. The only difference between describing a function by a bitstring rather than by a table is that the inputs are implicit in the order of the bits. It is fairly easy toverify that these 4 atoms can be represented by the sing le term polynomials labels used in the tables.

    Since each other non-zero function with 2 inputs can be bui lt as a sum of 2 or more of thesefunction, the set consisting of these functions is called the atomic basis for functions with 2 inputs.For example, the function f which we could describe as 0111, that is the function whose first threetable entries are 1 and whose last entry is 0 can be built as f = /ab+a/b+ab. In general, to represent afunction f of 2 variables this way simply see how its BIT4 code is the lattice sum of BIT4 atoms.

    The polynomial /ab+a/b+ab is eqaul to the simpler polynomial a+b, as you can see by bit arithmetic.It can also be reduced to a+b by boolean algebra. The main strategy used to reduce atomic basispolynomials is illustrated below. First look for reducible pairs of terms, that is a pair that differs inexactly one factor. Thus in /ab+a/b+ab, /ab+ab is a reducible pair. By the reduction law the sum ofthis pair reduces to b, giving b+a/b. Likewise, the pair a/b+ab will reduce to a. To be able to makeboth reductions we use the idempotent law to replace ab by ab+ab, thus having a copy of ab for

    each reduction. This allows us to reduce /ab+a/b+ab to a+b./ab+a/b+ab = /ab+a/b+ab+ab idemp, assoc

    = (ab+a/b)+(/ab+ab) comm, assoc

    = a+b reduct

    For functions with 2 inputs it is easy to find a reduced polynomial without using boolean algebra.Looking at the table 1010, we see that this can be represented by /b without first representing it asa/b+/a/b. However using the atomic basis representation illustrates a method that works in general.

  • 7/28/2019 Basic Boolean Concepts

    13/27

    Functions with 3 Inputs As with functions of 2 input variable there is a direct method forrepresenting any other function with 3 inputs can as a sum of 2 or more of the atomic basisfunctions below.

    Note there are 8 possible triplesinvolving 3 bits. Thus a bitfunction of 3 variables can becode by an element of BIT8.Thus there are 256 bit functionsinvolving 3 variables. Exactly 8of these have tables containing asingle 1.

    a b c /a/b/c /a/bc /ab/c /abc a/b/c a/bc ab/c abc

    0 0 0 1 0 0 0 0 0 0 0

    0 0 1 0 1 0 0 0 0 0 00 1 0 0 0 1 0 0 0 0 0

    0 1 1 0 0 0 1 0 0 0 0

    1 0 0 0 0 0 0 1 0 0 0

    1 0 1 0 0 0 0 0 1 0 0

    1 1 0 0 0 0 0 0 0 1 0

    1 1 1 0 0 0 0 0 0 0 1

    Reduction Method To find a polynomial expression for a function from its BIT8 code, just think of

    it as a sum of its atoms and write the corresponding sum of basis polynomials. To reduce this lookfor reducible pairs and use the idempotent law to introduce any extra copies. For example, in thepolynomial with code 00011010 the sum is 00010000+00001000+0000010. Thus it can berepresented by a/b/c+a/bc+ab/c.To reduce this note that the pair (a/b)/c+(a/b)c reduces to a/b and that (a/c)/b+(a/c)b reduces to a/c.Thus this polynomial reduces to a/b+a/c.

    a/b/c+a/bc+ab/c = a/b/c+a/b/c+a/bc+ab/c = a/b+a/c.

    As a further example illustrating the representing of

    bit functions, we write the atomic basis representationsfor some functions and use boolean algebra to findreduced polynomial representations. You may want totry to do this yourself before reading our solutions.

    a b c p q r s t

    0 0 0 1 1 0 0 0

    0 0 1 1 0 1 1 10 1 0 1 0 0 0 0

    0 1 1 0 0 0 0 1

    1 0 0 0 1 1 1 0

    1 0 1 0 1 0 0 0

    1 1 0 0 0 1 0 1

    1 1 1 0 0 0 1 1

    p = /a/b/c+/a/bc+/ab/c = (/a/b)/c+(/a/b)c+(/a/c)/b+(/a/c)b = /a/b+/a/c

    q = /a/b/c+a/b/c+a/bc = (/b/c)/a+(/b/c)a+(a/b)/c+(a/b)c = a/b+/b/c

    r = /a/bc+a/b/c+ab/c = /a/bc+(a/c)/b+(a/c)b = a/c+/a/bc

    s = /a/bc+a/b/c+abc which is already reduced

    t = /a/bc+/abc+ab/c+abc = (/ac)/b+(/ac)b+(ab)/c+(ab)c = ab+/ac

    Note For t there are 3 reducible pairs /a/bc+/abc, ab/c+abc, /abc+abc. We only used the first 2 ofthese. Introducing an extra /abc and abc would have resulted in the polynomial ab+bc+/ac. Sincethis has a larger input count, it is not reduced. In general, when reducing an atomic basispolynomial, only introduce only extra copies of terms when needed to reduce a term that cannot bereduced in another way.

  • 7/28/2019 Basic Boolean Concepts

    14/27

    SECTION 3 WORLD VARIABLES AND SET LATTICES

    Overview The puzzles in this section all refer to an attribute item, but the clues given do notuniquely determine this item. The task is to determine the puzzle world, namely the largest set Wthat contains the items that satisfy all the clues. To illustrate these ideas let us consider an item fromBAS which satisfies the clues below.

    BAWP0 i is blue or i is small. iB iS

    i is red orlarge. iR iL

    i is not a diamond. iD

    Solutions The BIT8 arithmetic solution is like theBIT8 solutions used before, except that the set Wwhich satisfies all clues has more than one element.This is simpler than the algebraic solution below,primarily because BAS only has 8 elements.

    iB iS 1111 0011iR iL 1100 1111iD 0101 0101

    iW 0100 0001 {src, lbc}

    For each puzzle we use a boolean algebra in which the multiplicative identity is the puzzle world.To stress this we use the symbol 1 instead of W. We use boldface 1 to distinguish this from a 1

    which denotes a bit. We also use a boldface 0 to denote the empty set. We use variables in a waythat extends their use form Section 1. The letter: s, l, r, b, c, d are now used as world variables, inthe sense that s denotes the set of items in 1 that are small, l the items in 1 that are large, etc. Sincethe world for each puzzle in Section 1 has one member, we also could have interpreted 0 as theempty set and 1 as the world. Thus unlike the puzzles in this section, its only subsets are 0 and 1, soeach of the world variables is also BIT variables. Line (8) below shows that 1 is the union of srcand lbc. Thus 1 cannot contain any items other that src and s = lbc. Since src and lbc both satisfyall the clues, the puzzle world is {src, lbc}.

    Solution (1) b+s = 1 (2) r+l = 1 (3) d = 0 clues

    (4) sr = r (1)

    (5) lb = b (2)(6) sr+lb = 1 (4)(5)(7) c = 1 (3)(8) 1 = src+lbc (6)(7)

    Comments In algebraic solutions we omit the multiplication sign. Thus src means src, and namesa set rather than the small red circle. In this puzzle src denotes the set whose only member is thesmall red circle. Likewise, lbc denotes the set whose only member is the large blue circle. Howeversrd = 0, so srd denotes the empty set. The deduction below expands the solution of this puzzle toshow in detail how boolean laws and concepts apply.

    (1) b+s = 1 (2) r+l = 1 (3) d = 0 clues

    (a) br+sr = 1r (1) mult by r, dist(4) sr = r (a) use br = 0, ident(b) rb+lb = b1 (2) mult by b, dist(5) lb = b (2) use rb = 0, ident(6) sr+lb = 1 (4)(5) add, r+b = 1(7) c = 1 (3) apply /, /d = c, /0 = 1(c) (sr+lb)c = 1 (6)(7) mult, 11 = 1(8) src+lbc = 1 (c) dist Thus i = src i = lbc.

  • 7/28/2019 Basic Boolean Concepts

    15/27

    Number World Puzzles Many problems in ordinary algebra can be considered as number worldproblems. For one that gives rise to a linear equation in one unknown, we expect the world tocontain a single number. For one that gives rise to quadratic equation in one unknown, we do notnecessarily expect the world to contain a single number. While we may have been told to check thesolution we derive, we seldom bother, since most of the time we just hope that we made a correctdeduction, and we trust that this will only yield answers that work. Many students are puzzled whenwe first encounter the phenomena of extraneous roots, since such roots occur even when we havemade a correct deduction. Consider the 2 number world puzzles below. We can deduce a solutions

    using ordinary algebra much as we use boolean algebra to solve attribute world puzzles.NWP1 Squaring a number and increasing the result by 1 and gives the same result as doubling. thisnumber.

    NPW1 Doubling a number and then increasing this result by 1 and then taking the square rootgives the original number.

    Solutions x2x = 2(x+2) clue 1x = (x+5) clue

    x2x = 2x+4 x22x+1 = x+5

    x23x4 = 0 x23x4 = 0

    (x4)(x+1) = 0 (x4)(x+1) = 0

    x = 4 x = 1 x = 4 x = 1

    Extraneous Roots From the solutions above it would appear that the world for both puzzles is theset{4, 1}. However the number 4 does not satisfy the clue for NPW2, since increasing 14 gives 3and since the square root of 4+5 is positive 3. A correct deduction from a set of clues only showsthat everything which satisfies the clues also satisfies the final step. It does not show thateverything that satisfies the steps in a deduction must satisfies all the clues. In most cases wemerely trust our intuition to make sure we continue the deduction until we reach a final step that issatisfied by those and only those items that satisfy all the clues. For NPW2, we could continue to

    reason that 0 (x+5), so 0 1x. , so x 4. Using this with the last step above give x = 1. Theclue is satisfied by this number.

    Checking a Solution For BAWP0, step (8) merely showed i = src i = lbc. Just as in a deductioninvolving ordinary algebra, this does not show that these two items satisfy all the clues. For thispuzzle a quick check shows that they do. In a more complicated puzzle this may not be as apparent,so when dealing with a world puzzle be sure to check to see if the last step in your deductionactually satisfies all the clues. For BAS puzzles this can be done by using bit string calculations.Bit string calculations could also be used for XAS puzzles but working with 24 bits can be tedious.One alternative is to show that the clues can all be deduced from the final step in your solution. Weillustrate this for the BWP0 whose final steps was src+lbc = 1 and whose clues were b+s = 1, r+l =

    1, d = 0.(0) src+lbc = 1 given(1) d = 0 (0) mult by d(2) c = 1 (1)(3) sr+lb = 1 (0)(2)(4) rl = 0 (3) mult by rl(5) b+s = 1 (4) compl both sides.(6) bs = 0 (3) mult by bs(7) r+l = 1 (6) compl both sides.

  • 7/28/2019 Basic Boolean Concepts

    16/27

    SECTION 4 BOOLEAN INEQUALITIES

    Remark This section use boolean inequalities to solve some attribute puzzles, primarily to illustratehow information from a complex clue, can sometimes be given more compactly by booleaninequality than by a boolean equation. The following solution for BAWP0 illustrates how this isdone for simple clues, although except as an exercise in using boolean inequalities, this type ofdescription is not very useful for puzzles that only involve simple clues. At the end of this sectionwe will apply boolean inequalities to a more complex puzzle. The concepts in this section and the

    next will only be used in the supplementary portions of other units. The Unit which makes themost use of these concepts is VAP.

    Attribute World Puzzles Recall that an attribute world puzzle is one in which the item we want isfrom the set AI, but in which the clues do not uniquely determine the item. The challenge is todetermine the puzzle world, that is to find largest set that contains the items that satisfy all the clues.For these puzzles, is the subset relation, + is union, is intersection, / is complement, aboldface 1 denotes the puzzle. This should be sufficient to allow you to recognize and use lawssuch as those on the cover. If you want to see how to prove inequality laws for any boolean lattice,see Pr1 in ?? Appendix 3.

    x y & y x x = y antisymmetic

    x y & y z x z transitive

    0 x, x 0 x = 0 minimum

    x 1, 1 x x = 1 maximum

    x y xz yz, x y & w z xw yz addition

    x y x+z y+z, x y & w z x+w y+z multiplication

    BAWP0 Each item is blue or small. Each item is red or large. There are no diamonds.

    Solution The clue each item is blue or small is equivalent to a red item must be small.

    Thus we can use r s to represent this clue. Likewise, b l can represent Each item is red orlarge. Line (9) shows that the set we are to determine contains at most src and lbc.

    (1) r s (2) b l (3) d = 0 Clues

    (4) r sr (1) mult by r, idemp

    (5) b lb (2) mult by b, idemp

    (6) 1 sr+lb (4)(5) add, r+b = 1

    (7) c src+lbc (6) mult by c, dist

    (8) c = 1 (3) apply /, /d = c, /0 = 1

    (9) 1 src+lbc (8)(7) replace c by 1

    (10) src+lbc = 1 (9) maximum

    Alternate Representation From the iB iS we might have observed that any large item must beblue. This can be represented by l b. Likewise the clue iR iL can be represented by s r.This gives the same solution as the one above. Merely use l b to obtain l lb, and use s r toobtain s sr. Adding these inequalities, and using s+l = 1, gives 1 sr+lb.

  • 7/28/2019 Basic Boolean Concepts

    17/27

    AWP0a If i is large then i is blue. If i is blue then i is a diamond. If i is small then i is green. If i isgreen then i is a circle.

    Solution Below we contrast using equations an inequalities. Horizontal lines separate clues fromthe reasoning.

    (1) l = lb (2) b = bd (3) s = sg (4) g = (1) l b (2) b d (3) s g (4) g c

    (5) l = lbd (1)(2) (5) l lb (1) mult by l, idem(6) s = sgc (3)(4) (6) lb lbd (2) mult by lb, idem(7) 1 = sgc+lbd (5)(6) (7) l lbd (5)(6) transitive

    (8) s sgc (3)(4) similar to (7)(9) 1 sgc+lbd (7)(8) add, s+l = 1

    AWP0b If i is not red then i is a circle. If i is small then i is red. If i is red then i is a circle. If i islarge the i is red or blue.

    Solutions Again we contrast using equations an inequalities. However we leave the commentary onthe laws involved to the reader.

    (1) r+c = 1 (2) s = sr (1) /r c (2) s r3 r = rc 4 l = l r+b 3 r c 4 l r+b

    (5) s = src (3)(2) (5) 1 c (1)(3)6 l = lr+lb 4 6 s sr 2

    (7) lr = lrc (3) (7) l lr+lb (4)(8) lbr+lbc = lb (1) (8) 1 sr+lr+lb (6)(7)(9) lb = lbc (8) 9 1 src+lrc+lbc 5 8(10) l = lrc+lbc (6)(8)(9)(11) 1 = src+lrc+lbc (5)(9)

    Comment The main advantage in using boolean inequalities is for more complex puzzles, such asthe level 3 puzzles in Unit VAP. Some of these also contain complex clues, such as the one below.

    If i is not a triangle then i is small or yellow. T S Y

    This means that the non-triangles are a subset of the union of the small items with the yellow items.This can be represented by the inequality: /t s+y.

    Sample Complex Puzzle If i is blue or i is large then i is a large circle. If i is not blue then i is not acircle. If i is not both small and a circle then i is either blue orlarge.

    Solution

    (1) b+l lc (2) /b /c (3) /(sc) b+l(4) /(sc) lc (3)(1) transitive law(5) 1 sc+lc (4) add sc(6) c b (2) compl(7) c = bc (6) def of (8) 1 sbc+lbc (7)(5) replace c by bc

  • 7/28/2019 Basic Boolean Concepts

    18/27

    SECTION 5 BOOLEAN ATOMS AND INFORMATION EXTRACTION

    Overview Suppose the total profit of companies X and Y is 27 million and the profit for X was 5million more than Y. Using ordinary algebra we could represent this information by the pair ofequations x+y = 27 and x-y = 5, and extract the information that the profit for X was 16 and Y was11.

    This section illustrates a strategy for extracting information represented by bits strings rather than

    by numbers. We will

    focus on attribute puzzl

    es for BAI invol

    ving onl

    y the small

    items. Whil

    ePuzzle 0 is easy to solve without using boolean concepts, this solution can be described morecompactly by using the concept of boolean atoms and boolean inequalities.

    Puzzle 0 Bob, Carl, Dale, and Roy each have a small item from BAI in their pocket. They all havedifferent items. Nobody has an item with an attribute whose name has the same first letter as hisname. Bob has a circle.

    Solution Since Bob has a circle, but does not have a blue item, Bob has the small red circle. SinceDale doesnt have a diamond, and since Bob has the sma ll red circle, together they have the circles,Thus Dale must have the small blue circle. Since Roy has a blue item and Dale the small blue circle,Roy has the small blue diamond. This leaves the small red diamond for Carl.

    Boolean Description Before presenting a boolean description of this solution, recall that an atom isan element such that the only smaller element is 0, and that for distinct atoms a and b we have ab =0. Since a = ab+/ab this is also equivalent to /ab = a. In this description R is the set containingthe small red items. Similar remarks apply to D,C,B. b is the set containing Bobs item. Use c,d,rin a similar manner for Carl, Dale, Roy. Information in the puzzle can be coded as below, and thesolution described using boolean algebra. For instance (1) codes the fact that Bob doesnt have ablue item. Multiplying (1) and (5) gives b RC, but since b and RC are atoms, b = RC. Note, forstep (7), /bd = d since b and d are different atoms.

    (1) b R (2) c D (3) d C (4) r B (5) b C

    (6) b = RC (1)(5) mult, idemp, atom

    (7) d = BC (6)(3) mult (3) by /b = /(RC)

    (8) r = BD (7)(4) mult (4) by /d = /(BC)

    (9) c = RD (6)(7)(8) add, compl

    BIT4 Solution As indicated earlier, any subset X of {srd,src,sbd,sbc} can be named as bit string oflength 4. Use a 1 in bit 1 if srd is in X, a 1 in bit 2 if src is in X, a 1 in bit 3 if sbd is in X, a 1 in bit4 if sbc is in X. The atoms of BIT4 are 1000,0100,0010,0001. Using this the solution describedabove can also be described using bit string codes. While this is not as easy to read for thisparticular puzzle, it has advantages for complex puzzles with many variables. It is also easy to

    implement bit string solutions using a computer.

    (1) b 1100 (2) c 1010 (3) d 0101 (4) r 0011 (5) b 0101

    (6) b = 0100 (1)(5) mult, idemp, atom

    (7) d = 0001 (6)(3) mult (3) by /b, /bd = d, /01000101 = 0001

    (8) r = 0010 (7)(4) mult (4) by /d, /dr = r, /00010011 = 0010

    (9) c = 1000 (6)(7)(8) add, compl, /(b+d+r) = c, /0111 = 1000

  • 7/28/2019 Basic Boolean Concepts

    19/27

    More Complex Puzzles Unit VLA contains a variety of more elaborate puzzles that can be solvedby using boolean atoms. For one such puzzle see Pr4 in Appendix 3. The following puzzle, whilenot as elaborate, illustrates some of the ideas involved.

    Puzzle 1 Four people have different small items from BAI. They put these items in boxes markedwith the letters p,q,r,s. Cathy and Dick have a circle. Al did not use box s. The mens items are thesame color. A female used box q. Items of the same shape were placed in boxes p and r. If Cathyused box q then she did not have a red circle. Later one of these people took a blue item from theirbox. If Beth has box r then it was not Beth. If Al has box r then it was Al. Which item was taken?Who took it? What box was it in?

    Solution Let a,b,c,d be the distinct atoms denoting the items in the boxes belonging to Al, Beth,Cathy, Dick. Let p,q,r,s be the distinct atoms denoting the items in the boxes with those labels.Let x denote the item taken. Comments are included only for some of the steps. Steps withoutcomments should be fairly easy to follow, although to explain them may involve a certain amount ofdetail. For instance, consider (18). By (17) a+d cannot be 0011, so a+d = 1100 and hence a =1000, and thus by (7) a x.

    (1) c+d = 0101 (4) a+d = 1100 a+d = 0011 (7) x 0011

    (2) as = 0 (5) p+r = 0101 p+r = 1010 (8) b = r bx = 0

    (3) q b+c (6) c = q c 1011 (9) a = r a = x

    (10) aq = 0 (3) mult by a, use ba = 0, ca = 0

    (11) a(p+r) = a (10)(2) mult p+r+q+s = 1 by a

    (12) p+r 0101 (11)(1) a(c+d) = 0, so p+r c+d

    (13) p+r = 1010 = a+b (12)(5)(1) a+b = /(c+d)

    (14) q+s = 0101 = c+d (13)

    (15) q = c (14)(3) mult q b+c by q+s = c+d(16) c = 0001 = q (15)(6)(1) mult c 1011 by c+d = 0101

    (17) d = 0100 = s (16)(14) apply / mult

    (18) a = 1000 x (17)(4)(7)

    (19) a r (18)(9)

    (20) a = 1000 = p (18)(19)(13)

    (21) b = 0010 = r (20)(13)

    (22) bx = 0 (21)(8)

    (23) x = c = 0001 = q (16)(21)(22)

    Details via Boolean Algebra While step (18) is fairly easy to infer if you think about what thesymbols mean, it can also be derived in a purely algebraic manner as indicated below. The detailsare rather tedious. A similar remark applies to some of the other steps.

    (A) a+d = 0011 assume

    (B) d = 0 (17)(A) mult, d(a+d) = da+dd = 0+d = d, 01000011 = 0

  • 7/28/2019 Basic Boolean Concepts

    20/27

    (C) d 0 (17)

    (D) a+d 0011 contradiction

    (E) a+d = 1100 (D)(4)

    (F) a = 1000 (E)(17) mult by /d = 1011, /d(a+d) = /da = a, 10111100 = 1000

    (G) ax = 0 (F)(7) mul

    t, to obtain ax

    10000011 = 0

    (H) a x (G) atom

    While these puzzles can be solved using boolean equations, boolean inequalities provide morepowerful methods. We will use both methods.

    Ex1 For item puzzles the clues determine a single item. The goal is to discover this item. Belowthe ordinary language statement of these puzzles you will find them stated in abbreviated languageusing set names, but with i omitted. You will also find boolean equations representing each ofthe clues. You may want to cover these while you try to formulate your own equations.

    Use boolean algebra to solve some of these puzzles.

    AIP1 i is small or i is a circle. i is large or i is red. i is blue.AIP2 i is small or yellow. i is large or a circle. i is a triangle.

    AIP3 If i is a diamond then i is not large. i is a circle or i is yellow. i is not a triangle. i is not acircle.

    AIP4 i is blue or green. If i is large then i is not blue. If i is green then i is a diamond. i is large.

    AIP5 If i is small then i is red. If i is a circle then i is blue. i is a circle.

    AIP6 i is small or green. i is large or red. if i is red then i is a circle. i is a diamond.

    AIP7 i is small or a circle. i is large or red. i is green.

    AIP8 i is a blue circle. If i is large then i is not blue.AIP9 If i is not a circle then i is red. i is neither red nor small. If i is not green then i is red.

    AIP10 i is small and blue. If i is blue then i is a circle.

    If i is blue orlarge then i is a circle.

    AIP11 i is blue or red. i is neither small nor blue. If i is small or red then i is a circle.

    ] IDEOGRAPHIC VERSIONS ]REPRESENTING EQUATIONS ]

    ] S C L R B ] s+c = 1 l+r = 1 b = 1 ]

    ] S Y L C T ] s+y = 1 l+c = 1 t = 1 ]

    ] D L C Y T C ] dl = 0 c+y = 1 t = 0 c = 0 ]

    ] B G L B G D L ] b+g = 1 lb = 0 g = gd l = 1 ]

    ] S R C B C ] s = sr c = cb c = 1 ]

    ] S G L R R C D ] s+g = 1 l+r = 1 r = rc d = 1 ]

    ] S C L R G ] s+c = 1 l+r = 1 g = 1 ]

  • 7/28/2019 Basic Boolean Concepts

    21/27

    ] B&C L B ] bc = 1 lb = 0 ]

    ] C R (S R) G R ] r+c = 1 s+r = 0 g+r = 1 ]

    ] S&B B C B L C ] sb = 1 b = bc (b+l)/c = 0 ]

    ] B R (S B) S R C ] b+r = 1 s+b = 0 (s+r)/c = 0 ]

    Ex 2 The goal for these puzzles is to find the largest subset of AI whose members satisfy a ll thepuzzles clues. For example consider the puzzle whose clues are L R, S R, R D. The 2 reddiamonds are the only items of AI that satisfy all the clues, so the answer to this puzzle would be{lrd,srd}. Use boolean algebra to solve some of these puzzles. For at least 2 puzzles show that yoursolition has no extraneous items.

    AWP1 i is green. If i is not a diamond then i is not green.

    AWP2 If i is large then i is red or yellow. If i is red then i is a diamond. If i is yellow then i is not

    a diamond. If not a circl

    e then i is a diamond. i is not small

    .AWP3 If i is not a triangle then i is small or yellow. i is not yellow.

    If i is a triangle then i is red. If i is small then i is a triangle.

    AWP4 If i is a blue diamond then i is large. If i is blue and i is not a diamond then i is large. i isnot large.

    AWP5 Either i is not red or i is not a diamond. If i is large and blue then i is a triangle. If i is notboth large and blue then i is red. If i is not a diamond then i is large and blue.

    AWP6 If i is a red circle then i is large. If i is red and small then i is a circle. i is not large.

    AWP7 i is red or i is yellow. If i is not b1ue then i is not a small circle.

    If i is not small then i is not yellow. If i is red then i is small

    AWP8 i is red or yellow. If i is not red then i is a small diamond. If i is not yellow then i is notsmall and not a diamond. If i is not a circle then i must be small.

    AWP9 If i is small then i is yellow. If i is not a diamond then i is not blue. If i is a diamond then iis red. If i is not small then i is blue.

    Problems and projects are supplementary. They either extend ideas from the text or use these ideasin a more challenging way.

    Pr1 The relation is defined for boolean lattices as: x y iff xy = x. Use this to prove some ofthe laws for boolean inequalities listed below. For example, the reflexive law x x follows from thisdefinition and the idempotent law, and to prove x y xz yz, we can assume x y and deducexz yz as follows.

    (1) x y

    (2) xy = y (1) def of

    (3) zz = z idemp

    (4) xyzz = yz (2)(3)

    (5) (xz)(yz) = yz assoc comm

  • 7/28/2019 Basic Boolean Concepts

    22/27

    (6) xz yz (5) def of

    Pr2 The concept of an atom can be defined as follows:

    x is atom iff x 0 and there is no y such that y 0 & y x & y x

    Prove that x is an atom

    x

    0 and for all

    y, xy = 0

    xy = x.Prove that for any atoms a and b, a b ab = 0.

    Pr3 In this problem Q+ denotes boolean lattice addition and + denotes boolean ring addition. Showthat xQ+y = x+y+xy. Thus boolean lattice addition can also be used to solve attribute puzzles if weuse a ring equation of the form x+y+xy = 1 for a c lue of the form X Y. This is illustrated forBAIP0. Solve some other attribute puzzles using boolean ring addition.

    (1) l = 1 (2) b = 1 (3) s+d+sd = 1

    (4) s = 0 (1)

    (5) d = 1 (4)(3)

    (6) lbd = 1 (1)(2)(5)

    Pr4 Will,Bob,Pete,Hal,Nash are weak,brave,polite,heavy,nice and they live inWaldon,Bliss,Pike,Hadley,Newark. No man lives in the city or has an attribute with the same initia las his name, nor does his attribute have the same initial as the name of his city. The weak one doesnot live in Newark. The brave one does not live in Pike. Bob is not heavy or polite. Harper is notbrave. Will is not a resident of Bliss, nor is Nash, who is not brave and not heavy. Neither Pete norWilllive in Newark. In which city does Nash live?

    Hint: Let 10000,01000,00100,00010,00001 represent White, Brown, Peters, Harper, Nash. Letw,b,p,h,n be atoms naming the men whose occupations begin with these letters. Let W,B,P,H,N beatoms naming the men who live in the cities which begin with these letters. Note thatwW,Bb,pP,hH,nN are all 0. Other information can be coded by the boolean equations andinequalities below.

    (1) w 01111 (2) b 10100 (3) p 10011 (4) h 10100

    (5) n 11110 (6) W 01111 (7) B 00110 (8) P 11011

    (9) H 11101 (10) N 01010 (11) wN = 0 (12) bP = 0

    Pr5 Bit operations can be illustrate on pathway systems, that is a system of paths thru whichsomething can move and points within these paths where movement can be either a llowed orblocked. A pathway system might involve information flow thru an organization, electricity thrucircuits, water thru pipes, etc. To illustrate pathways, consider an application which although lesspowerful, is easy to visualize, namely a rat maze with passages and doors. Picture 1 show thepossibilities for a passage system x with 2 sliding doors a and b in sequence. Picture 1a shows bothdoors closed, so x is closed. Picture 1b shows a closed and b open, so x is closed. Picture 1c shows

  • 7/28/2019 Basic Boolean Concepts

    23/27

    a open and b closed, so x is closed. Picture 1d shows both doors open, so x is open. We codeclosed by 0 and open by 1. Whether the passage is open or closed can be coded by the product of aand b, with these 4 possibilities corresponding respectively to 00 = 0, 01 = 0, 10 = 0, 11 = 1.Likewise Picture 2 represent a passage system with 2 doors in para llel. Whether the passage is openor closed corresponds to the lattice sum of a and b, with these 2 pictures corresponding respective lyto 0+0 = 0, 0+1 = 0, 1+0 = 1, 1+1 = 1.

    a = 0 b = 0 a = 0 b = 1 a = 1 b = 0 a = 1 b = 1

    Picture 1a Picture 1b Picture 1c Picture 1d

    a = 0 a = 0 a = 1 a = 1

    b = 0 b = 1 b = 0 b = 1

    Picture 2a Picture 2b Picture 2c Picture 2d

    Doors in a passage system may be independent or re lated. A pair of doors is directly related wheneither they must both be open or both be closed. Doors are complementary when the second door isopen if the first door is closed, and the second door is closed if the first door is open. Pictures 3 and4 illustrate the idempotent and complement laws forlattice multiplication.

    a = 0 a = 0 a = 1 a = 1 a = 0 /a = 1 a = 1 /a = 0

    Picture 3a Picture 3b Picture 4a Picture 4b

    The first 2 pathway picture below illustrate the idempotent and complement laws for + with an inputof 0. Draw pictures illustrating these laws for an input of 1. Relate the last 2 pictures illustratesboth parts of the distributive laws. Give more pathway pictures illustrating these laws for otherinputs.

    Idempotent Complement Distributive Distributivea = 0 a = 0 a a a

    a = 0 /a = 1 b c b c

  • 7/28/2019 Basic Boolean Concepts

    24/27

    Project A questionnaire having 8 items was given to 9 persons. Each item describes some socialpolicy, and a response indicates whether a person favors or opposes this policy, with a 1 for favorsand a 0 for opposes. Thus each element of BIT8 name a possible subset of question numbersanswered yes.

    The responses are given as follows:

    ITEM NUMBER

    ] 1 2 3 4 5 6 7 8

    1 ] 1 1 0 1 1 0 1 1

    P 2 ] 1 1 1 0 1 1 1 0

    E 3 ] 0 0 0 1 1 1 1 1

    R 4 ] 0 1 1 0 1 0 0 0

    S 5 ] 0 0 1 1 1 1 0 0O 6 ] 0 1 0 1 1 0 0 0

    N 7 ] 1 1 0 1 1 0 1 0

    8 ] 0 0 1 0 1 0 0 0

    9 ] 0 1 1 1 1 1 1 1

    The fact that the bit string product of all responses is 00001000, indicates that item 5 was favoredby all. Likewise the lattice sum of all responses is 11111111, so no item was opposed by a ll. Thepeople who said yes to item 1 also all said yes to items 2,5,7. To see this, take the product of allthose having a 1 in the first byte. 110110111110111011011010 = 11001010. Boolean arithmeticcould be used to extract further information of this type. Since the number of responses is small, aquick visual scan, would also reveal the such information. The advantage of using booleanarithmetic is that it can be easily implemented on a computer when there are a large number ofrespondents.

    Develop computer programs and procedures to do bit string arithmetic. Apply these to something.The discussion below illustrates some ideas for doing this in logo.

    We can code a bit string as a logo word of bits. We can then code the responses as a list of these asindicated below.

    MAKE L [11011011 .... 01111111]The procedure P below defines the boolean product function P for any pair of strings in BIT8. EPis the extended boolean product function EP of any list of such bit strings. To determine whichitems were favored by everyone, merely give the command PR EP :L.

    TO P :X :Y

    IF EMPTYP :Y [OP :X]

    OP WORD P BL :X BL :Y PRODUCT LAST :X LAST :Y

    END

  • 7/28/2019 Basic Boolean Concepts

    25/27

    TO EP :L

    IF EMPTYP :L [OP 11111111]

    OP P FIRST :L EP BF :L

    END

  • 7/28/2019 Basic Boolean Concepts

    26/27

    APPENDIX 1 MATHEMATICS AND WESTERN CULTURE

    As a prelude to sketching a broader perspective on boo lean algebra, we make a claim about therelationship between mathematics and western culture.

    AS GOES MATHEMATICS SO GOES WESTERN CULTURE

    (and mathematics goes where it chooses)

    Does this seeml

    ike an extravagant cl

    aim? Cl

    earl

    y mathematics has some significance, but is it notabsurd to claim that as goes mathematics, so goes the western culture? Isnt useful mathematicsmostly a collection of tools for solving a variety of practical problems or working with certain veryspecialized application in science?

    Although we do not believe the above claim in a literal fashion, it is truer in spirit than commonperspectives on the significance of mathematics. In order to appreciate this claim involves a muchbroader perspective. We suggest reading Morris Kline Mathematics in Western Culture. We alsosuggest that the development of boolean algebra supports the spirit in which we make this claim. weclaim that the development of mathematics is influenced more by the internal challenges it offers,than by practical or scientific situations which suggest mathematical problems. We claim that withno intention on the part of mathematicians, this had tremendous cultural and practical significance.

    Many problems we can solve, our choice of which problems to approach, and the ways we phraseour questions is largely dependent on the mathematics available. Furthermore, as our mathematicsshapes technology and science, it also shapes both our way ofliving and our way of thinking. Inother words, let us briefly explore the idea of The Practicality of Impractical Math.

    For most mathematicians the motivation for doing mathematics is the challenge of solving problemsand developing concepts. This does not mean that they are not interested in the fact thatmathematics has applications. In certain cases, mathematicians have studied and developed someof the details of these applications. However, they have usually been more interested in conceptsand problems arising from within mathematics itself. Furthermore significant uses of mathematicsare more likely to follow new development in pure mathematics than to suggest them.

    Like many other mathematicians, we have thoughts on how mathematics relates to other areas ofhuman endeavor, on the general significance of mathematics, its cultural impact, its influence inshaping our ideas, etc. Of course, to see this we had to examine some applications in detail. Wewould like to study even more of these, since in addition to helping us shape our overview, they areoften interesting in their own right. Given the usual human limitations, we have only studied a fewof the applications of mathematics that we would like to explore. Of these but boolean algebra isthe best paradigm case we have found illustrating the practicality of impractical math. It wasinvented in the late 1800s in order to describe two main topics in the foundations of mathematics,namely the algebra of propositionallogic and the algebra of sets. At that time it would have beenhard to imagine areas of mathematics further removed from techno logical applications than logicand sets, these topics being studied primarily by those interested in the logical organization of

    mathematics. Yet 70 years after its invention, boolean algebra found important applications inmodern electronics design. In particular, it is important in the design of computer circuits. Thusboolean algebra has at least indirectly affected our individuallives and even the shape of our who lesociety.

  • 7/28/2019 Basic Boolean Concepts

    27/27

    APPENDIX 2 OUTLINE OF BOOLEAN UNITS

    Tree Diagram The tree diagram below show the relationship between the units on boolean algebra.The names and descriptions of these units are given be low the tree. To explore these unit start atthe bottom with this present unit BBC. You can move up the tree in any direction. Units on the leftare oriented towards technological applications involving digital control systems. The middle 2units involve recreational applications. The first unit on the right is primarily theoretical, but theunit above it involves both a recreational and a technological application. Most units are broken

    into 2 parts, with the second part containing related topics that are optional.

    DCD SBE BGA

    RBF SAP VLP BLT

    BBC

    BBC Basic Boolean Concepts: BBC1 introduces the concept of a boolean lattice, and relatedconcepts of boolean equations. BBC2 discusses atoms and boolean inequalities, which are onlyused in a few places in later units.

    BLT Boolean Lattice Theorems: Organizes boolean lattices laws as an axiomatic system. Relatesboolean concepts to the broader concepts of contemporary algebra.

    SAP Solving Attribute Puzzles: Uses boolean algebra to solve more challenging attribute puzzles.XAP2 depends on BBC2.

    VLP Various Logic Puzzles: Uses boolean equations to solve a variety oflogic puzzles. VLP2depends on BBC2.

    BGA Boolean Group Applications: Sketches the application of boolean groups to error correctingcodes and playing Nim.

    RBF Representing BIT Functions: Uses the concept of boolean atoms to show how any BITfunction can be represented as a atomic lattice polynomial. Also shows how to find reducedrepresentations.

    DCD Digital Control Devices: Illustrates the use of bit functions in the construction of digitaldevices, with emphasis on circuits for computers. This application is introduced on the next page.

    SBE Solving BIT Equations: Uses boolean polynomial representations to solve bit equations, withapplications to feedback circuits.