Logic Made Easy Warring
Logic Made Easy Warring
Logic Made Easy Warring
ltUOe i ests
Ilock Logic and Truth Tables Algorith
klgebra Logic Equations Karnaugh Maps and Logic
tilts Introduction to Logic Types of Logic Deduc
iv is rams a Dia
uction
)eductive Logic Venn Diagrams Simple Logic Diar,
Inductive Logic - Logic with Numbers Logic
.itude Tests Block Logic and Truth Tables Algorithm
1, Boolean Algebra Logic Equations Karnaugh Mar
ind Logic
c De
)iagrams
n Aptitu e ables
klgorithms ions Ka
laugh Maps to Logic
hypes of Log n Diagrams
5irnple Logic Diagrams Inductive Logic Logic wit
lumbers Logic in Aptitude Tests Block Logic and Trut
rabies Algorithms Boolean Algebra Logic Equa
:ions Karnaugh Maps and Logic Circuits Introductio
'1 Logic Ty ot Logic Ven
w itivAl
agrams Si imuctive Logic
gic with Numbers Logic in Aptitude Tests Block Logi
id Truth Tables Algorithms Boolean Algebra Logi
luations Karnaugh Maps and Logic Circuits Introduc
)n to Logic Types of Logic Deductive Logic Ven
LOGIC
EASY
WARRIM
shape of the bracket important, but the fact that it had to be fitted with adapting the style of natural language has been used by logicians since
bolts. Too bad if they had produced hundreds of brackets before the earliest days, although the first successful attempts to produce a
someone found that they were not usable! complete artificial language on this basis is due to the German logician
Gottlob Frege and only appeared towards the end of the last century.
Heuristic Reasoning The idea has since been developed extensively, replacing words with
Heuristic is the name given to a certain form of logic (or possibly symbols, and developing theorems of logic.
more correctly philosophy) involving a study of the methods and rules The aim is very simple - to give each expression an exact meaning,
of discovery and invention. Put in everyday language it could be free from context (which can often confuse or produce ambiguity of
described as arriving at a plausible guess to the answer of a problem. meaning in a natural language); and manipulate such expressions in
Heuristic reasoning is not regarded as taut (i.e. exact), but somewhat a logical manner (determined by rules and theorems). In practice this
provisional. It may (that is, the answer) be correct or incorrect. becomes a vast subject on its own, far beyond the scope of this book,
Equally, it may be based on inductive logic, or analogy. In either case and so is only mentioned as such. After all, the title is Logic Made Easy,
it can be a useful mental exercise, but heuristic reasoning is not and translating a natural language into an entirely new artificial
acceptable as positive or absolute proof. language is not easy. Just as it is not easy to learn computer language,
although with the great demand for such knowledge there are now a
Analogy considerable number of simplified computer languages which are
Analogy can be defined as a branch of heuristic reasoning and (relatively) easy to learn. Millions of people now use computers. The
defined simply as 'a sort of similarity'. From such similarity it is greatest number of computers in use, indeed, are the home computer
possible to make an educated guess at possible unknowns. However types. The number of people seriously interested in a comprehensive
the application of analagous argument is much broader than simple formalized logic language probably barely runs into thousands. Hence
argument. Analogies can be vague, or clear cut. They can be applied this type of language remains largely the prerogative of academics.
to mathematics, philosophy or other forms of argument. In many For instance, you start by translating a simple premise:
cases analogous argument and deduction is the only answer to lack of some A are B
knowledge in tackling a problem. Probably the clearest example here
is the case of a mathematical problem where a solution is quite into something like:
straightforward (and exact) using calculus, but the person's know- (3x) (Px & Ox)
ledge of mathematics does not extend to calculus. Using analagous
reasoning he (or she) could well derive an acceptable answer, if not and a little later on may find you have produced an expression
necessarily exact. something like this!
That, in fact, is the weakness of analogy. It is never exact argument
(x) (y) (P ad Oy ) & (Sxa, v Sya, x)
and deduction - it is heuristic reasoning.
(3z) (3w) ( (Lxz & Lyw) & (Pz & Pw) & (Sza2w v Swa2z))*
Logic Languages Nevertheless, you will find that this book does make some consider-
One of the basic difficulties in developing an approach to logic is able use of artificial language using symbols, but in a very, very much
the limitation of ordinary language when it comes to presenting prem- simpler form.
ises and conclusion in a formalized manner. (Exactly the same problem
*
arises with computers. You cannot instruct or 'talk' to computers in Incidentally, the natural language translation of this is - Tor every pair of
ordinary language - it has to be a formalized language consistent with prime numbers differing by 2, there is a pair of greater prime numbers
the input/output capabilities of the computer). So formalizing or differing by 2'. There are much simpler ways of expressing the same thing!
18
Logic Made Easy
Sentential Calculus
For the same reasons that the academic formalized language of
logic is only briefly mentioned, sentential calculus is also glossed over. It CHAPTER 2
relates to the artificial language and, broadly speaking, is based on a
series of metatheorems or proofs of general principles characterizing the
language. Every sentence consistent with a metatheorem is then either Which Type of Logic to Use?
a tautology (i.e. completely unambiguous) or a generalization of a
tautology. Everyone is born with the inherent ability to do some things well
To whet your appetite - or put you completely off the subject - here and also to suffer a sort of 'mental blank' in dealing with some other
is the start of metatheorem 110 in sentential calculus: subjects. Someone who is good at languages, for example, is often
quite hopeless with mathematics, or mechanical subjects. Some people
reason best with words, others with 'pictures' or diagrams.
If it looks interesting you can gain some further encouragement from It is just the same with logic. Some people will find one type of logic
the fact that there are only 22 theorems in the 100 -series covering the easy to understand and apply, but find other types of logic impossible
sequential calculus! to comprehend. So the answer to this particular problem is to work
with the type of logic you understand best. At the same time, though,
it does not necessarily follow that every type of logic can be applied to
solving any problem in logic. Often the reverse is true. Solving a
particular problem may involve a particular type of logic being used.
Only mathematical logic, for instance, will give exact answers to purely
mathematical problems.
Let's see how alternative types of logic can be applied to solving the
following problem:
George Brown, Tom Green and Bill White were talking. 'Funny
thing', said Brown. 'I've just noticed we're wearing different
coloured hats the same as our names."Yes', said one of the others.
`But none of us is wearing a hat the same colour as our name. For
instance, I'm wearing a green hat.'
(Green did not speak at all, so we could fill in his line with X and X, C
but this is not necessary for solving the problem.) Fig. 2.1c
We can now go back to the original diagram and enter the fact that
White has been identified as the last speaker, wearing the green hat: The person who spoke last was wearing a
green hat, so this bit of
information in block logic is:
brown green white
hat hat hat spoke last-s. green 'Input' -0. BROWN or WHITE
BROWN X X
GREEN But it cannot be Brown since he spoke first, which puts a NOT in the
X
green 'input' line of diagram A:
WHITE X / X
brown
That leaves only one possibility for Brown. He must be wearing a NOT H
white hat. The completed diagram also confirms that Green is wearing
the brown hat: green --I NOT H OR BROWN = white hat
brown white
green white
hat hat hat
BROWN X X Fig. 2.2
N/
GREEN / X X The rest of the solution then follows by completing the
WHITE X ./ X GREEN and WHITE (i.e. introducing a second NOT in diagrams for
the appropri-
ate 'input' lines).
Solution by Block Logic Incidentally, rendered in Truth Table form, as the complementary
Here the possibilities are written down in the following form: method of expressing block logic, the solution follows
lines as the solution exactly the same
by Logic Diagrams, using 1 and 0 instead of ,/
and X.
brown H NOT H brown
Example IA
True premises and true conclusion
Premises: All animals are mortal (true)
All cats are animals (true)
Conclusion: All cats are mortal (true)
This is valid argument.
Example 1B
On the other hand we can have true premises leading to a true
conclusion, but with invalid argument, e.g.
Premises: All animals are mortal (true)
All cats are mortal (true)
Conclusion: All cats are animals (true)
This is invalid argument, even if the conclusion is true, because there
is nothing in the premises to establish the fact that cats are animals. In
`knowing' that they are, we are assuming another premise, not
speci-
fically given.
26
Logic Made Easy Deductive Logic
27
The logical correctness or incorrectness depends solely on the rela-
Example 3
tion between premises given and conclusion. You cannot 'add in'
False premises and false conclusion
another premise, however convenient. On the other hand, logical Premises: All cats have wings
argument can ignore a false premise, as in the next example. (false)
All dogs are cats (false)
Example 2 Conclusion: All dogs have wings (false)
True and false premises and true conclusion This is still valid argument since the conclusion reached is
Premises: Al} cats are mortal (true) a logical
assessment of the facts presented in the premises, even if these are false.
All birds are cats (false)
Conclusion: All birds are mortal (true) Example 4
This is valid argument since its conclusion reached is true, even if one False premises are true conclusion
premise is false. Premises: All cats have wings (false)
At this point it should be pointed out that although the examples All birds are cats (false)
quoted are simple statements this does not mean that deductive logic Conclusion: All birds have wings (true)
is restricted to simple, straightforward premises. Quite the reverse.
Valid argument again!
The original subject may be quite complex and lengthy, the gist of At this point, deductive logic may appear to be anything but
which then has first to be extracted in the form of simpler premises. If
but the above established the ground rules - the simplest and logical,
easiest
dealing with more than one subject, it would also have to be broken
down in order to provide conclusions for each subject separately. to understand being: If the premises are true, a valid argument must give a
true conclusion.
Simple statements are thus the end product of a preliminary assess- This then raises a most important point, that the form of the
ment of the subject matter, as a preliminary to applying deductive argu-
ment must also be valid for the argument itself to be valid. To explain
logic. They express the gist of what is being analysed in the simplest this simply, let us take the premises of example IA:
possible terms, ignoring irrelevancies.
One thing needs to be made quite clear. Not every statement is All animals are mortal
necessarily a proposition or premise in logic. To qualify it must be All cats are animals
capable of being either true or false. This can help explain some of Now cross-link the two statements:
the paradoxes in 'classic' logic, like the logic puzzle (antinomy) of
Bertrand Russell's: All animals are mortal
`In a certain town there is a barber who must shave all those people
and only those people who do not shave themselves.' This leaves the All cats are animals
question of whether the barber shaves himself or not. If he does, he
breaks the rule and so he must not shave himself. If he does not shave This reads as 'all cats are animals (and) all animals are mortal'
himself, then he is again breaking the rule and so he must shave which is a valid form of argument for concluding 'all cats are mortal'.
himself. In baisic 'formula' terms, this becomes:
The answer to this is that the rule itself is wrong. It is both true and All A are B
false in the sense that it both can and cannot be obeyed. (That can be
arrived at by deduction.) There is another possible answer, perhaps an
even better one. Logically, the barber cannot exist. (That can be All C are A
arrived at by intuitive logic.)
(using A for `animals'; B for 'mortal' and C for `cats').
28
Logic Made Easy Deductive Logic
29
Now look at Example 1B, using letters again, which
only cross -links Further valid forms are:
like this:
(i) If A, then B
All A are B
Not B
Conclusion: Not A
All C are B
Example: Premises: If it rains, then I will get wet
The only common feature is that both animals and cats are mortal. I have not got wet
It is an invalidform to make a conclusion that all C Conclusion: It is not raining
are A (all cats are
animals), even if the conclusion is correct. Substitute 'fish' instead of (ii) If A, then not -B
`cats', for example: B
Conclusion: Not -A
All mammals are mortal Example: Premises: If it is fine, then I will not get wet when
All fish are mortal
I go out for a walk
Conclusion: All fish are mammals. I have gone out for a walk and got wet
Conclusion: It is not fine
The conclusion in this case is patently not true, because the form
of (iii) If not -A, then not -B
the argument is invalid.
Not -A
This, in fact, is one way of finding out whether the form of the
Conclusion: Not -B
argument is valid or invalid - see how they crosslink, and if 'substitu-
tion' to give an equally true premise (or a counter Example: Premises: If it is not raining, then I will not get wet
-example, as it is It is not raining
called), results in a conclusion which is obviously false.
This also explains why a true conclusion can be derived Conclusion: I will not get wet
even when Invalid forms of argument are:
one or all of the premises are false - provided the form of the
is valid. argument
(iv) If A, then B
B
A=1 A *1
i.e. A = 0
or A
Fig. 4.1
circles, one for animals, one for mortal and one for cats, as in the first middle term must be distributed exactly once, i.e. appear unshaded in
diagram of Fig. 4.4. Now, all cats being animals excludes cats from each of the other terms (circles). Conventionally, too, the middle term
that part of the cat circle which is outside the animals circle. Shade (M circle) is placed at the bottom of the diagram.
that area in as in diagram (ii). The premises used in the previous examples have been universal
Equally, all animals being mortal excludes animals from the animal premises, i.e. of the form all A are B. The case of a particular premise,
circle outside the mortal circle, so shade that area in, as in diagram i.e. some A are B needs a little more explanation. For this, take the
(iii). We are left with the conclusion that the only area now accom- following which consists of one universal premise and one particular
modating all cats is within the mortal circle - hence 'all cats are mortal'. premise:
Now try an example where the premises are true but the conclusion
(i) All artists are gifted peop.e
drawn (by deductive logic) is false:
(ii) Some artists are poor
Premises: (i) All dogs are mammals Conclusion: Some poor people are gifted people.
(ii) All cats are mammals
Conclusion: All cats are dogs.
The Venn diagram for this is developed as shown in Fig. 4.6. The
first (universal) premise excludes all artists from the artist circle out-
This time shading -in the diagram produces the result shown in Fig. side the gifted people circle, so this part of the artist circle is shaded.
4.5 (last diagram). The only area where all the cats are contained is Only some artists are poor, though, so this area of overlap is marked
within the mammal circle. Cats are excluded from the dogs circle by with an X. This 'some' area is common to artists, poor people and
the shading. Therefore, from the Venn diagram, no cats are dogs. gifted people. Hence some people c-.-1 be artists (as given by the
Testing the (deductive) conclusion in this way shows that the argu- premise); and equally some poor people can be gifted (as given by the
ment in this case is not valid. diagram).
Dogs Mammals
B 2 3 1=Ag AB
2=AB
B AB
B 4
3=AB
4=Ae B Ag AB
Alternative form of
Good Carroll diagram
scholars Fig. 4.8
diagram (I) diagram (II) diagram (111) for each (A and not -A, B and not -B). The diagram then plots in full
the various possible combinations - four in this case.
Fig. 4.7 Unlike a Venn diagram, this type of diagram can be extended to
accommodate quite a number of separate terms before it becomes
In the corresponding Venn diagram - Fig. 4.7 - mathematicians
are excluded from their circle except where it overlaps the good excessively complicated. It is, in fact, basically the same as a Karnaugh
map - see Chapter 13.
scholars circle by virtue of the universal premise (i). Some athletes are
good scholars (from the particular premise), but there are two over-
lapping areas where this could be marked with 'X', as in diagram (ii).
There is not enough information in the premise to indicate whether
the 'X' should be in area or area 2. Area 1 seems the logical
1
placement, for it is known that some athletes are good scholars. But
there is no information to confirm whether or not some mathematicians
are also good athletes.. In this case the 'X' can only be placed on the
line between the two (it could belong to either area), as in diagram
(iii). The Venn diagram, in fact, shows that this form of syllogism and
argument is invalid.
Venn diagrams can also be used for mathematical solutions,
although there are simpler and more effective diagrams, or alternative
methods which can be used in such cases. The particular limitation of
Venn diagrams is that they are not very flexible. The greater the
number of terms to be accommodated the more unwieldy (and
pos-
sibly confusing) the diagram becomes. This virtually limits their
application to a maximum of four separate terms or variables (i.e. four
overlapping shapes).
Jones also works in London, so does not live in London. Put an X More Facts - More Diagrams
against Jones under London. The remaining space in this column is Sometimes the facts available need treating in separate diagrams to
then filled with a tick - the only remaining possibility, i.e. Thomas solve alternative or complementary possibilities. Here is a further
lives in London. example illustrating this. Problem: There are three people with the
names Smith, Jones and Robinson. Their Christian names are Arthur,
London Brighton York Mary and Jane, not necessarily in that order.
SMITH X
(i) Their ages are 17, 24 and 30.
JONES X
(ii) Miss Jones is 7 years older than Jane.
THOMAS .\,/ (iii) The person named Smith is 30 years old.
What are their full names and ages?
Now Thomas lives further South than Smith. Since Thomas lives in
London that means Smith must live in York. The York column can (Note: after the original statement, the facts have been separated for
now be completed. The Xs in this column merely confirm that Thomas ease of reference. In a set problem the facts may be incorporated in
does not live in York (he lives in London); and since Smith lives in one complete statement. It is then first necessary to separate them out
as individual facts.)
York, Jones cannot.
To solve this particular problem, draw up diagram A relating
London Brighton York surnames to Christian names. The only immediate clue is that Miss
SMITH X Jones will not have the Christian name Arthur, so an X can be marked
N./ in the Arthur column against Jones.
X X
JONES*
THOMAS / X
SMITH
Arthur Mary Jane
The only possibility left is that Jones lives in Brighton, so the JONES X (diagram A)
diagram is completed like this ROBINSON
Inductive Logic
Inductive logic is similar to deductive logic in that conclusions are
based on premises, but with one very important difference. The con-
clusions extend beyond the area of fact provided by the premises.
Similar rules apply as to what is valid argument and a true conclusion,
but the conclusion is necessarily qualified. It is not necessarily absolutely
correct, particularly as it often has to be based on incomplete facts. It
may be a convenient generalization, or even a forecast by extrapolation.
The 'safest' type of inductive arguments providing conclusions (i.e.
those least likely to be in error) are those based on observed data, but
even these have numerous pitfalls, correctly called fallacies. Take as an
example a spring suspended vertically and carrying a pan into which
weights can be put. The downward deflection of the spring is measured
with weights of 10, 20, 30, 40, 50 grams, etc., added to the pan and
plotted as points of a graph - Fig. 6.1. These points all lie in a line, so
inductive argument would conclude that the relationship between
deflection and load is a straight line, and the graph drawn in accord-
ingly. It would also seem logical that if this relationship is true it will
10 20 30 40 50
Weight in grams
Fig. 6.1
50
Logic Made Easy Inductive Logic 51
extend beyond the measured range, i.e. downwards to give zero de- This point is made more clearly in Fig. 6.3, which shows a simple
flection with no load; and upwards to forecast the deflection produced wave form. Say this represents an alternating current, the value of
by larger loads. which is read by a meter. Suppose measurements are made at intervals
In fact, this conclusion holds true, up to a point. It could be used to 1, 2, 3, etc., which happen to correspond in time exactly to the peaks
calibrate a spring and a pan as a simple weighing machine, but there of positive current. This would give points lying in a straight line
are other factors (not catered for in the original premise) which could apparently indicating a steady positive current, Fig. 6.3 diagram (A).
modify the truth of the conclusion - Fig. 6.2. There could be a physical Equally, if they were made with the same interval but starting at a
quarter of an interval later ( 1', 2', 3', etc.), all the measurement points
would indicate zero current Fig. 6.3 diagram (B). Started half an
interval later, they would indicate a steady negative current.
15
0
!Spring
\/
weak
gets
positive t
0
diagram (A)
for instance. Or if there were no physical limit to movement, the spring ORIGINAL SIGNAL
could be stretched beyond its normal behaviour pattern (i.e. exceeds
diagram (C)
the limit of proportionality). Both would deny the truth of extrapo-
lating the original straight line graph upwards. Equally, the spring
could be affected by 'fatigue' in repeated use, so that it no longer
returns to zero deflection with no load. However, its behaviour within
the originally observed range is unaffected. Thus extending the con-
clusion too far beyond the area of fact has nullified the truth of the
conclusion. Fig. 6.3
In fact, even within the area of fact established by measurement,
the conclusion could still be false. In this case it is not, but with some This is an error (or what would be called in inductive logic terms a
other system where measured data spaced at regular intervals show fallacy) due to unrepresentative sampling. Not enough sample measure-
what is apparently a linear relationship (i.e. all the points can be ments have been taken to give anything like a true picture, so the
joined by a straight line), the true relationship could well vary differ- inductively reasoned conclusion is false. Take measurements at shorter
ently between points, e.g. instead of a straight line between points the intervals and this will immediately show up. Taken at one quarter of
true representation could be a curve waving up and down. the
original time interval, for example, the measured points and the
52 Inductive Logic 53
Logic Made Easy
subsequently induced plot would zig-zag up and down - Fig. 6.3 To be more complete the generalization would need to take in this
diagram (C). Still not true, but a much closer representation. second cause (temperature) into the final statement.
It is lack of sufficient samples (data), or unrepresentative samples A working 'formula' for such a method of reasoning would be -
which is a common reason for false conclusions in inductive logic, cause 1 (oxygen) in the presence of cause 2 (a suitable temperature)
particularly when applied to statistics. Opinion polls are a classic produced combustion of paper and wood (effect).
The other thing to emerge is that causal connections are based on
example. They are based on answers (data) provided by a limited
number of people, yielding, say, 65 per cent in favour of something a study of observed 'happenings' - what happens (i.e. what is the
and 30 per cent against (the other 5 per cent 'don't know'). The effect) in a particular circumstance or condition (cause). Equally
pollsters conclude, by induction, that 65 per cent of the whole population important is how many times this occurs. The more times the greater
the likelihood of the (generalized) conclusion being true, or at least
are in favour, 30 per cent against. As a matter of logic, this is basically
nonsense, unless the sampling is fully representative (which in fact it substantially true. This can be expressed in the following form:
can never be). It can only be a statistical generalization. It can also be Instance 1 of happening A is related to cause B present
biased unintentionally by poor selection of samples; or deliberately by Instance 2 of happening A is related to cause B present
drawing on samples most likely to give the desired result. Instance 3 of happening A is related to cause B present
This, indeed, is the chief limitation of inductive logic - basing a
conclusion on insufficient evidence (data) and/or jumping to a conclu-
sion (which is human nature, but not logic). At least these are honest
The conclusion to be drawn from this is:
errors (errors of ignorance), whereas biasing towards a conclusion is
not. All instances of happening A are accompanied by cause B.
In fact it is very difficult, or even impossible, to prove fully that any Note: This conclusion is reached partly by inductive reasoning and
inductive conclusion is true because it extends the conclusion beyond partly by analogy, induction and analogy being closely related.
the facts available at the time. It can become a 'theory of ...' or a Causal connections summarized in this way can at best be valuable,
hypothesis; but these in turn may become subject to further proof or and at least be merely suggestive. They can also lead to conclusions
disproof in the light of new evidence, or a new hypothesis. This applies which are not factually correct, but despite this may be acceptable to
particularly in the fields of mathematics and science. quite a number of people. Here is a classic example, using the form
given above:
Cause and Effect
Inductive reasoning can be called a study of cause and effect - Arthur broke a mirror, cut his hand, which was bad luck.
logicians call this causal connections. It is based on a condition (or cause) Mary broke a mirror, lost her purse, which was bad luck.
which is necessary to yield a certain effect, leading to a conclusion or Tom broke a mirror, sprained his wrist, which was bad luck.
hypothesis relating the two. As such it is an inductive generalization which Conclusion drawn: breaking a mirror causes bad luck.
may or may not be completely true.
Taking a simple everyday example, it is well known that paper or Testing Causal Connections
wood will burn in air, which contains oxygen. But it will not burn in There are, however, methods of testing causal connections and
a sample of air from which the oxygen has been removed. The induc- resulting conclusions, known as Mill's 'canons' (or rules), after the
tive generalization which could be drawn is that oxygen (cause) English philosopher of that name.
produces combustion (effect). However, this is only part of the true
(i) Method of Agreement
picture. To burn in the presence of oxygen the paper or wood must
first be raised to a suitable temperature, e.g. by holding a match to it. In words: if two or more instances of a happening under investigation
54 Inductive Logic 55
Logic Made Easy
have only one circumstance in common, the circumstance in which (v) Method of Concomitant Variation
alone all the instances agree is the cause (or effect) of the given happen- In simple language, this accommodates varying happenings desig-
ing. nated by + or - signs and is easiest to understand in symbol form:
Represented in symbol form, using capital letters for circumstances
and lower case letters for happenings, this becomes: ABC abc
A+BC a+bc
A B C D occur together with a b c d A -B C a ±b c
A E F G occur together with a e f g Therefore, A and a are causally connected.
Therefore A is the cause (or effect) of a.
Although looking less understandable at first sight, this is actually
(ii) Method of difference the most useful of the methods of testing causal connections since it
In words: if an instance of a happening occurring and an instance can provide quantitative analysis of inductive reasoning.
in which it does not occur have every circumstance in common but
one, that one occurring only in the former; the circumstance in which
alone the two instances differ is the effect (or cause) or an indispensable
part of the cause of the happening.
In symbol form:
A BCD occur together with a b c d
B C D occur together with b c d
Therefore, A is the cause (or effect), or an indispensable part of the
cause of a.
writing out comprehensive mathematical equations. Approach the (vi) By the same reasoning, the next highest possible total is 45,
problem logically, looking for the simplest solution. The original which gives the following answers:
mathematical equation given is, in fact, a redundant statement. It B= 15
introduces x, y and z for unknowns, and at the same time retains R, B R = (4 x 9) = 36
and G. (In fact x = R, y = G and z =B.) G = (1 x 9) = 9
This is a basic error mathematicians often make - over -complicating
and so on, until we come to the last possible answer when there are
translation of facts into equations so that redundancies are introduced,
55 blue balls:
or the whole equation becomes too complex for easy solution. At the B =- 55
extreme, mathematical analysis can become so complex that only the R = (4 x 9) = 4
originator can understand the working - and as a result nobody can
G = (1 x 1) = 1
Now since J = 3 x S from equation (i), substituting this in As a hypothetical example - and an exercise in logic - let's take the
equation (ii)
gives case of a printer who produces large catalogues for various clients.
2 x S+30 =3 x S+15 Trying to cut costs, individual clients often ask how much can they
Or 15 =S save by leaving off the page numbers? The printer's cost for setting
Thus if the son's age is 15, Johnson must be 45. these numbers is, say L5 per thousand digits. A particular client asks
what the savings would be on his 512 -page catalogue.
Suppose now the problem was a little more obscure, or we could The printer now sits down to think, and works things out like this:
not see how to derive the necessary two equations. In that case
try
solving the problem on an arithmetical trial -and -error basis, using a (i) Pages 1 to 9 require one digit for page numbering, making 9
little genuine logic and a lot of 'illogical logic'. digits.
If Johnson is talking about 15 years on, he is probably now under (ii) Pages from 10 to 99 require 2 digits for each number and thus
60. His son, too, will probably be 20-30 years 20 digits for each ten pages, requiring 9 x 20 =180 digits
younger than Johnson.
On this basis, let's assume that Johnson is 54, when his son's (iii) Pages from 100-999 require 3 digits for each number and thus
age must
be 18. 300 digits for each hundred pages. Four groups of hundred
What does this give in 15 years time? pages will take the book up to 499 pages, requiring 4 x
300 =1200 digits
Johnson will be 69 and his son 30. This does not agree with the second
fact - it shows a surplus of 9 years. So logically Johnson must be (iv) Pages 500-512 will then require 3 digits per page, on 13 pages
younger or 3 x 13 = 39 digits.
than 54 - and illogically
by that surplus. Thus Johnson is 54 -9 = 45,
and surprisingly that checks out as correct! Adding all this up he finds 1428 digits required, which at a cost of L5
Do not expect 'illogical logic' to provide correct answers every time. per thousand amounts to a sum of £7.14 if the page numbers are
It certainly won't. But it is the basis of another method of omitted. (His time in working it out will have been worth more than
handling
arithmetical logic. First an answer is estimated (or guesstimated, if that!)
you like) on a reasonably logical basis, i.e. what appears to be the Logically, when faced with a similar problem again he will simply
right order of answer. Then see how it fits the facts. From this, say to the client (from experience) that any saving is negligible. But
the original estimate up or down to get nearer to the facts,adjustuntil suppose the client persists in asking what the saving is for a particular
eventually your adjusted answer meets the facts. book. Does he go through the whole process again? Not if he has
What you are doing, indeed, is employing a sort of loose variation spotted the formula which can be derived from the original working.
of reductio ad absurdum
together with logical reasoning. The number of digits required fall into a distinct pattern:
Not to be recommended for general use - 'illogical logic' can become
pages 1-9 =1 x 9
tedious if dealing with two or more unknowns which have to be pages 10-99 = 2 x 90
estimated and continually readjusted. But when all else fails and
you pages 100-999 = 3 x 900
cannot see how to work out the arithmetical problem, you could try
it instead of giving up entirely! and so on (e.g. pages 1000-9999 for a really long book used = 4 x 9000
digits). So the basic formula is:
Devise Your Own Formulas
number of digits= (1 x 9) + (2 x90) + (3 x 900) + (4 x 9000)
Quite often at work or business similar tedious calculations pages covered 9 99 999 9999
crop up
at various times, which have to be worked out from first principles. A
desk calculator helps, but it still takes time. How very much simpler Any intermediate number of pages can then be inserted into this formula
if a working formula can be devised to cope with the problem. for a quick answer.
62
Logic Made Easy Simple Arithmetic or Logic with Numbers
63
Lets use 512 pages again, which falls in the third
group. The fourth This could have been tackled in another
group does not apply and is ignored. Put the actual total of pages in way. The basic 'plan' for
their third group, and deduct the prior pages covered by the allocating notes into different pockets shows that a total of 28 notes
previous are required. So it was rather foolish of Bellamy to have spent all his
two groups:
money in buying $100 notes for with the amount he had available he
number of digits= (1 x 9) + (2 x 90) + 3 x (512 - 99) could only get 25 notes. He should have looked for the answer first,
=9+ 180+ 1239 and saved himself the trouble of going back and changing three
= 1428 notes.
He was also fortunate that there was a simple solution to his re-
Is it Possible? quirements.
Here is another example of a problem in arithmetical logic where it Jackson was much more methodical about planning his re-
is not known at the start whether there is a possible answer or not. quirements for his trip to America. He hit on the same basic plan, and
had the same amount of
money for buying dollar notes, but he went
Bellamy is travelling to America. He has bought twenty-five $100 about working it out this way.
notes from his bank. For safety he wants to distribute them in
different pockets, with each pocket holding a different number of (i) The least amount of notes I need are 28; and I can afford to
notes and different total value. He has seven pockets in all. Can he buy up to $2500 worth of notes.
do what he wants? (ii) I cannot afford to buy twenty-eight $100 notes
as that totals
$2800 - more than I have.
This problem is tackled from first principles. The least number of (iii) I will therefore buy twenty-eight $50 notes which will
notes he can have in any one pocket is 1; and the least difference in the cost me
$1400 and leave me $1100 still available
amounts in each pocket must also be 1 (in this case 1 note). So write (iv) I will then allocate these notes: 1 in pocket (i), 2 in
down numbers (i), (ii), (iii), etc, representing pockets and enter under etc. pocket (ii),
each the number of notes allocated on the above basis. (v) I can afford to
buy eleven more $100 notes. If I add one to
pockets (i) (ii) (iii) (iv) (v) (vi) (vii)
each pocket, that will still give me a different number of notes
notes 1 2 3 4 5 6 7 and different total value in each pocket. That will need seven
Add up the number of notes needed to do this. The total is 28 notes. more notes, costing $700 and leaving me with $400
unspent.
(vi) If I use this to buy four more $100 notes I can still conform
But Bellamy only has 25 notes, so he cannot fulfil his original plan. to
How, in fact, could he do it, for he cannot afford to buy more my original plan by putting all four of these additional notes
into either pocket (iv), (v), (vi) or (vii); or
dollars. Only changing one (or more) $100 notes into smaller denom- alternatively one
inations so that he can have a greater number of notes. extra $100 not into each of these four pockets.
The answer is quite simple in this case. Logical assessment of the Jackson has arrived at possible solutions by a mixture of
arithmetic and deductive logic. simple
position has established that he needs 28 notes, not 25. So Bellamy
changes three $100 notes into six $50 notes. That now gives him a Quite often problems of this type do not have an answer - see the
total of 28 notes, which he can now allocate like this: example under Reductio ad absurdum (Chapter 1).
pockets (i) (ii) (iii) (iv) (v) (vi) (vii) Looking for Short Cuts
number of notes 1 2 3 4 5 6 7
value of notes Here is what looks like. a tedious example of
$50 $50 $50 $100 $100 $100 $100 solving simultaneous
money in equations for unknowns A, B, C and D. A solution is possible
(assum-
ing all the equations are valid) because there are four unknown
pocket $50 $100 $150 $400 $500 $600 $700 four separate equations.
and
64 Logic Made Easy
(i) A+2B+3C+4D=2
(ii) 4A+4B+2C+2D= -2 CHAPTER 8
(iii) 5A + 2B + C - 3D = -6
(iv) 3A - 2B -C + 7D = 22
Let's look for a short cut. There is one obvious one we can try. Logic in Aptitude Tests
Adding equations (i) and (ii) together gives:
Aptitude tests are widely used in vocational guidance and industrial
5A + 6B + 5C + 6D = 2 -2 = 0
training. To be valid aptitude tests the questions must be solvable by
Now group as: a specific talent, not by knowledge or learning. Some, but only some,
can be solved by logic reasoning. Others have to be tackled by mental
5(A+C)+6(B+D)=0 reasoning, numerical reasoning or abstract reasoning. Still more are
Thus A + C =0, which means A = -C based on latent technological skills (fitting pegs into different hole
or C = -A shapes as an elementary example), but these are outside the scope of
and B + D = 0, which means B = -D a book on logic.
or D= -B An example of test questions which can be solved by logical reason-
ing is diagrams of a series of different shapes in different sizes and
Try substituting for C and D in equations (iii) and (iv) which then colours arranged in a pattern, but with some shapes missing. The
become:
problem is to find what the missing shapes should be. Since the
(iii) 5A + 2B- A + 3B= -6 which simplifies to: complete pattern is planned (by the designer of the test) on some
logical basis, there must be a logical answer.
4A + 5B = -6
The following is a very elementary test; the question to be solved
(iv) 3A - 2B + A - 7B = 22 which simplifies to: being what are the next three symbols in the sequence:
4A -9B = 22
We now have two simple simultaneous equations to deal with. Sub-
0- 0-0-0-0 -A- 0- 0-L-- ? -1 -? -
tracting (iv) from (iii) gives: Starting point is to identify the individual symbols by a simple code
which is easier to work with than shapes - say 1 for a square, 2 for a
14B= -28 circle and 3 for a triangle. The pattern is then rewritten in this
or B= -2, when D must equal 2
(number) code:
Substitute B= -2 in another equation, say (iii):
1 2 3 1 2 3 1 2 3 ? ? ?
4A- 10= -6
so A = 1, when C must equal - 1 It takes only a little study to see that the pattern is divided into groups
Smarten up your school algebra, if it has got a bit rusty. It can be of three which follow each other in the same manner, i.e. simply repeat
the quickest and simplest method of solving problems or puzzles in themselves:
logic involving numbers.
first group I
second group I third group I fourth group
1 -2 -3 I
1-2-3 I
1 -2 - 3 I
?-?-?
66 Logic in Aptitude Tests
Logic Made Easy 67
Typically the fourth group must be the same as the others, variation that occurs is that the solid symbols appear consecutively,
i.e. fourth group moving one position to the left in each succeeding group. Hence we
would be (logically) justified in completing the third and fourth
1 -2-3 as:
groups
or re -write original symbol form
3rd group I (ii) 2 2 3
0- O -A 4th group I (ii) 2 2 3
These are, therefore, the missing symbols in the original Hence the missing symbols in the original are:
A little too simple and obvious? Then try to find the question.
in the following: missing symbols
last in third group
El A A 0 El A 0 III A A A - - - - - fourth group
Reasoning would select (d) - the only one with the two circles on be anticipated as F = D + 50, G = E + 50, H = F + 50 and
one side of the line. But (a) is also an odd one out on the reasoning J=G+50).
that it is the only one with a vertical straight line. Also (c) is an odd Using the first relationship would give:
one out on the reasoning that it is the only one which is a mathematical
A B C D E F G H J
symbol (percentage). -
Surprisingly - or perhaps not so surprisingly - abstract reasoning (A- 10) (C- 10) (E - 10) (G - 10)
50 = 40 100 = 90 150 =140 ? ? ?
can be extremely puzzling, or even frustrating, to extremely intelligent
people who tend to think 'logically'. The number of extremely clever This gives the missing figures for F, but still leaving values for G, H
children who give anything but the right answer to the following and J unknown.
simple question is remarkable: Using the second relationship gives:
`If you were eating an apple and found half a maggot in it, what A B C D E F G H
would you think?' 2xA - 3xA 4xA - 5xA
Numerical problems are much simpler for logical minds. One just 50 40 100 90 140 -
150 200 250
looks for the pattern of 'formula' involved, in the same way as applying
logic to patterns of symbols. Again the classic problem is to find the This gives values for G and J. Now, knowing G, we can establish
missing or next number(s) in a series of given numbers which are from the first relationship that the missing value for H should be
known to have been generated in some logical way. What, for example G -10 =190. Thus the missing figures are:
are the next numbers which follow logically from: F G H J
90 150 ? 140 200 190 250
50 40 100 ? ? ?
To find the logical answer, write down the numbers as heads of Using the third relationship gives:
columns lettered A, B, C, etc and see what relationship there is A B C D E F G H J
between columns: A+50 B+50 C+50 D+50 E+50 F+50 G+50
50 40 100 90 150 140 200 190 250
A B C D E FGH
90 150 This confirms the solution derived from (i) and (ii). In fact, it
Number 50 40 100
- A-10 2xA A+B 3xA provides all the missing numbers, and so is a complete 'formula' for
Possible solution in itself. To check, see how the given values for B and A can
or or or or
relationships also be shown to be consistent with this formula.
D -A E/3 C-10 A+C
or B = number before A + 50 = 40
or or
A+50 B+50 C+50 Therefore number before A must be -10
A = number before the number before A + 50 = 50
Notice how three repeated relationships have appeared: Therefore the number before the number before A must be 0. In
other words, if the series were extended leftwards from A, it would
(i) a ' - 10' relationship in alternate columns B and D (which read:
could be anticipated as also following in columns F and H).
A
(ii) A 'multiplication' relationship in alternate columns C and E
(which could be anticipated as also following in columns G 0 - 10 50 40 100
check (0+50 (-10+50 (50+50
and J)
(iii) A `+50' relationship in columns C, D and E (which could also =50) =40) =100)
70
Logic Made Easy
The relationship pattern to emerge is that following pairs of numbers table which shows all possible combinations of signals in and out.
are equal (i.e. B = C and D = E, so F =G); and that such pairs are the A NOT logic block can accept only one input and has one output.
square of the preceding pair number. Hence F and G are 162 or 256. It works like a switch which is normally closed. Thus a signal applied
to the input opens the switch, sothere is no output - Fig. 9.1. Information
Signal on
Truth Table
Signal off
A S
A NOT 0 1
Switching equivalent 1 0
Fig. 9.1
shown by
fed to the block is rejected, i.e. NOT acceptable. This is also
the truth table as 'yes' or 'no' combinations. Conventionally 'yes' is
written as 1 and 'no' as 0 to avoid possible confusion with other logic
table.
blocks, e.g. a YES logic block has a different truth
The inverted form of NOT is YES, corresponding to a switch which
the
is normally open. On receipt of a signal the switch closes to pass
signal through as acceptable (YES) - Fig. 9.2.
73
72 Introduction to Block Logic and Truth Tables
Logic Made Easy
Truth Table 51 Truth Table
Signal off A B S A S1 B S2 S
Signal on A A mi NOTH
Truth Table S 0 0 O 1 0 1 1
A YES NAND
A 0 0 0 0 1
II
S
e
1 B NOTI- 1
1 0 1
Switching equivalent 0 0 0 1 1
S2
O 1
1 1 1 1 0 1 0 1 0 0
Exactly the same result is obtained connecting two NOT devices in signals are present at both A and B is satisfied by there being no output.
series, when the output of the first becomes the input to the second - All the other combinations of A and B signals produce an output.
Fig. 9.3. As the truth table shows, the final output has the same Again note that the same (NAND) logic function is also performed by
relationship to the input A as YES (NOT NOT logically is the same an AND block with a NOT in each input line. (In this case calling for
as YES). However, this uses two logic blocks instead of one - or two three blocks instead of one.)
stages of analysis, if you like, instead of one. It is obviously simpler to Finally the OR block and its inverted form the NOR block are
of a
provide a YES function with a single block (single device). Neverthe- shown in Fig. 9.6. An OR block gives an output in the presence
less the inverted forms of the logic blocks are extremely useful. there is no
signal at A or B. A NOR block gives an output only when
Truth Table signal A or B (neither A nor B).
A
S1 A S1 S2 Signal off
S2 0 1 0 Truth Table
,Signal on ABS
1 0 1
O0 0
Fig. 9.3
OR H S 1 0 1
O 1 1
AND and OR blocks (and their inverted forms) again have a single 1 1 1
output but in this case can have two or more inputs - as many inputs Switching equivalent
as are necessary to accommodate the relative inputs in fact. For Fig. 9.6
simplicity, we will consider just two inputs being used.
Let's try a simple example of using logic blocks to solve a problem
Fig. 9.4 then shows an AND logic block with inputs A and B, and
in logic, taking one of the examples used in Chapter 2. (There is a
output at S, together with its truth table. There is an output (S= 1)
reason for this which will be explained later.) The example summary
only when inputs A and B both = 1 (we have used 'S' for output here,
is repeated here to save looking it up.
designating a signal). In this case there is a signal output when there
is an input at A and B. (i) Brown, Green and White are each wearing a coloured hat
(ii) The colours of the hats are brown, green and white
Truth Table
A 8 S (iii) Brown pointed out this fact
Signal off
on
Signal off
0 0 0 (iv) The one wearing the green hat then pointed out that none of
on
cotoolt_00002L__:%'. 1 0 0 the colours of the hats they were wearing was the same as their
B AND H Switching equivalent 0 1 0
names.
1 1 1
Fig. 9.4 Designate the hat colours B for brown, g for green and w for white.
Take Brown, as he spoke first and this must be of some significance in
The inverted form or NAND logic block is shown in Fig. 9.5. Here
the problem. Brown is wearing a brown hat or a green hat or a white
the truth table shows that when there is a signal input at A and at B
hat - so connect b, g and w as inputs to an OR logic block - Fig.
there is no output (S =0). Thus anything that is to be inhibited when
V.
b because they complement each other, when circuit designs for example
B
are worked out in mathematical logic, the final equation can then be
gh NOT
OR g OR B ---INOTH OR B
redrawn in block logic form to show the number and types of logic
devices required.
(a) Equally, if designed in block logic, the final diagram could then be
(b) (b) rendered in the equivalent mathematical logic equation which is then
Fag. 9.7
studied to see if it can be simplified.
The main use of both block logic and mathematical logic, in fact, is
9.7(a). Now from (iv), Brown cannot be wearing a green hat, so in functional circuit design - electrical circuits (ranging from quite
exclude this as a possible input by inserting a NOT in the g input line elementary switching circuits to those for microprocessors and com-
puters), and control circuits in hydraulics and pneumatics. Surpris-
- Fig. 9.7(b).
From (iv) again Brown cannot be wearing a brown hat, so exclude ingly, neither is used as much as it could be in solving `non-functional'
this as a possibility by inserting a NOT in the b input line - Fig. logic problems. Think about it before you automatically use deductive
9.7(c). logic for dealing in premises. If premises can be turned into 'signals'
The answer is now obvious from the final diagram alone - we don't operating on a yes -no basis (true or false), positive solutions can be
even have to bother with constructing a truth table. Brown can only obtained in terms of NOT, OR and AND logic.
be wearing a white hat. Equally, if you prefer to work with diagrams, then construct a truth
The reason for repeating this example is that block logic and mathe- table for the block logic involved. In many cases you can use the
matical logic (which was used for the simpler solution in the original simpler, more easily understood simple logic diagrams described in
example) are very closely related. Block logic, in fact, presents mathe- Chapter 5. The other alternative is Venn diagrams (Chapter 4),
matical logic in diagrammatic form since they cover the same logic although here there is a greater possibility of making mistakes until
functions and have the same truth table. One can be used to check the you become thoroughly familiar with this type of diagram.
other. If a question arises as to the validity of an equation in mathe-
matical logic (Boolean algebra), it can be 'spelt out' in the form of Block Logic and Circuit Design
block logic to see if it makes the proper sense. Block logic is a useful and readily mastered tool for circuit design
There is one important difference, though. The use of block logic, involving switching or control elements. For electrical circuits, each
especially for more complicated problems, can lead to redundant logic function AND, OR, NOT can be performed by a switch (or
blocks being introduced, i.e. more logic blocks than are strictly neces- combination of switches). In hydraulic or pneumatic control circuits,
sary. Also redundancies are not always easy to spot or eliminate. This similar functions can be performed by control valves. Circuits can thus
is not necessarily important using block logic for solutions in deductive be designed with logic blocks, and then finalized by substituting the
logic, but it is if block logic is being used to design control circuits. It appropriate switches or valves for each logic block.
means that the final circuit ends up by using more switching devices Let's start with a very simple example. Suppose it is required to
(logic blocks) than are strictly necessary. If the same problem is solved design a circuit to switch something on and off from two separate
in mathematical logic (Boolean algebra) it is readily possible to positions A and B. Drawn as a solution in block logic this simply
simplify equations and thus eliminate all redundancies. involves an OR function - Fig. 9.8. This is easily translated into two
Both block logic and Boolean algebra deal with logic in terms of separate switches, one at position A and one at position B, as in the
basic logic functions, and in an exact way (as opposed to drawing a second diagram.
conclusion from premises in deductive logic) - the one in a diagram- Suppose, now, it is necessary to be able to switch 'on' and 'off' from
matic way, and the other with mathematical equations. Equally, either station. The first circuit will not work. If switched on at A, for
76 77
Logic Made Easy Introduction to Block Logic and Truth Tables
Component
elements, alternative solutions are often worth looking at. Virtually
Component
A+B on machin sensor C any problem of this type can be solved either in AND logic or OR
--
Machine - Danger
logic; or the inverted forms NAND or NOR logic. In this case only
one type of logic element will be required, together with NOT elements
for essential inversion.
sensor D
Fig. 9.12 shows the same problem as Fig. 9.11 solved in NOR logic.
Danger area Specifically, this involves using two NOR devices and five NOT
devices - seven devices in all, but we have got everything in NOR
Fig. 9.11
it is handling is in position (as detected by the component sensor C),
and there is nobody standing in the danger area. Sensor D generates
a danger signal if anyone is in this area.
The logic required is A OR B AND C AND NOT -D. A and B are
C
connected to an OR block, and the output of this block provided one
input to the AND block. C is also connected to the AND block, giving D
a second input to this block. D is connected to the AND block via a
NOT block and is the third input to this block.
There will be an output from the AND block, switching the machine Fig. 9.12
on, only when there is an input signal at each of the three input lines to
the AND block. If either operator A or B switches the machine on, the
machine will only start if there is also an input signal on the C line logic. Also we can simplify this diagram. Two NOTs in the same line
(component in position) and no signal on the D line. The NOT in this simply change a signal back to what it was originally - they are
line will then invert this '0' signal into a 1', providing the third signal redundant elements which can be eliminated. On this basis we can
input to the AND block. If there is a signal on the D line (someone eliminate four devices from the original and end up with just three
standing in the danger area), the NOT in this line will invert that '1' devices performing the same function, still all in NOR logic - Fig.
into a '0' - i.e. there will be no input from this line into the AND 9.13.
block. Consequently there will be no output from the AND block and Try working out further alternative solutions in AND logic, OR
the machine will not start. In Boolean algebra this is presented quite logic and NAND logic only. (Remember you will have to use NOT
simply as: devices as well.)
(A +B) .C.b= 1
In practice - and with experience - circuit designs of this type are NOR
commonly developed in a specific type of logic. The solution in Fig.
9.11, for instance, uses a mixture of OR and AND logic elements -
NOT NOR
one of each in this case, but in a more complex control circuit there C
may be several of each required.
Depending on the availability of actual control elements, or possibly
looking for the simplest solution using the minimum number of logic Fig. 9.13
V
The main limitation with circuit design by block logic is that the
more complex the problem to be solved the greater the number of CHAPTER 10
logic blocks (devices) required and the more likely redundancies will
be introduced. Also it may not be easy to spot all the redundancies
and elimate them. Using Boolean algebra it is much easier to simplify
the equations. Even this has its limitations when it comes to the design Algorithms
of complex pneumatic and hydraulic circuits where Karnaugh maps An algorithm is a modern way of plotting logic problems (the term
can prove much more effective, but represent a new logic technology
to master. was not invented until the 1960s) which basically presents a chart
accommodating all the information relative to a problem and leads
The subject of circuit design by logic is further dealt with in Chap- result.
ters 11, 12 and 13. one exactly through the paths necessary to arrive at the logical
Basically, in fact, it is simply an extension of block logic, given a more
sophisticated name. It was originally devised as a means of plotting
the strategy of solving problems using computers. It is now widely
used for designing flow -charts, making it possible for people to arrive
with
at solutions on a yes/no basis (like the working of a computer),
the advantage that it can be completely non-mathematical. The scope
in this respect is considerable. Algorithms can be applied equally well
in general problem solving, commerce, industry, ergonomics, medi-
cine, finance, even political and military strategy. There are, equally,
mathematical algorithms. All have one thing in common. They are
directed to finding solutions - not teaching or learning. Algorithms do
not help understand a problem like a computer programme; therefore,
the solutions they give are only as good as the person designing the
complete algorithm.
Non -mathematical algorithms on individual facts or statements
relevant to the subject rendered as questions, which become in effect
`gates' in the flow path. Each 'gate' provides two exits - one for a 'yes'
answer and one for a 'no' answer, this procedure being followed
which is then the
through the algorithm until the final answer part (s),
logical solution to the answers made at the various question parts.
Rather than a single answer, too, an algorithm commonly contains a
number of different answers since it is designed to cover all contingen-
will make
cies, i.e. a 'yes' or a 'no' at all of the gates. A simple example
this clear:
A club has the following rules regarding subscriptions:
under
(i) Entrance fee is £50 for adult members; £20 for persons
20 years on January 1st.
82 83
Logic Made Easy Algorithms
(ii) Annual subscription rates payable on September 1st each year case. This can save a lot of time and effort compared with working
are: out the answer each time for individual cases.
Full voting member The main problem to arise in designing algorithms - apart from
£50 ensuring that all the factors are included and presented on a yes/no
Senior (non voting) member £35 basis - is one of arrangement. Ideally - but not necessarily - all the
Junior (non voting) member £20 `yes' paths should come out the same way, and all the `no' paths in the
An algorithm drawn up on this basis would look like this: same (but different) way. Thus in the example drawn, a 'yes' auto-
Payable
matically reads straight across to the right. A `no' reads downwards
START New YES Over YES Voting YES and then across on a different path.
HERE £100
member 20? member The other difficulty, particularly when a large number of different
NO NO NO `boxes' have to be used is to avoid crossing paths, as this can be
£85 misleading. Also the final 'answering' boxes should be made distinct
from the others (e.g. with a bolder outline).
£ Drawing up the basis of an algorithm is quite a simple exercise in
Over YES
block logic once you have got the facts broken down into simple
Voting YES
20? member £ questions. Planning and drawing up the final algorithm, however, can
be something of an art to get it into its best presentable form. It may
NO NO
£35 even be necessary if the algorithm tends to become excessively com-
plicated to stop at certain answer part(s) which, instead Of being
Ic2oI answers, are new starting points for a separate algorithm.
This chart plots all the possibilities with logical paths through to
Algorithms and Truth Tables
the amount payable. It can provide immediate solutions relative to any
An algorithm can also be presented in the form of a truth table, from
applicant, new or existing member, whether over or under 20, and which relevant solutions can be drawn. To demonstrate this we will
whether voting or not. In the same way it could be extended to cover
other club subscription rules. Try re -drawing it to take into account
use the same example as before, dealing with club subscriptions,
as well: writing out each question as a line and covering all possible combi-
nations of answers in the following columns of the table:
(iii) Members joining after March 31st in any year pay only half
2 3 4 5 6 7 8
that year's subscription. 1
The truth table is more explicit in that it analyses all the possible
combinations of the variable factors (answers to the questions). There CHAPTER 11
are three questions, each with two possible answers (`yes' or `no'),
which in fact gives us eight possible combinations, as given by the eight
columns in the truth table. Introduction to Boolean Algebra
In this particular case the combination in columns 5 and 7 cannot in a mathematical
apply by the club rules since the person is under 20 and thus a junior The simplest approach to solving logic problems
which is certainly not as frightening
member, and a junior member is a non -voting member. With a way is the use of Boolean algebra, in many ways, but certainly
different set of questions all possible combinations may be relevant, in as it sounds. It is like ordinary algebra
much simpler because it is concerned with only two possible states of
which case there would be eight separate solutions, not six as in this false, yes or
example. Plotting a truth table, in fact, is a good cross-check on the each individual subject. These can be evaluated as true or
premises); or on or off, go or
completeness of the algorithm. no, in the case of general subjects (e.g. is 'I'
stop, in the case of signals. (The usual interpretation with signals
for 'on' and '0' for off'). because
At first it may look more complicated than ordinary algebra
for AND; + for
the mathematical signs are used in a different sense,
and A + B means A or
OR. Thus A B means A and B (not A times B);
B (not A plus B). inversion
The only other symbol used is a -over a letter, meaning an
means not B, and so on.
or logic NOT. Thus A means not A, in terms of
It then becomes obvious that Boolean algebra works NAND and
NOT, AND and OR logic, or the inverted forms YES,
NOR. is to think
By far the simplest way of understanding Boolean algebra
for logic
in terms of switching circuits applied to the basic equations
functions, as in Chapter 9.
the possibility
NOT then becomes a normally closed on -off switch within
of either a negated or positive output. The two Boolean algebraic
forms of NOT are thus:
A S
1 0
A=S
consistent with the truth table
0 1
A=S
The two Boolean
YES then becomes a normally open on -off switch.
algebraic forms of YES are thus: S A
1 1
A=S
consistent with the truth table
0 0
87
86 Logic Made Easy Iritroduction to Boolean Algebra
AND is the equivalent of two normally open switches in series. Here the another form of OR known as an EXCLUSIVE
There is, however, when
presence of an input signal at either A or B closes its respective switch OR. This excludes the possibility of an output being generated
to pass on the signal to the output, but there is no output until both at both inputs. That is, the production of an output
signals are present
switches are closed (signals A and B are present): is exclusive to either A or B input signals being present.
NOR again is consistent with parallel switches giving an output
A B=S consistent with the truth table A B S when there is not a signal input at A or B. This
(both switches closed) will both
0 0 0 time either signal A or signal B (or both together) open
1 0 0 switches, giving no output.
0 1 0 A+B=S consistent with the truth table A B S
0 0 1
1 1 1
1 0 0
NAND is not quite so easy to describe in simple switching terms. 0 1 0
Logically it should be two switches in series operating in the inverted
1 1 0
mode to AND. In fact it works in the manner of one normally closed
switch which needs signal inputs at both A and B to open it. With no with the exception of NOT and YES which can only
Note here that,
input at either A or B the switch remains closed, providing a through all of the logic functions can accom-
have one (input) designation, which
path to the output and an output signal (consider this signal as coming A,B,C,D, etc, as necessary
modate any number of input signals
from a separate source). With an input at A the switch still remains of Boolean algebra. These merely extend
can be expressed in terms here is the
closed, so there is still an output. Similarly with an input at B only. the size of the truth table in the same truth sense. For example,
With inputs at both A and B the switch is opened, breaking the circuit accommodate four inputs A, B, C, D.
AND truth table extended to
and changing the output to 0.
A B= S
A B
0
CDS
0 0 0
consistent with the truth table A B S 0
0 0 1
0 0 0 1 0
1 0 1
0 0 1 0 0
0 1 1
0 0 1 1 0
1 1 0 0 1 0 0 0
OR is straightforward again - two normally open switches in parallel. 0 1 0 1 0
There is an output when either switch A or switch B is closed (by signal 0 0
0 1 1
1 0 0 0 0
A+ B= S consistent with the truth table A B S
1 0 0 1 0
0 0 0
1 0 1 0 0
1 0 1
1 0 1 1 0
0 1 1
1 1 0 0 0
1 1 1
89
Introduction to Boolean Algebra
88 Logic Made Easy
be
A B CDS We still have the output inverted (5), which may or may not
convenient. If not, we can invert the whole expression again:
1 1 0 1 0
1 1 1 0 0 when A + B= S becomes A + B = S
1 I 1 1 1
Thus we started with not -A and not -B = S (or NOR in AND logic)
and
end up with not -A or B = S (or NOR in OR logic, which was what we
This illustrates the basic rule that for N inputs there are 2" possible
states or combinations, represented by N lines in a truth table. Thus were after). When we
in this case there are sixteen lines (different states) possible with the At this point there is something very important to note.
switching equivalent of sixteen on - off switches connected in series. first inverted the equation we changed the sign from (AND) to +
which demands this,
There is an output (S = 1) only when all sixteen switches are closed (OR), according to the rule of Boolean algebra
(i.e. A= 1, B= 1, C= 1 and D= 1). The truth table represented this i.e. theorem (xii). When we did the last inversion, we did not change
be
more compactly than drawing out all the individual switches con- the sign. This is because we inverted A + B as a whole, which can
considered as putting it in brackets (A +B) and treating it as a single
nected together. theorems
term. Again this is consistent with theorem (xii). (The
Inverting the Function governing Boolean algebra are summarized together on pages 94-5
One thing may - or may not - have become apparent from the logic for convenience of reference.)
equations explained above: inverting a function changes the nature of
the function. Thus AND which is obviously an AND function (A B or Ultra -Simplified Symbolic Logic
A and B), becomes an OR function when inverted to NAND (not A or Now let us look at an ultra -simple symbolic method
-
of handling
borrowed from
not B). This is a very important rule in manipulating Boolean equa- deductive logic, in which we use just the inversion sign
tions, where it is often convenient, or necessary, to invert functions to letter symbols. It is not Boolean alge-
Boolean algebra, together with but it
obtain an optimum solution (eliminate redundancies, for example). bra, and indeed the validity of the method is questionable -
Specifically, too, it enables all expressions in an equation to be in the works. Take the following as an example:
same type of logic.
Suppose we want to work entirely in OR logic. This means that all Premises: all dogs are animals
the terms used in an equation need to be expressed in the form A + B, no animals can fly
i.e. the + (OR) sign is used throughout the equation. Conclusion, by deductive logic: no dogs can fly.
Starting with the NOR function, A f3 = S , this is in AND logic (as F
shown by the sign). By the rule mentioned above, inverting it will Symbolic technique: designate all dogs D, animals A, and fly
change it into OR logic: first premise becomes D=A
method to provide a second solution to the 'coloured hats' problem in (iv) Since I has no other value than 1 (positive)
Chapter 2. Let's see how this same solution can be worked out cor- A+ 1 = 1 (OR function)
rectly in Boolean algebra, using the same notation as before - B for (v) A A = A (AND function)
Brown and b, g and w for the brown, green and white hats respectively. (vi) A + A = A (OR function)
The start is exactly the same as before: (vii) A A=o
(viii) A+A=1
B=b+g+w (ix) A=A (double inversion returns the function to its ori-
also because the man who spoke after Brown was wearing a green hat, ginal state)
Brown cannot be wearing a green hat. Nor can Brown be wearing a (x) The order of individual functions is immaterial
hat the same colour as his name, so AB=BA
A+B=B+A
B= g 6 (xi) The order of grouping of functions is immaterial
A. (BC) = (AB)C
Last time we jumped straight to the answer by assuming that g and 6
cancelled out g and b in the first equation. This is not justifiable in
A+(B+C)=(A+B)+C
(xii) Inversion of all signals changes the sign (de Morgan's theo-
Boolean algebra since there are not two separate equations involved,
rem)
only one combining the two propositions, viz: ABC=A+$+C
B=b+g+wandkS or A+B+C=A13C
(xiii) For simplification of equations . (AND) is treated as a multi-
B= (b +g+ w) gb which expands to
B = b 6.g + ggb +wg6 and then groups in OR logic as plication sign and + (OR) as an addition sign, as in ordinary
B=(bSg)+(gg6)+ (wgG) algebra
From theorem (i) b 6=o A(B+C)=AB+AC
gg =0 (xiv) Expansion of equations treated as in ordinary algebra
thus B= (0 g) + (0 b) + w g b (A+B)(C+D)=AC+AD+BC+BD
From theorem (i) 0 g=o (xv) Redundancies can be eliminated, e.g.
0 6=o A+ (AB)=A
Hence B=wgb A+ (AB)=A+B
=white, NOT green, NOT brown. This last theorem may not be obvious, but can be proved by its truth
table:
Exactly the same answer as the short cut solution gave!
A B S
0 0 0
Boolean Algebra Theorems i 0 1
A.
Introduction to Boolean Algebra 93
92 Logic Made Easy
Repeating this table but this time using only minterms and adding
Minterms and Maxterms
Boolean algebra and truth tables are closely related, as we have the output:
seen. One can always be expressed in terms of the other. However the A B C minterm output (S)
logic involved may be a mixture of AND, OR and inversions of AND 0 0 o A$e
and OR. Assuming that we start with a truth table, for a systematic 1 0 0 ABC 1
o 0 o ABe A -143-1-e C, A B C, A
Here it is seen that there is an output ifany ofA C
1 0 0 A.B.e A+11+e and A .B.0 is 1. The corresponding Boolean equation is then:
o 1 0 ABL A+B+C S=A11C+ABe+AclC+ABC
1 1 0 A BC A+B+O
A
0 0 1 A$C A+ii+c NOT AND
B
1 0 1 A tC A +11+c
NOT
o 1 1 ABC A+ B + C
1 1 1 ABC A+B+C
This is a particularly useful technique for the design of combina- B AND
tional circuits (e.g. electrical circuits or hydraulic or pneumatic con- NOT
trol circuits). If the relationship (i.e. significance of the 'switching' OR
points A, B and C) are stated in minterms, the circuit can be designed
using digital devices having an AND function, plus NOT for inver- A NOT
sions. If the relationship is in maxterms, then the circuit can be B AND
-i NOT
designed using OR devices, plus NOT for inversions.
B
N
Everything in OR Logic
Fig. 11.3 In this case every piece of logic needs to be expressed in + form.
w
96 Logic Made Easy More Logic Equations 97
A
98 99
Logic Made Easy More Logic Equations
expressed in terms of block logic or pure equations - or the re- In terms of logic we have the following requirement (or logic equa-
quirements equally well written out in the form of a truth table (which, tion):
of course, will be the same for the block logic and algebraic solutions). A OR B AND C NAND D AND NOT E = S (ignition signalled)
Provided you are happy working with Boolean algebra, solution by
equation is usually simpler and quicker, and redundancies can be which in symbols is:
eliminated in the process. A+BCDE=S
All combinational control circuits are similar in that they provide
This is in mixed logic (OR and AND logic, together with NOT). A
an 'on' signal when, and only when, a particular combination of other
control circuit, based on logic elements, would be as in Fig. 12.2.
signals are present. Thus the example given here is basically the same
sort of problem as solved by block logic in Chapter 9, but a little more A A+13
complicated in involving a combination of five different signals. Cir- OR
B
cuit design will be worked out in Boolean algebra on a logic basis, but A+BCDE = S
C AND
also illustrated by block logic diagrams as 'pictorial proof' of what the
equations mean.
The control problem, shown in Fig. 12.1, is this. A space rocket site
incorporates the following features. At the control centre, either tech-
Ej
D
NOT
Fig. 12.2
nician A or B can give the final signal to start ignition. The rocket is
fuelled up, ready to go, but it must be impossible for A or B to launch It could equally well be rendered in terms of AND devices only
the rocket until all the monitoring signals are in a 'go' state. These (AND logic), together with NOT.
monitoring signals are derived as follows. Starting with the original equation:
A+BCDE=S
invert once
Command centre Emergency sensor E
A.A+C+15+i.5
Display
E
signal D invert again to get into AND form and also give a positive output:
IA
2 :
but with obvious redundancies (NOT devices following each other for
double inversions and effectively cancelling each other out). NOR H
This is also obvious from the equation. Double inversions cancel A+B+6+5+E = S
NOT NOR
each other out, so the simplest form of the equation in AND logic
becomes (by remaining double inversions) D NOTI
A11CDE=S E
The requirements for this circuit are shown in Fig. 12.4. It has saved Fig. 12.5
six (NOT) devices.
Incidentally a truth table written out for this particular requirement
would run to 32 lines, only three of which would give a 'go' output
NOT H. (S=1)
A
B NOT I...,
AND H NOT AB CDES
line 1 ... 0 0 0 0 0 0
C AND 7aEcoE = S
1 0 0 0 0 0
NOT
Fig. 12.4
Certainly it can. Suppose we try NOR logic. This means reading the
terms of the equation in the form +
Starting with the original equation:
A +BCDE=S
invert, treating A + B as a whole to retain the + form: 0 1 1 1 0 1
A+B+C+1)+E=S
invert again as a whole to retain the + form and get a positive output:
A+B+e+C)+E=S=S
Now remove all the redundancies (double inversions) - in this case
1 1 1 1 0 1
equations which can prove tedious to work with, and need careful
checking for possible errors, especially when simplifying or trying to
convert into a different form of logic. Other types of logic are generally CHAPTER 13
to be preferred in such cases.
,4 A B\A
0 1
If3 AB AB 0 AB AB
B 413 AB 1 AB AB
Fig. 13.1
Ail
105
104 Logic Made Easy Karnaugh Maps and Logic Circuits
A
00 01 I 11 10
A A
r if
- 1
0 1
110 1
i
0 0 r1, 1 NI
C
r 1 11 0 0
;
r 1
:1 1i 0 0
,
0 ) 0 C
0 (1 11 0 1 1
B B B
Fig 13.6 Fig. 13.7
of
relative to the various combinations. (With practice this could be done A basic problem in conforming to these rules is that the effect
13.7. Here
without going through the intermediate stage of Fig. 13.5.) `running off the edge' of the map is overlooked, e.g. see Fig.
smaller
Simplification or minimizing then consists of grouping together ad- there is already one large group of four squares, and two
bottom. In fact these two
jacent squares which both contain 1. Grouped squares can then be groups each of two squares at the top and
represented by a single AND term instead of two. There are two such smaller groups form one larger group (think of the map being rolled
groups in Fig. 13.6, shown enclosed by dashed lines. In the horizontal up into a horizontal cylinder). There are, in fact just two groups not
group, B is the variable that changes and so instead ofA BC+ASC three, needing just two AND terms, not three.
which this group covers, this group can be represented simply by A C Failure to spot how small groups may form a larger group does not
(i.e. A B C + A ft C in the original equation becomes A C (B+11) matter greatly. It does not upset the validity of the treatment. It
as
which = A C). simply means that the final answer derived is not as fully simplified
Similarly in the second (vertical) group, A B C + AB C, C is the possible. Translated into hardware in a switching circuit, for example,
variable that changes, so these two squares can be represented by a the circuit would work just as well but include more switching or logic
single end term A.B. There are no other groups and so the original components than are strictly necessary.
equation:
Sequential Circuits
S=A13C+ABC+ASC+ABC So far we have only dealt with combinational circuits. Other control
reduces to circuits may require sequential logic, i.e. operations or movements
the
S= AC +AB+ ABC following in a particular sequence. Even more complicated is
compound circuit which incorporates both combinational and sequen-
Basic rules for minimizing are: tial requirements.
All the squares containing a 1 must be included in at least one Karnaugh maps can again be used for the design of sequential or
(i) where sequence is involved a further
group (if not possible, there is no possibility of minimization). compound logic circuits, only
the right timing
(ii) Form the largest possible groups. type of logic is required - MEMORY for providing
of the sequence. One memory will be required at each sequence point,
(iii) Produce the smallest possible number of groups (consistent with
when each memory will require its own
Karnaugh map. In a com-
(i) and (ii) above.
109
Karnaugh Maps and Logic Circuits
108 Logic Made Easy
B and not A = S
pound circuit, a further Karnaugh map (or maps) would be necessary or 13- A=S
for the combinational requirements. BA =0
Dealing with a typical sequential logic circuit, the procedure would the signal path
be as follows: In other words, when a signal is present at A it inhibits
of B. two
MEMORY is readily performed by a flip-flop device accepting
(i) Write down a word statement of the sequence. A will give an output
(ii) Draw a time diagram designating the complete sequence. signal inputs A and B. A signal applied when
at input
signal A is removed. A
state S1 and maintain this state even
(iii) Prepare a separate signal flow diagram and on this plot the of the memory to S2, which
signal input at B will then change the state
signal flow path. until tripped back
it will continue to hold when signal B is removed,
(iv) Prepare a Karnaugh map for every memory, and for every A. In other words,
to state S1 when a further signal is applied to which
auxiliary memory appearing in the signal flow diagram. MEMORY is a logic device which 'remembers' the last signal,
(v) Extend the presence of memory designations by infilling and
is an essential feature in sequential logic. the available
forming loops on the signal flow diagram.
As far as logic circuit components are concerned (i.e.
(vi) Finally, minimize the memory set and reset equations. circuit), choice
`hardware' for turning a circuit design into a working
on the suitability of such 'working'
of type of logic used depends This is no real
No wonder this form of logic is largely incomprehensible to all but elements to perform the various functions necessary.
specialists! solid state devices, but in the case
problem in electronic circuits using elements involved
Even Karnaugh maps have their distinct limitations when it comes of pneumatic and hydraulic circuits, the working
to the design of the more complex logic control circuit where, in fact, of individual
are normally miniaturized valves. If a multiplicityfavours using NOR or
only design by logic can be relied upon to provide optimal solutions. elements (valves) is to be avoided, the choice
For that reason many major producers of logic control devices them- simpler valves.
NAND logic, as these functions can be performed by
selves (hardware) have developed their own system methods to make -functional devices based
Other systems may, however, employ multi
logic designs easier to understand and minimize circuit design time. on OR, AND, NOT, YES and MEMORY.
This will then relate to a specific system which, in turn, is based on a
particular choice of logic elements providing all the logic functions
necessary.
For a full coverage of all the types of logic required in complex
circuits design the functions required are:
That does not mean that all these separate functional elements will be
required. Solutions can be worked all in AND logic, or all in OR logic
(or the inverted forms NAND and NOR). The only functions which
remain necessarily common with any type of logic chosen are NOT,
INHIBIT and MEMORY. NOT we already know about. INHIBI-
TION is a sort of variation on NOT and AND, expressed as:
Help Us Help You
Other Bestsellers From TAB So that we can better provide you with the practical infor-
mation you need, please take a moment to complete and
0 SCIENCE FAIR: Developing 0 PARTICLES IN NATURE: return this card.
a Successful and Fun Project- THE CHRONOLOGICAL DIS-
Maxine Haren Iritz, Photographs COVERY OF THE NEW 1. I am interested in books on the following subjects:
by A. Frank Iritz PHYSICS-John H. Mauldin CI architecture & design electronics
Here's all the step-by-step guid- If you're interested in physics, O automotive D engineering
ance parents and teachers need to science, astronomy, or natural his- aviation 0 hobbies & crafts
help students complete prize -quality tory, you will find this presentation El business & finance 0 how-to, do-it-yourself
science fair projects! This book pro- of the particle view of nature fas- El computer, mini & mainframe military history
vides easy -to -follow advice on every cinating, informative, and entertain- O computer, micros 0 nautical
step of science fair project prepara- ing. John Mauldin has done what o other
tion from choosing a topic and defin- few other science writers have been
ing the problem to settling up and able to accomplish ... he's reduced 2. I own/use a computer:
conducting the experiment, drawing the complex concepts of particle Apple/Macintosh
conclusions, and setting up the fair physics to understandable terms fl Commodore
display. 96 pp., 83 illus., 8 1/2" x and ideas. This enlightening guide CI IBM
11". makes particle physics seem less El Other
Paper $9.95 Hard $16.95 abstract-it shows significant
Book No. 2936 spinoffs that have results from re- 3. This card came from TAB book (no. or title):
search done, and gives a glimpse of
future research that promises to be
of practical value to everyone. 304
pp., 169 illus. 16 Full -Color Pages,
4. I purchase books from/by:
0 general bookstores 0 telephone
14 Pages of Black & White Photos.
technical bookstores 0 electronic mail
7" x 10". 0 college bookstores
Hard $23.95 E hobby stores
Paper $16.95 E mail
Book No. 2616 0 art materials stores
Comments
Send $1 for the new TAB Catalog describing over 1300 titles currently in print and receive
a coupon worth S1 off on your next purchase from TAB.
to credit approval Orders outside U S must
(In PA, NY, and ME add applicable sales tax Orders subject
be prepaid with international money orders in U.S dollars.)
'Prices subject to change without notice.
ON IIMM I= MINI NMI MI INN NIB Name
To purchase these or any other books from TAB, visit your local bookstore, Address
return this coupon, or call toll -free 1-800-822-8158 (In PA and AK call
1-717-794-2191). City
Hard or Title Quantity Price
Product No
Payer
State/Zip
Company
Address Mail coupon to
TAB BOOKS Inc.
City Blue Ridge Summit
State Zip PA 17294-0840 BC
Logic Made Easy
R. H. Warring
today's modern technology ... or you want insight into the "formal"
logic practiced for centuries by philosophers, here's a guide that
makes it easy to understand and apply.
0885 8 95
035642 891062: C
4 04
.41PRING
LIST PRICE
$8.95
TAB EUERYOAY PRICE
$8
r4orCE
TAB BOOKIfq1u.gs 111111 11
uu
618538
Blue Ridge Summit, PA 17294-0850