Home page for accesible maths 2 Logic

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

2.3 The logic model

We now turn to our logic model. Its structure is exactly similar to that of the parity model, although some of the technical terms are different; we list the correspondence in the following table.

parity model logic model
universe universe
variable statement variable
parity value truth value
parity switcher negation
parity table truth table
operation connective
expression compound statement
equivalence of expressions (logical) equivalence of statements

We shall now explain the features of the logic model one at a time.

Universe. We shall take as the universe for this model the set of all allowable statements. Here, a statement is called allowable if it is definitely either true or false. For example, ‘‘32+42=523^{2}+4^{2}=5^{2}’’ and ‘‘every person in this room is female’’ are allowable statements. On the other hand, we are not concerned with

  • questions (such as ‘‘is Lancaster better than York?’’);

  • commands (such as ‘‘switch off that mobile ’phone!’’);

  • expressions of emotion (such as ‘‘I feel happy’’);

  • matters of opinion (such as ‘‘Hitchcock is the greatest film director’’).

Note that for a statement to be allowable, we do not need to know whether it is true or false; for example, the statement ‘‘the seventeenth oldest student in this room is male’’ is certainly either true or false, but no-one knows which. For convenience, we shall simply write statement for allowable statement from now on.

Statement variables. We shall use letters (usually lower case) as the basic variables to represent statements from our universe. For example, we might write pp for the statement ‘‘32+42=523^{2}+4^{2}=5^{2}’’, or qq for the statement ‘‘every person in this room is female’’.

Truth values. There are two truth values TT (for ‘‘true’’) and FF (for ‘‘false’’) which any statement variable can take, depending on which element of the universe it represents. For example, if pp represents the statement ‘‘32+42=523^{2}+4^{2}=5^{2}’’, then its truth value is TT, and if qq represents the statement ‘‘every person in this room is female’’, then its truth value is F.F.

The negation. Given a statement variable pp, we write ¬p\neg p (read ‘‘not pp’’) for the negation of pp. For example, if pp represents the statement ‘‘I cycled to university today’’, then ¬p\neg p represents the statement ‘‘I did not cycle to university today’’. (We do not enter into a discussion of whether I walked, ran, drove a car or took the bus.)

Truth tables. These are used to list the truth values of a given statement according to the truth values taken by the basic statement variables which it contains. For example, the truth table of ¬p\neg p is as follows.

pp ¬p\neg p
TT F
FF T

Logically equivalent statements. We say that two statements are logically equivalent (or simply equivalent) if they have the same truth table. For example, any statement pp is logically equivalent to its double negation ¬(¬p)\neg(\neg p) because the first and third column of the following truth table are the same.

pp ¬p\neg p ¬(¬p)\neg(\neg p)
TT F T
FF T F

Note that this agrees with the use of double negations in everyday language. For instance, the statement ‘‘I did not miss yesterday’s lecture’’ means (essentially) the same as ‘‘I attended yesterday’s lecture’’. To transform the former statement into the latter, observe that in this context ‘‘miss’’ means (essentially) the same as ‘‘not attend’’, and therefore we may rewrite the former statement as

‘‘I did not not attend yesterday’s lecture’’.

We now get the latter statement by cancelling the double negation.

Connectives and compound statements. Out of the basic statement variables p, q,p,\,q, r, r,\,\ldots (and their negations ¬p, ¬q, ¬r, \neg p,\,\neg q,\,\neg r,\,\ldots), we construct more complicated statements, or compound statements, by using connectives. In doing so we assume that the truth value of any compound statement is determined entirely by the truth values of the basic statement variables out of which it is constructed. We shall use five connectives, as given in the following table wherein the first and third columns are the most important.

symbol name meaning alternative symbols
&\& conjunction and , , ×, \wedge,\,\cap,\,\times,\,\cdot
or disjunction or , , +\vee,\,\cup,\,+
\Rightarrow implication implies, if … then \rightarrow
\Leftarrow reverse implication is implied by, only if \leftarrow
\Leftrightarrow bi-implication if and only if \leftrightarrow, iff

The alternative symbols here are listed as they are widely used, but they are not recommended as they can cause confusion. Some of the connectives obey rules similar to those satisfied by algebraic operations.

