medium boolean algebra

36
BOOLEAN ALGEBRA The plan of the work in this section is first to investigate certain topics (Algebra of Sets, Circuitry, Statement Calculus) and draw essential laws from their behaviour. The resulting isomorphism is then expressed as a general Boolean Algebra, after which the Algebra and some of the topics are developed further. 1. THE ALGEBRA OF SETS The basic definitions of Set Algebra are given in the booklet Sets, Mappings, Relations tind Operations. However, the treatment of complex problems necessi- tates the systematisation of procedures. This systematisation is analogous to the basic rules of the algebra of real numbers. It is impossible to prove fundamental rules (or axioms) such as these, but we are able to demonstrate their truth. Venn diagrams If A, Band C are sets within a universe & the Venn diagram is divided into a maximum of eight non-overlapping areas. Exercise 1a 1. Draw an appropriate Venn diagram and label each non-overlapping area by an algebraic combination of A, Band C. 2. Draw a Venn diagram to identify the following regions for two intersecting sets A and B: I A n B' A n B A' n B A' n Ii' ~. 3. Shade the area on a Venn diagram which represents A U (B n C). On a similar diagram shade the two areas A U B and A U C. What do you notice about the area representing (A U B) n (A U C)? 4. By Venn diagrams confirm (i) A n (B U C) = (A n B) U (A n C) (ii) (A n B) n (B n C) = A n B n C (iii) (A n B n C)' = A' U B' u C' (iv) A U (B n C') = [A' n (B' U C)]' Set Algebra Venn diagrams however only illustrate the truth of a relation. The truth of these relations are proved as follows: In example 3 above - If x E A U (B n C) then either x E A or x E (B n C) or x E both A and (B n C) Natior sr M r ntre II N22272

Upload: anup-saravan

Post on 05-Dec-2015

227 views

Category:

Documents


1 download

DESCRIPTION

Medium Boolean algebra

TRANSCRIPT

Page 1: Medium Boolean Algebra

BOOLEAN ALGEBRAThe plan of the work in this section is first to investigate certain topics

(Algebra of Sets, Circuitry, Statement Calculus) and draw essential laws from theirbehaviour. The resulting isomorphism is then expressed as a general BooleanAlgebra, after which the Algebra and some of the topics are developed further.

1. THE ALGEBRA OF SETSThe basic definitions of Set Algebra are given in the booklet Sets, Mappings,

Relations tind Operations. However, the treatment of complex problems necessi-tates the systematisation of procedures. This systematisation is analogous to thebasic rules of the algebra of real numbers. It is impossible to prove fundamentalrules (or axioms) such as these, but we are able to demonstrate their truth.

Venn diagramsIf A, Band C are sets within a universe & the Venn diagram is divided into

a maximum of eight non-overlapping areas.Exercise 1a1. Draw an appropriate Venn diagram and label each non-overlapping area by analgebraic combination of A, Band C.2. Draw a Venn diagram to identify the following regions for two intersecting setsA and B:

I A n B' A n B A' n B A' n Ii'~.

3. Shade the area on a Venn diagram which represents A U (B n C).On a similar diagram shade the two areas A U B and A U C. What do you

notice about the area representing (A U B) n (A U C)?4. By Venn diagrams confirm

(i) A n (B U C) = (A n B) U (A n C)(ii) (A n B) n (B n C) = A n B n C

(iii) (A n B n C)' = A' U B' u C'(iv) A U (B n C') = [A' n (B' U C)]'

Set AlgebraVenn diagrams however only illustrate the truth of a relation. The truth of

these relations are proved as follows:In example 3 above -If x E A U (B n C) theneither x E A or x E (B n C)

or x E both A and (B n C)

Natior srMrntre IIN22272

Page 2: Medium Boolean Algebra

IfxEATllen x E AU BandxEA U C

=> x E (A U B) n (A U C)IfxE (B n C)

=> x E B and x E C=> x E A U B and x E A U C=> x E (A U B) n (A U C)~ A U (B n C) C (A U B) n (A U C) (1)

If x E (A U B) n (A U C)=> x E A U B and x E A U C=> (x E A or x E B) a~d (x E A or x E C)=> x E A or (x E B and x E C)=> x E A or x E B n C=> x E A U (B n C)=> (A UB) n (A U C) C A U (B n C) (2)

Hence from (1) & (2)A U (B n C) = (A U B) n (A U C) (P)

Further examples of this type of proof are given in the booklet Sets, Mappings,Relations and Operations.Exercise lb

In a similar manner to the above prove the following identities:-1. A n (B U C) = (A n B) U (A n C)2. (A nB) (1 (B nC) = A n B nC3. An(A'UB)=AnB4. What do you notice about the result (P) proved above and th.e result in

Question I?This relationship will be discussed later.Essential Identities

We may now list certain essential identities relating to set algebra. (Establish theidentities 1 and 2 by the foregoing method.)

1. A U (B U C) = (A U B) U C2. A n (B n C) = (A n B) n C3. AU B=B U A4. AnB=BnA5. A U (B n C) = (A U B) n (A U C)6. A n (B U C) = (A n B) U (A n C)7 . An element (jJ exists such that

AU~=A8. An element & exists such that

An&=A9. AUA'=&

10. AnA'=<jJ

2

Page 3: Medium Boolean Algebra

Identities 1 to 6 have similarities to certain laws for the algebra of realnumbers and are given particular names, e.g. 1 and 2 are the associative laws forunion and intersection, 3 and 4 the commutative laws and 5 and 6 the distributivelaws.

One interesting property may be observed in the way that a relationshipexists between pairs of these identities. Thus replacing U by n in (1) we obtain (2).This property is known as duality and the same property may be seen in (3) and (4)and in (5) and (6). In addition if we regard ¢ as the dual of & it can be seen that (7)and (8) are duals, and also (9) and (10).

DE MORGAN'S LAW1. (An B)' =A'UB1

2. (AUB)' =A' nB'Proof of 1. This identity can be illustrated in a Venn diagram as follows. A com-plete proof is given below the figure.

(A n B)' P/. U B'Figure 1.1

XE(AnB)'<:? xEAnB<:> X E A and B<:> X E A or x E B-¢> xEAlorxEBI

-¢> xEA/UBI

Hence (A n B)I = AI U B'

X IIIB' III

Use a similar method to prove the other identity.

3

Page 4: Medium Boolean Algebra

2. SWITCHING CIRCUITS(Revision of work in MME Book III.)

You will recall that 1 indicates that a switch is closed and the current canflow; 0 means the switch is open. Truth tables may be drawn up by examiningcircuit diagrams and deciding when current flows and when it does not.

The truth table for the circuitA B

isA B Circuit

0 0 00 1 0I 0 01 1 1

It can be seen that this conforms to the product rule in numerical algebra, i.e. A.B,and we denote switches in series by A.B.

Similarly we denote switches in parallel circuit by A+B

--A--

A+Bo111

--B--

Bo1o1

A

oo11

Note that the results are the same as in numerical algebra except for the last result,which sho'ws that in circuitry 1+1=1.

These rules enable us to work out truth tables without reference to thecorresponding circuit diagrams.EXAMPLE By truth tables confirm that A.(B+C)=A.B+A.C

ABC A.(B+C) A.B+A.C.00000001000100001100100001 0 1 1 11 1 0 1 11 1 1 1 1

Remember that AI means that the switch is off when A is on, and vice versa.

4

Page 5: Medium Boolean Algebra

Exercise 2aUsing the following circuits and drawing up truth tables obtain simplified

circuits and record your results.

1.

2.

3.

4.

5.

6.

AI

A >AI

A

>B

A

>B

Use truth tables to show that7. A.(A+B)=A8. B/.A+B=A+B9. (A+B).(A/+B)=A.B+A/.B'10. Show that the following circuits are equivalent

(a)

A

B c

(b)

A

B-

A

c5

Page 6: Medium Boolean Algebra

11. Verify that the following pairs of circuits are equivalent

(i)

A.

B

(b)

(a)

(b)

AI

BI

(a)

A

(ii)

The words "ON" and "OFF" refer to a lamp in the circuit. These circuitsdemonstrate the truth of the two identities known as DE MORGAN'S LAWS.

Essential IdentitiesWe may now list the following identities which are true for switching circuits:

1. A+(B+C)=(A +B)+C2. A. (B. C) = (A. B). C3. A + B = B + A4. A. B = B. A5. A + B. C = (A + B) . (A + C)6. A. (B + C) = A. B + A. C7. A+O=A8. A. 1 = A9. A + A/= 1

10. A.A/=O

6

Page 7: Medium Boolean Algebra

The following useful results can be obtained from the above 10 identities or theymay be shown from truth tables. Some of these identities were shown inExercise 2a.

A+A=A A.A=AA. (A + B) = A + A. B = A

A. (A' + B) = A.BA + A'.B= A + B(A+B)'=A'.B' I

(A. B)I = AI + BI De Morgan's Laws

Exercise 2bSimplify the following

1. A. (A + B)3. (A + B).(AI + B)5. AI + AI.B

2. A.B'.(A + B)4. (A.BI + B.C).(A.CI + B/.C)6. A.B + B.e + B.C'

3. STATEMENT CALCULUSNotation: (i) A statement is a verbal or written assertion.

(il) A statement can be tme or false.(iii) A simple statement consists of one sentence but two or more may

be combined to form a compound statement ..Let p stand for the statement "The weather is nice" and let q stand for the

statement "It is sunny".We can combine these simple statements into compound statements with the

use of connective symbols to correspond with the use of the connective word."The weather is nice and it is sunny" can be written as:-

p /\ q, where the symbol/\ is used for the word and"The weather is nice or it is sunny" can be written as:-

p V q, where the symbol V is used for the word or"The weather is not nice" can be written as ~ p.

Use of truth tablesBy definition a statement can be true or false. With a compound statement it

it necessary to examine the truth or falsity by means of a truth table.

p q pl\q

T TIf P and q are both

T true then p /\ q must beT F F true otherwise p /\ qF T F must be false.F F F

7

Page 8: Medium Boolean Algebra

If we examine the statements:-"I will walk to school""I will cycle to school"

then the compound statement"I will walk or cycle to school" implies the idea either, or, but not both

i.e. or means or else.But if we take the statements

"He is brilliant" "He works hard"then the compound statement

"He is brilliant or he works hard" can mean both ideas - or means and/orThe former meaning is symbolised by p 'JL q and is called the exclusive

disjunction and the latter p V q is called the inclusive disjunction. Their respectivetruth tables are:

p q P'JLq P q pvq

T T F T T TT F T T F TF T T F T TF F F F F F

The truth table for "'P is

P "'P

T FF T

EXAMPLEDraw up a truth table to show that

p 1\ (q V r) = (p 1\ q) V (p /\ r)

p q r qvr PI\(qVr) pl\q PI\T (p /\ q) V (p 1\ r)

T T T T T T T TT T F T T T F TT F T T T F T TT F F F F F F FF T T T F F F FF T F T F F F FF F T T F F F FF F F F F F F FSince column 5 is the same as column 8

p 1\ (q V r) = (p /\ q) V (p 1\ r).

8

Page 9: Medium Boolean Algebra

EXAMPLEIf p = He buys apples

q = He buys biscuitsr = He buys cakes

P /\ (q V r) = He buys apples and he buys biscuits or cakes(p /\ q) V (p /\ r) = He buys apples and biscuits or he buys apples and cakes ..These two statements are identical and illustrate the identity proved in the aboveexample.

Exercise 3aDraw up truth tables and list conclusions in the following cases.

1. P /\ P 2. P V P3. P /\ ~p 4. PV~p5. P V (p /\ q) 6. p V ("'p-q)7. p /\ (",p V q)8. Use truth tables to show

(a) -(p V q)= ",p /\ "'q(b) -(p /\ q)= "'p V ",qDo these indentities recall anything you have done previously?

9. If F means always false and T means always true simplify the following.

(a) F V A (b) T /\ A(c) Ff\A (d) TVA.

10. Use trutl1 tables to confirm:(a) p /\ (p V q) = P(b) (p V q) /\ (pI V q) = (p /\ q) V (pI /\ q)

EXAMPLEWhat would be the result of observing all the following set of instructions?

"When you are not on the left sound your horn. If you keep to the left and soundyour horn do not stop. If you are stationary, or you are on the right, do not soundthe horn".

These statements will be represented symbolically and using some of theresults obtained in Exercise Ie they will be simplified

Represent the statement (i) you keep to the left by 1,(li) you should sound your horn by h,(iii) you should stop by s.

Then the three instructions will be~l = h A.

1 /\ h = "'S B.s V "'1 = "'h C.

From A & B 1/\ "'1 = ~sF = "'s (Example 3)

~ s= T

9

Page 10: Medium Boolean Algebra

In C TV'" I = "'hT = "'h (Example 9 (d) )

=>h= FIn A '" I = F

=? I = T=> I = T, h = F and s = T .

i.e. if you obey all the instructions you will be stationary on the left and you willnot sound your horn.

This example illustrates the way logic problems can be tackled in an algebraicway. We will look at more problems of this type later.

Essential IdentitiesWe now list certain identities which are true for statements. Many of them

appeared in the last exercise. The rest can easily be shown to be true using truthtables.

1. p V (q V r) = (p V q) V r2. P 1\ (q 1\ r) = (p 1\ q) 1\ r3. pvq =qvp4. P 1\ q = q 1\ P5 · P V (q 1\ r) = (p V q) /\ (p V r)6. p 1\ (q V r) = (p 1\ q) V (p /\ r)7 .. PVF =p8. P 1\ T = P9. P V ",p = T

10. P 1\ ~P = FThe following useful results can be obtained from the above

P'I\P =p PVp=p-(p V q) = ",p /\ ~ t '-(p 1\ q) = ",p V ~ 5 De Morgan sLaw.

4. BOOLEAN ALGEBRAIn the previous three sections certain fundamental laws have been established.

Examine the lists of identities at the end of section 1, 2 and 3, and compare them.List laws in each section which correspond in form. As an example notice

how De Morgan's laws appear in each section.Sets (A U B)I = AI n BI

(A n B)' = AI U BI

Circuits (A + B)' = AI BI

(A . B)I = AI + B'Statements -{p V q) = "'p /\ ""q

-{p 1\ q) = ",p V ""l

10

Page 11: Medium Boolean Algebra

NegationConstants

How do the associative, distributive and commutative laws appear? Are thereidentity or zero elements? Do they behave in a similar way?

Comparison of the laws shows that although the symbols are different, theybehave in the same way or they have the same structure. This suggests anisomorphism, the corresponding notation being as follows:-

Sets Circuits StatementsConnectives U + V

n Juxtaposition /\I I

~ 0 F& 1 T

This mathematical structure which combines these elements according to aset of laws is called a Boolean Algebra. (Named after George Boole (1815-1864)an Irish Mathematician who fITst formulated this algebra.) We shall now formulateour Boolean Algebra and then apply it to certain situations.

AxiomsBoolean algebra is an example of a structure based on fundamental axioms.

The truth of these axioms we define and accept. Previous work would suggest thefollowing definition:

A Boolean algebra is an ordered triple (8, ®, 0) where S is a set and ® and 0

are binary operations and the following axioms are satisfied.I. (a) A @ (B e C) = (A @ B) ® C (b) A 0 (B 0 C) = (A 0 B) 0 C

(Associativity)2. (a) A B B = B ® A (b) A 0 B = BoA

(Commutativity)3. (a) A ® (B 0 C) = (A®B) 0 (A®C) (b) A 0 (B®C) = (A 0 B) ® (A 0 C)

(Distributivity)4. There exist elements 0, 1 E S, such that for all A E S

(a) A ® 0 = A (b) A 0 1 = A(Zero and Identity)

5. For each A E S there exists an element AI E S such that(a) A (f) AI = I (b) A 0 A I = 0

(Complements)This is not the only axiomatic system on which a Boolean Algebra may be

built. A smaller set of axioms may be used, for instance, at the cost of frailty instructural development.

DualityOnce again the duality of these statements should be noted; I(a) and I(b) are

dual, 2(a) and 2(b) and so forth. One statement o'f each dual may be obtained from

11

Page 12: Medium Boolean Algebra

the other by an interchange throughout ofo for 0o for ®1 for 0o for 1

Theorems It is possible to prove a number of theorems based on the axioms above.I. For every A in a Boolean algebra S, A ® A = A and A 0 A = APROOF A = A ® 0 (4a)

= A0(AoA') (5b)= (A B A) 0 (A 0 A') (3a)= (A ® A) 0 1 (Sa)= A0A (4b)

2. For every A in a Boolean algebra S, (A)' = A.PROOF AG>A'=landAoA'=O (Sa, b)which is the necessary condition that (A ')' = A.3. For every A in a Boolean algebra S, A ® 1 = 1 and A 0 0 = aPROOF 1 = A0A'

= AG(A' 01)= (A®A)o(A01)= lo(A®l)= A01

(The appropriate references have been omitted from the above proof. The secondproof is left as an exercise.)4. In any Boolean algebra 01 = 1 and l'= 0PROOF This follows from the results in Theorem 3 aiJove.Exercise 4a

Using the Boolean algebra axioms, prove the following:I. A 0 (A' e B) = A 0 B2. A G>(AI 0 B) = A @ B3. A @ (A 0 B) = A 0 (A G B) = A4. A ~ (B 0 C) = (A @ B) 0 (A (±) C)We have seen three examples of structures which form a Boolean algebra. Arethere any more? We will consider a set with two binary operations and examine theaxioms to see if it forms a Boolean algebra.EXAMPLE Consider N the set of divisors of 6. The operations Hand L are definedas follows:

x H y = highest common factor of x and yx L y = lowest common multiple of x and y.

Does the ordered triple (N,H,L) form a Boolean algebra.[N.B. 8 H 12 = 4, 8L 12 = 24.]N = {1,2,3,6}

12

Page 13: Medium Boolean Algebra

AL(BHC) = (ALB)H(ALC)3L(2H6) (3L2)H(3L6)

= 3L2 = 6 H 6= 6 = 6

The table of operations areH 1 2 3 6 L 1 2 3 6

1 1 1 1 1 1 1 2 3 62 1 2 1 2 2 2 2 6 63 1 1 3 3 3 3 6 3 66 1 2 3 6 6 6 6 6 6

Table 1 Table 2Note: AH6=A ALl=Ai.e. there exist 'zero' & 'identity' elements.Hence axiom 4 is satisfied.

IH6=1 lL6=62H3=1 2L3=63H2=1 3L2=66 H 1 = 1 6 L 1 = 6A H N. = 1 A L AI= 6

i.e. each member of N has a 'complement' in NHence axiom 5 is satisfied.

Are the other three axioms satisfied?Axiom 1, the associative law, is satisfied since the highest common factor and thelowest common multiple of tluee numbers are unaffected by the order in which thenumbers are combined.Axiom 2, the commutative law is obviously satisfied.Axiom 3, the distributive law.(a) (b)

A H (BLC) = (AHB)L(AHC)e.g. 3H(2L6) (3H2)L(3H6)

= 3H6 = 1 L 3= 3 = 3

It can be shown that this is true for all values of A,B,C E N.

Hence since the ordered triple (N ,H,L) obeys the ten axioms, then this tripleforms a Boolean algebra.Note the duality between tables 1 and 2

When the following changes are made to table 1.LforH6 for 13 for 22 for 31 for 6,

13

Page 14: Medium Boolean Algebra

table 1 becomes.

L 6 3 2 1

6 6 6 6 63 6 3 6 32 6 6 2 21 6 3 2 1

Rearrangement of this table gives table 2.Consequently had we noticed this duality we needed only to check half of theaxioms (either the (a)'s or the (b )'s) to show that this was a Boolean algebra.Exercise 4b

In each of the following questions a system is defined on a set by twooperations. Determine which of the Boolean algebra axioms are satisfied. Which ofthe systems form a Boolean algebra?1. N is the set of divisors of (i) 4, (ii) 10, (iii) 30 and the operations Hand L are asdefined in the example above.2. The set of real numbers under ordinary addition and subtraction.3. The set of integers mod 5 under addition and subtraction mod 5.4. The set {I ,2,3,4,5 }under the operation 'max' and 'min' where a max b is which-ever is the larger of a or b, where a, b E { 1,2,3,4,5 } and a min b means whichever isthe smaller of the two:5. The set N of natural numbers under ordinary addition and the operation "',where a",b denotes the numerical difference between a and b.

6. The set {1,2,3,4,5,6,IO,12,15,20,30,GO} where a 0 b is the highest commonfactor of a and b and a ® b is the lower common multiple of a and b. The inverse ofa is GO/a.

Repeat with the sets {1,2,3,4,6,12} and {1,2,3,5,6,10,15,30}-

7. The set of integers under the operations defined in question 6, the inverse of xbeing -x.8~ The set of points in the Cartesian plane. One operation on two points takes thepoint farthest from the origin. The other takes the point nearest the origin. Takethe inverse of a point as its image in the origin.9. Consider question 8 when the set is points in tluee dimensional space.

The examples which follow may be solved by any suitable application ofBoolean algebra (i.e. by sets, by circuits, by the use of logic and truth tables, or byan application of the basic laws) except where a specific method is indicated.

Exercise 4c1. Reduce the following expressions to the simplest form:-

(a) x. y. (Zl + yl + x)(b) Xl. y'. z + x. y. z, + x. y'. z()' '+' , ,c x.y.z x.y.z+x.y.z+x.y.z+x.y.z.

14

Page 15: Medium Boolean Algebra

2. An algebra contains only two elements 0, and 1 and it is known that dualityapplies. From the given table complete the other. The operations are denoted byU and n

uo1

oo1

1

11

no1

o 1

3. De Morgan's laws enable us to dispense with either n or u.Express (i) A U B U C without using U

(ti) A U (B nC) U (B nCl nD) without n4. Express (a) without the + sign

(b) without the . sign(i) A + B. C.(li) (A + B) . (BI + C) . (C + A~

(iii) (X + X . Y + Xl . Z)I

5. SENTENCE CALCULUSAs shown earlier statements can be expressed in one of the isomorphic forms

of our Boolean algebra. The axioms and theorems apply to our statements enablingus to simplify these and to solve unknowns in our equations. The formation ofequations is achieved by listing all possibilities, connecting them by one of theconnectives and equating to T (if the propositions have to be true) or F (if thepropositions are all false).

EXAMPLE 1 Form an equation to represent the following statement "If mybicycle is in order I use it to go to school, but wisely, if it is out of order, I walk."

Let b represent "I ride to school on my bicycle~'and let w represent "I walk to school"

There are two possibilitiesEither I ride my bicycle and I don't walk [represented by b 1\-w]or I don't ride my bicycle and I do walk [represented by b /\ w]Hence the possibilities can be represented by

(b /\ -w) V ( b /\ w)Either one or the other (but not both) represent the truthHence (b /\ -w) V ( b 1\w) = T

An equation could be formed by connecting the possibilities which are false.The two possibilities would beI ride my bicycle and I walk or I don't ride my bicycle and I don't I walk.This statement could be represented by

(b A w) V ( b A -w) = FIn practice it is usually easier to deal with statements which are true.

15

Page 16: Medium Boolean Algebra

(In the example note the difference between the logical "or", which means p or qor both. This would simply be p V q = T).

Although the notation used above is that most frequently found in texts onlogic, some books prefer to use the same notation for sentence calculus as is usedfor circuitry, i.e. + and . for the operation and I for negation, with 1 in place of Tand 0 for F. Students may fmd this notation easier since the operations are thenvery similar to + and. in numerical algebra; it must he remembered, however, thatalthough the signs are the same the operations are entirely different. The fact thatcircuitry s.ymbolism may be used for logical problems is again evidence of theisomorphism, and also illustrates the fact that symbols are not mathematics butmerely an arbitrary notation to enable us to express mathematical ideas.

We now give some worked examples in which we shall use the + and. notation.

EXAMPLE 2 Form an equation to represent the fact that not more than one of thestatements a, b and c is true.

1> This could be written(a.h/.c) + (a/.b.c) + (a/.b/.c) + (a/.h/.c) = 1

Alternatively considering the falsehood this could have been written(a.b) + (b.c) + (c.a) = O.

In the solution of problems it is important to realise that if a.b = 1 then a = 1 andb = 1, i.e. a and b are both true. Also if p and q are both true, i.e. p = 1 and q = 1then p.q = 1.EXAMPLE 3 When we play football if we have good opposition we have a goodgame. Either a game is worth playing or it is a poor game. Are we satisfied if theopposition are good?

Let A = good oppositionB = good gameC = worth playing

The statement "if we have good opposition we have a good game" is the sameas "either we have poor opposition or the game is good"

i.e. AI + B = 1Also C + BI = 1and A = 1=> (AI + B).(C + B).A = 1=> [(AI.C) + (A/.B) + (B.C)].A = 1 (B.BI = 0)=> B.C.A = 1 (AlA = 0)=> A=l,B=I,C=I.

i.e. The opposition are good, the game is good and the game is worth playing.

EXAMPLE 4 A, B, C and D may serve on a committee; at least three members mustserve.

A will only serve if C serves.B will not serve if C and D serve together.D will only serve if C does not serve.

16

Page 17: Medium Boolean Algebra

Let a denote "A serves" and a'denote "A does not serve". Similarly for theothers.

For the first statement the possibilities area.b.c.d/, a.b'c.d and a.b.c.d

so we may write a.b.c.d' + a.b'c.d + a.b.c.dThe second statement leads to

a.b'c.d + a.b.c.d' + a.b.c/dand the third to

a.b.c/d + a.b.c.dl

Since each of these statements in turn is true, we may connect them by "and"(here by" .") and equate to 1. Thus

(a.b.c.d' + a.b/c.d + a.b.c.d).(a.b'c.d + a.b.c.dl + a.b.c/d).(a.b.c'd + a.b.c.d) = 1Simplifying

a.b.c.(b.dl + bId + b.d).(b'c.d + b.c.d' + b.c'd).(c/d + c.d) = 1a.b.c.(b'c.d + b.c.d' + b.c'd).(c'd + c.d~ = 1

(sincex.x = 1,x + x/= 1 and x.x'= 0)a.b.c.d/(c'd + c.d) = 1

a.b.c.d' = 1Hence A, Band C serve.

Exercise 5a1. Form equations to represent the following statements. Define the symbols youuse.

(a) In the science sixth you may take three and only three subjects and you maychoose from Maths, Physics, Chemistry and Biology.(b) Go to the shops and buy either peas or beans!(c) Either you go to the match with John or you don't go at all.ed) If we don't receive food we will starve and die.

In questions 2 and 3 form equations to represent the statements and simplify.Give a statement equivalent to the three statements given.2. If you join the navy you see the world. If you are fit you join the navy. Eitheryou see the world or you are fit.

[N.B. the frrst statement can be rearranged to state 'Either you don't join thenavy or you see the world']3. If we stay to school dinner we don't become hungry. If we are hungry we gohome. If you go home you can't have school dinner.4. If either my car breaks down or the road is blocked then I won't come. But it isnot true to say that if the road is blocked I won't come. My car has broken down!Show that at least one of the above statements is false. What conclusions can youdraw if you know that only one of the above statements is false?

Page 18: Medium Boolean Algebra

5. If (a) nobody wears a yellow tie with a black bowler(b) everybody either carries an umbrella or wears a buttonhole(c) those who carry umbrellas also wear black bowlers(d) all those who wear pink socks also wear yellow ties,

show that all those who wear pink socks also wear buttonholes.6. Choose the foreign language(s) which you may study in accordance with the

following rules:(i) If you don't take French you take German(li) If you take French and German you must take Latin

(iii) If you don't take Latin or French, you don't take German

6. NOR LOGIC CIRCUITRY

Optional ReadingMany logical problems may be solved by circuits that involve a more sophisti-

cated switching system than is supplied by ordinary circuit boards. Such a systemis provided by NOR transistorised units.

A transistor may act as a switching device in such a manner that when currentis or is not supplied to the base-emitter, current does not flow or flows in thecol1ector-emitter circuit. (Ask your science teacher to explain this fully.) This maybe employed in a suitable circuit as -

-12v

5.6 K {) resis.

Input

OvDiode

Figure 6.1

The effect of this circuit is that if current is supplied to the input, no currentflows from the output. The circuit may be represented diagrammatically as -

18

Page 19: Medium Boolean Algebra

Input

Figure 6.2

Output

and the arrangement can be stated alternatively as the fact that the output is liveprovided that there is no input at neither one NOR other of the inputs. Hence thename NOR unit.

(A full description of these units and their use was given in articles byMessrs. Flanagan, Molyneux, and Wilkinson in Mathematics Teaching, Nos. 30, 31and 32.)

It is useful to have an indication of whether the output of a unit is live or notand to achieve this a further transistor must be added to the circuit and linked to abulb, as shown right of the dotted line in the diagram.

Bulb

Input

Figure 6.3

Output

When the output is live the bulb is lit and vice versa.For most problems a board containing a dozen or so of these units is adequate,

although the number naturally depends on the problem. Inputs and outputs to eachunit are provided by single sockets so that units may be interlinked by wires con-taining a single plug at each end. The current.source is 12 to 14 volts D.C.

19

Page 20: Medium Boolean Algebra

Connectives1. Since a zero input (0) gives an output (1) and vice versa an input denoted by a,produces an output a .

a

2. Units may be connected in series

a a' a

but the main use of this is with more than one input

a

b

The point x will be off if either a, or b or both, are live (note the logical "OR").Thus x represents (a + b)/, and y will represent a + b.3. The connective "and", a.b, may be obtained as follows

a

b bl

a'

a.b This is called an "and" gate.

(The input into the last unit is al + bl which is equal to (a.b)'by de Morgan's Laws.)4. The exclusive disjunction, "or" but not both is obtained by the circuit

a

b

a.b/+b.al

20

Page 21: Medium Boolean Algebra

Statements into circuitsSome simple examples will illustrate the basis of the work.

1. I llave two friends and I do not wish to go to the cinema alone.This implies I take A or B and the circuit is

A

B

Inputs to the unit are equivalent to the fact that A goes or B goes, respec-tively. The arrangement of units is an OR unit, and the light on the final unit is litwhen the condition of the logical OR is satisfied, i.e. when the switch representingA or that representing B or both the switches are on. Thus I may take A or B orboth of them to the cinema.

2. I want to take Alice to a dance, but she will only come if Brenda comes too.This may be stated as -

Presence of A implies presence of B and the circuit formula isAI +B

(Work out that this actually means what is intended.)The circuit then becomes

A

B

A'

A' +B

3. The problem solved above under Sentence Calculus may be solved by NOR Logicmethods as follows:

A, B, C and D may serve on a committee; at least three members must serve.(i) A will only serve if C serves(ii) B will not serve if C and 0 serve together

(iii) D will only serve if C does not serve

21

Page 22: Medium Boolean Algebra

(i) The presence of A implies the presence of C.In a NOR statement this becomes X + C and the circuit is

A

c

(ii) Presence of B implies absence of (C and D)B' + (C.D) I

de Morgan's law may be used to simplify toB' + C' + D'

and the circuit is

B

c

D

(iii) Presence of D implies absence of CD' + C'

c

D

Since all these statements must be true simultaneously, we must link thethree circuits by an "and" gate (see 3 above).

22

Page 23: Medium Boolean Algebra

Output of (i)

Output of (il)

Output of (ill)

In each case, however, where two NOR units are in simple series, they may beremoved, e.g.

is equivalent to

A

B

D

The fmal circuit then becomes as shown below, the units marked beingomitted because of the above.

23

Page 24: Medium Boolean Algebra

The method of using outputs from one unit to serve more than one statementcircuit should be noted (e.g. the output from the unit after D is used for bothcircuits (ii) and (iii) ).

If the circuit is now put on the circuit board and the switches A, B, C and Dpressed in combinations of tluee, or all four (condition: at least 3 must serve), thelamp on the final circuit output will light up when a permitted combination ispressed. In this case A, Band C.

In some instances, of course, more than one combination may be possible, asin the following case. (Students are left to work out the detailed circuits; the finalcircuit is given.)4. On a school course,

(i) French may not be taken' with Physics(ti) Engineering drawing may only be taken if Physics is taken

(iii) Biology may only be taken with French if Latin is taken(iv) Latin may not be taken with Engineering Drawing

E

L

F

B

24

Page 25: Medium Boolean Algebra

7. BOOLEAN ALGEBRA APPLIED TO DIGITAL COMPUTERS

Suppose we wish to perform operations of addition in the binary system andwe wish to have an electronic machine to do the work for us.

The computation can reduce to a combination of O's and l's and the absenceof a signal can be denoted by 0 and its presence by 1.

Let us add two binary digits x and y

x

oo

1

1

y

o

1

o

1

x+y

o

1

1

10

Providing x and yare not both equal to 1 then the resultant binary numberhas only 1 digit and one bulb would serve to denote its value. If x and y both equal1 then two bulbs are necessary.

Let the bulbs be denoted by c and s(c stands for 'carry' digit and s for sum)

then the numbers above will appear

c s

o 0o 1o 11 0

If we compare this table with the xy table we can state:-c = x.ys = x'.y + x.y'

There will be one lamp in the c circuit and one in the s circuit.The full circuit is given by c + S

25

Page 26: Medium Boolean Algebra

•••• -- x

...--- x

y

y

y'

Figure 7.1

This circuit is known as a half-adder because it merely adds a digit x to a digit ybut does not take into account any "carry in" from the preceding unit.

In NOR units the symbolism is the same, the sum being x'.y + x.y' and thecarry to the next unit being x.y. The circuit is then as shown (The Boolean functionsare alongside).

x

y

26

x

y

Figure 7.2

x'.y' X_yl + x/.y

Sum

Carryoutx.y

Page 27: Medium Boolean Algebra

On a circuit board this is demonstrated as follows:-

y

Figure 7.3In NOR circuitry the full adder is achieved by taking two half adders and

feeding the "sum" output from one half adder into the input of the second halfadder. The "carry in" for the whole unit occupies the other input of the secondhalf adder, the two carry out wires are combined through an OR gate, and the finalsum of the whole adder cqrnes from the sum output of the second half adder.The circuit is given below:

x

y

Carryin

Sum.

Carryout

Figure 7.4

27

Page 28: Medium Boolean Algebra

Page 1 Exercise la1. Eight areas represent

ANSWERS

AnBncA n B n C'A n B' n CA n B' n C'

A'nBncN n B n C'N n B' n CPi n B' n C'

2.

3.

AnB

A' n B'

Area representing (A U B) n (A U C) is same as area representing A U (B n C).

4. (i)

c(A n B) U (A n C)

28

Page 29: Medium Boolean Algebra

(ii)

(A nB) n (B nC) (Doubleshaded area)

AnBnc

(ill)

A' UB'u C'

(iv)

AU (B n C')

Page 2 Exercise 1b4. Isomorphism between n and U.

AI n (B' U C)

29

Page 30: Medium Boolean Algebra

Page 5 Exercise 2a1. A A A.A A.A = A

0 0 01 1 1

2. A A A+A A+A = A

0 0 01 1 1

3. A P: A .A' A .AI = 0

0 1 01 0 0

4. A A' A+N A+A' = 1

0 1 11 0 1

5. A B A.B A + A.B A+A.B = A

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

6. A A' B N.B A+N.B A+B A+N.B=A+B0 1 0 0 0 00 1 1 1 1 11 0 0 0 1 11 0 1 1 1 1

10. A B C B.e A + B.e A+B A+C (A + B). (A + C)0 0 0 0 0 0 0 00 0 1 0 0 0 1 00 1 0 0 0 1 0 00 1 1 1 1 1 1 11 0 0 0 1 1 1 11 0 1 0 1 1 1 11 1 0 0 1 1 1 11 1 1 1 1 1 1 1

A + B . C = (A+B).(A+C)

30

Page 31: Medium Boolean Algebra

11. (i) A B A+B ft! B'0 0 0 1 10 1 1 1 01 0 1 0 11 1 1 0 0i.e. when A + B is on A' .B' is off

(A + B)' = p( .B'(ii) A B AB J{ B'

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

(A.B) , = A' + B'

N..B'1ooo

1\ + B'111o

Page 7 Exercise 2b1. A 2. A.BI

4. A.B'.C' 5. N.3. A.B + A/.B'6. B

Page 9 Exercise 3a1. p P PI\P PI\P=P

T T TF F F

2. p P PYP PVp=pT T TF F F

3. P "'p P1\ ",p P 1\ ,..,p = F

T F FF T F

4. p ",p PV~p PV'll=TT F TF T T

5. p q pl\q Y(PAV PV(p 1\V = PT T T TT F F TF T F FF F F F

31

Page 32: Medium Boolean Algebra

6. p "'p q "'p 1\q p ~P6 PyqT F T F T TT F F F T TF T T T T TF T F F F F

PV ("'p /\ q) = p V q7. p "'p q "'p V q P 1\ ("'p V q) P/\q

T F T T T TT F F F F FF T F T F FF T T T F F

p V (",p /\ q) = P 1\ q8. (a) p q ",p """l pvq ~pvq) "'p /\ "'q

T T F F T F FT F F T T F FF T T F T F FF F T T F T T

~p V q) = ~p /\ "'q(b) p q "'p "'q P/\q '" (p 1\ q) ""'p V '" q

T T F F T F FT F F T F T TF T T F F T TF F T T F T T

-(p 1\ q) = ~p V ~qThese are De Morgan's Laws

9. (a) A (b) A (c) F (d) T

Page 14 Exercise 4b1. (i) Satisfies all axioms except 5. 2 has no complement.

(ii) Satisfies all axioms and forms a Boolean algebra.[isomorphic with example on page 12]

(iii) Satisfies all axioms and forms a Boolean algebra .•2. l(a), 2(a), 4(a), 4(b), 5(a), 5(b)3. l(a), 2(a), 3(a),4(a)4. 1, 2, 3, 4 Not 55. l(a), 2, 4, Sea)

32

Page 33: Medium Boolean Algebra

6. (i) Satisfies all axioms except 5. 60/a cannot be inverse of a for all a.(ii) Satisfies all axioms except 5. 12/a cannot be inverse of a for all a.

(iii) Satisfies all axioms and forms a Boolean algebra.7. Satisfies all axioms except 5 in each case. -x cannot be inverse.8.1,2,3,4Not5.9.1,2,3,4Not5.

Page 14 Exercise 4c1. (a) x.y.z

(b) y'.(x+z)(c) y+x.z

2. n 0 1

000101

3. (i) A'nB'nc'(ii) A U (B' U (' )' U (B' U C U D/)'

4. (a)(i) [AI. (B.e)'] /(ii) (A/.B)/.(B.C)/.(C/.A)/(iii) X'.Z'

(b)A + (BI + c')/[(A + B) / + (B I + C) I + (C + A ) /] I

eX + Z)'

Page 1 7 Exercise 5a1. (a) (m' + p + C + b).(m + p' + C + b).(m + p + c/ + b).(m + p + c + b/)

(b) g = "go to shops", p = "buy peas", b= "buy beans"g.(p + b) or g.p + g.b

(c) m = "I go to the match",j = "John goes to the match"m.j + m' = j + m I

(d) r = "receive food", s = "will starve" ..d = "will die"r'.(s + d)

2. n = "join navy", w = "see world", f = "be fit"n'+w,f/+n,w+fw.(f' + n) = 1 => You see the world.

3. d = "stay to dinner", h = "become hungry", g = "go home"d' + h' = 1, II' + g = 1, g' + d = 1 => h' = 1 ~ h = 0You don't become hungry.

4. c = "car broken down", r = "road blocked", w = "won't come"(c+r)'+w= l,(r'+w)'= l,c= 1.

Combine these by . and show that left hand side becomes O. One statementfalse gives c.(w + r) = 1, i.e. my car is broken down and either the road is blockedor Iwon't come.6. Possible combinations: German and Latin; French; French and Latin; French,

German and Latin.

33

Page 34: Medium Boolean Algebra

INDEX

And gate ..Associativity ..Boolean algebra

axiomsapplied to digital

computerCircuits ..CommutativityComplements ..ConnectivesDe Morgan's LawsDisjunction, exclusive

inclusiveDistributivity ..Duality ..

.. 20

.. 11

.. 1011

.. 254

.. 10

.. 11

.. 20..3,6,7,10

8,208,20.. 113, 11

Full adderHalf adderIdentity ..IsomorphismNor Logic circuitry ..Sentence calculusSet algebra

identities ..Statement calculus ..

identities ..into circuits

Switching circuitsidentities ..

Truth tablesVenn diagrams

.. 27

.. 26

.. 1111

.. 18 et seq... 15

1276

.. 214

.. 10

.. 4, 71

Symbols

&(j>AIAnBAUBE

~C

34

the universethe empty setthe complement of the set A, not A.the intersection of sets A and Bthe union of sets A and Bis a member ofis not a member ofis a subset of

+, V. ,/\':L

TF

orandor but not bothnottruefalse

Page 35: Medium Boolean Algebra
Page 36: Medium Boolean Algebra