We shall now consider each in turn and give the corresponding truth table.

  1. &\&:

    If pp represents the statement ‘‘grass is green’’, while qq represents ‘‘pigs can fly’’, then ‘‘p&qp\ \&\ q’’ represents the statement ‘‘grass is green and pigs can fly’’. For such a compound statement to be true, we need both statements out of which it is built to be true. In other words the truth value of ‘‘p&qp\ \&\ q’’ is TT if the truth values of both pp and qq are TT, and is FF otherwise. This is summarized in the following truth table.

    pp qq p&qp\ \&\ q
    TT TT T
    TT FF F
    FF TT F
    FF FF F
  2. or:

    If, as before, pp represents the statement ‘‘grass is green’’, while qq represents ‘‘pigs can fly’’, then ‘‘pp or qq’’ represents the statement ‘‘grass is green or pigs can fly’’.

    Here we run into a linguistic problem, since in English there are two possible meanings of the word ‘‘or’’. If someone says ‘‘I will see you today or tomorrow’’, they might mean that seeing you both today and tomorrow is possible. On the other hand, if someone says ‘‘We can stay at home tonight or go to the cinema’’, they cannot mean that both are possible. For our model to be unambiguous, we must be clear what we mean by ‘‘pp or qq’’; we choose the inclusive sense (‘‘one or other or both’’) rather than the exclusive sense (‘‘one or other, but not both’’), because the inclusive sense is the one more commonly used in mathematics. Thus the truth table is as follows.

    pp qq pp or qq
    TT TT T
    TT FF T
    FF TT T
    FF FF F
  3. \Rightarrow:

    Again, suppose that pp represents the statement ‘‘grass is green’’, while qq represents ‘‘pigs can fly’’. Then ‘‘pqp\Rightarrow q’’ represents the statement ‘‘if grass is green, then pigs can fly’’ (or in other words ‘‘grass being green implies that pigs can fly’’). (In colloquial English, ‘‘then’’ is often omitted, whereas in mathematics, ‘‘if’’ is normally followed by ‘‘then’’.)

    Here we face a more serious problem than above: in colloquial English, such constructions tend only to be used when there is some causal link between the two simple statements, as in ‘‘if you study hard, then you will pass this course’’; the first statement (‘‘you study hard’’) causes or produces the second (‘‘you will pass this course’’). In our model, however, we need to be able to form ‘‘pqp\Rightarrow q’’ regardless of whether the statements represented by pp and qq are linked in this way.

    To get round this problem, we ignore the question of causality, and decide the truth or falsity of ‘‘pqp\Rightarrow q’’ entirely on the basis of the truth or falsity of pp and qq. This can be decided by considering when ‘‘pqp\Rightarrow q’’ is false; this occurs only if pp is true, but qq is nevertheless false. (If you don’t study hard, then the above statement cannot be said to be false whether you pass the course or not.) Thus the truth table is as follows.

    pp qq pqp\Rightarrow q
    TT TT T
    TT FF F
    FF TT T
    FF FF T

    This has some slightly strange consequences; for example, the statement ‘‘if grass is pink, then 1+1=31+1=3’’ is true. Starting from a silly statement, we can deduce silly or sensible things. Consider also the two statements:

    ‘‘if 1+1=31+1=3, then 2+2=62+2=6’’  and  ‘‘if 1+1=31+1=3, then 0=00=0’’;\textsl{``if $1+1=3$, then $2+2=6$''}\qquad\text{and}\qquad\textsl{``if $1+1=3% $, then $0=0$'';}

    both are true because the condition (‘‘1+1=31+1=3’’) is false.

    However, in all cases where there is a genuine causal link between the two halves of the compound statement, the truth value assigned by the model is what we would expect. What we have defined is sometimes called material implication; it extends genuine, causal implication to cover all cases of the form pqp\Rightarrow q. Untrue statements imply true statements and false statements, but a true statement cannot imply a false statement.

    Finally, note that we use ‘‘implies’’ differently from ‘‘hence’’; ‘‘hence’’ means ‘‘and so’’ or ‘‘consequently’’, and acts as a conjunction between two true statements. To exemplify how this differs from our use of ‘‘implies’’, compare the two statements:

    • r:r\colon

      ‘‘I have drunk a bottle of vodka implies that I shall fall over’’;

    • t:t\colon

      ‘‘I have drunk a bottle of vodka, hence I shall fall over’’.

    Here rr is true, whereas tt is false. Indeed, we can express rr as the conditional statement ‘‘if I had drunk a bottle of vodka, then I would fall over’’, which is true; the condition, however, is not satisfied — I have not drunk a bottle of vodka (and this is why tt is false).

  4. \Leftarrow:

    This is now easy; ‘‘pqp\Leftarrow q’’ means the same as ‘‘qpq\Rightarrow p’’. Thus the truth table for ‘‘pqp\Leftarrow q’’ is as follows.

    pp qq pqp\Leftarrow q
    TT TT T
    TT FF T
    FF TT F
    FF FF T

    We call the compound statement ‘‘qpq\Rightarrow p’’ the converse of ‘‘pqp\Rightarrow q’’.

    Important note: these two compound statements are not equivalent. To see this, consider for instance the following two basic statements:

    • p:p\colon

      ‘‘I have drunk a bottle of vodka’’;

    • q:q\colon

      ‘‘I fall over’’.

    As observed above, the statement ‘‘pqp\Rightarrow q’’ is true. (If I had drunk a bottle of vodka, then I would fall over.) However, the converse statement ‘‘qpq\Rightarrow p’’ is false; for instance, I might fall over because I stumbled over the computer cable, so qq could well be true without pp being true.

  5. \Leftrightarrow:

    Finally we define ‘‘pqp\Leftrightarrow q’’ (read ‘‘pp if and only if qq’’) to mean ‘‘(pq)&(qp)(p\Rightarrow q)\ \&\ (q\Rightarrow p)’’. From the above, we see that the truth table is as follows.

    pp qq pqp\Leftrightarrow q
    TT TT T
    TT FF F
    FF TT F
    FF FF T

As in the parity model, we may go on to construct truth tables for more complicated compound statements by using the tables already given and building up new ones column by column. As before, if only two basic statement variables are involved, then the truth table needs 22=42^{2}=4 rows, whereas if there are three basic statement variables, then the truth table must have 23=82^{3}=8 rows to allow for all possible combinations of the truth values.

In general, we can introduce basic statement variables p, q, r, s, t, p,\,q,\,r,\,s,\,t,\,\ldots and build up compound statements from them. The corresponding truth tables need to allow all possible combinations of TT and FF for these statement variables, and therefore:

if a compound statement involves nn basic statement variables,

then there should be 2n2^{n} rows in the corresponding truth table.

We shall now give an example of how to construct the truth table for a compound statement built from basic statement variables and connectives.

Example 2.3.1

The truth table of the compound statement ‘‘(p&(¬q))\bigl(p\ \&\ (\neg q)\bigr) or (q&r)(q\ \&\ r)’’ is:

pp qq rr ¬q\neg q p&(¬q)p\ \&\ (\neg q) q&rq\ \&\ r (p&(¬q))\bigl(p\ \&\ (\neg q)\bigr) or (q&r)(q\ \&\ r)
TT TT TT F F T T
TT TT FF F F F F
TT FF TT T T F T
TT FF FF T T F T
FF TT TT F F T T
FF TT FF F F F F
FF FF TT T F F F
FF FF FF T F F F

Once we know how to construct truth tables, we can use them to verify that certain compound statements are logically equivalent, as we shall do in the following examples. Some of these logical equivalences will be useful later in the course.

Example 2.3.2

Show that the two compound statements ‘‘¬(porq)\neg(p\ \text{or}\ q)’’ and ‘‘(¬p)&(¬q)(\neg p)\ \&\ (\neg q)’’ are logically equivalent.

Remark 2.3.3

The conclusion of Example 2.3.2 is in accordance with everyday language. For instance, consider the two basic statements

  • p:p:

    ‘‘I walked to work’’;

  • q:q:

    ‘‘I cycled to work’’.

Then ‘‘¬(porq)\neg(p\ \text{or}\ q)’’ represents the statement

‘‘I did not walk or cycle to work’’,

while ‘‘(¬p)&(¬q)(\neg p)\ \&\ (\neg q)’’ represents

‘‘I did not walk to work and I did not cycle to work’’.

These two sentences clearly have the same meaning.

Solution. We construct the truth tables.

pp qq pp or qq ¬(porq)\neg(p\ \text{or}\ q) ¬p\neg p ¬q\neg q (¬p)&(¬q)(\neg p)\ \&\ (\neg q)
TT TT T F F F F
TT FF T F F T F
FF TT T F T F F
FF FF F T T T T

As the fourth and seventh columns are the same, we conclude that the statements ‘‘¬(porq)\neg(p\ \text{or}\ q)’’ and ‘‘(¬p)&(¬q)(\neg p)\ \&\ (\neg q)’’ are logically equivalent.

Remark 2.3.4
  1. (i)

    Example 2.3.2 shows that the connective ‘‘or’’ can be expressed in terms of the connective ‘‘&\&’’ and the negation. Indeed, negating both statements in that example, we see that ‘‘pp or qq’’ is logically equivalent to ‘‘¬((¬p)&(¬q))\neg\bigl((\neg p)\ \&\ (\neg q)\bigr)’’.

  2. (ii)

    At the end of a calculation involving truth tables, always state the conclusion (as we did above).

Example 2.3.5

In analogy with Example 2.3.2, the two compound statements ‘‘¬(p&q)\neg(p\ \&\ q)’’ and ‘‘(¬p)(\neg p) or (¬q)(\neg q)’’ can be shown to be logically equivalent. Indeed, replacing pp and qq with their negations in the conclusion of Remark 2.3.4(i) above, we see that ‘‘(¬p)(\neg p) or (¬q)(\neg q)’’ is logically equivalent to ‘‘¬((¬(¬p))&(¬(¬q)))\neg\bigl((\neg(\neg p))\ \&\ (\neg(\neg q))\bigr)’’, and cancelling the double negations, we conclude that this is logically equivalent to ‘‘¬(p&q)\neg(p\ \&\ q)’’. (Alternatively, this can be proved directly using truth tables; see Exercise 1.13 for details.)

This result implies in particular that the connective ‘‘&\&’’ can be expressed in terms of the connective ‘‘or’’ and the negation. More precisely, if we negate both compound statements above, then we see that ‘‘p&qp\ \&\ q’’ is logically equivalent to ‘‘¬((¬p)or(¬q))\neg\bigl((\neg p)\ \text{or}\ (\neg q)\bigr)’’.

Definition 2.3.6

Let pp and qq be statement variables. The contrapositive of the statement ‘‘pqp\Rightarrow q’’ is ‘‘(¬q)(¬p)(\neg q)\Rightarrow(\neg p)’’.

Example 2.3.7

Show that the compound statement ‘‘pqp\Rightarrow q’’ is logically equivalent to its contrapositive ‘‘(¬q)(¬p)(\neg q)\Rightarrow(\neg p)’’.

Solution. We construct the truth tables.

pp qq pqp\Rightarrow q ¬q\neg q ¬p\neg p (¬q)(¬p)(\neg q)\Rightarrow(\neg p)
TT TT T F F T
TT FF F T F F
FF TT T F T T
FF FF T T T T

As the third and sixth columns are the same, we conclude that the statements ‘‘pqp\Rightarrow q’’ and ‘‘(¬q)(¬p)(\neg q)\Rightarrow(\neg p)’’ are logically equivalent. This result is called the law of contraposition and will be important in our study of proof techniques in the next chapter.

Example 2.3.8

Show that the two compound statements ‘‘¬(pq)\neg(p\Rightarrow q)’’ and ‘‘p&(¬q)p\ \&\ (\neg q)’’ are logically equivalent.

Solution. We construct the truth tables.

pp qq pqp\Rightarrow q ¬(pq)\neg(p\Rightarrow q) ¬q\neg q p&(¬q)p\ \&\ (\neg q)
TT TT T F F F
TT FF F T T T
FF TT T F F F
FF FF T F T F

As the fourth and sixth columns are the same, we conclude that the statements ‘‘¬(pq)\neg(p\Rightarrow q)’’ and ‘‘p&(¬q)p\ \&\ (\neg q)’’ are logically equivalent. Again, this result will be useful when we shall study proofs in the next chapter.