Exercises – Long Day#

Exercise 1: Propositions#

Let \(P\) and \(Q\) be logical propositions.

We now form three new propositions:

  • \(u:\) “At least one of the propositions \(P\) and \(Q\) is true.”

  • \(v:\) “Exactly one of the propositions \(P\) and \(Q\) is false.”

  • \(w:\)\(P\) is true and \(Q\) is false.”

Question a#

Write out the truth tables for the logical propositions \(u\), \(v\), and \(w\).

Question b#

Now let \(P\) and \(Q\) denote the logical propositions:

\(P\): “6 is an odd number” and \(Q\): “3<7”.

Use your tables from the previous Question to determine the truth values of the three propositions \(u\), \(v\), and \(w\).

Question c#

Which of the logical propositions \(P \wedge Q\) and \(P \vee Q\) are logically equivalent to \(u\)?

Exercise 2: Or#

In propositional logic we use the symbol \(\vee\), pronounced “or”.

Let \(P\) and \(Q\) be propositions.

Question a#

Write out the truth table for \(P \vee Q.\)

Question b#

Write out the truth table for \((P \vee Q) \wedge \neg(P \wedge Q)\).

Question c#

Give examples of the use of the word “or” in everyday speech and analyse whether this meaning of the word “or” is the same as in Question a or as in Question b.


Exercise 3: Truth Tables#

Let \(P\), \(Q\), and \(R\) be logical propositions.

Question a#

Write out the truth table for the logical propositions: \(P \wedge ( Q \vee R)\).

Question b#

Write out the truth table for the logical proposition: \((P \wedge Q) \vee R\).

Question c#

Are the logical propositions \(P \wedge ( Q \vee R)\) and \((P \wedge Q) \vee R\) logically equivalent?


Exercise 4: Negation#

Let \(P\) and \(Q\) be logical propositions.

Question a#

Write out the truth table for the logical proposition: \(\neg P\).

Question b#

Write out the truth table for the logical proposition: \(\neg (P \wedge Q)\).

Question c#

Write out the truth table for the logical proposition: \(\neg P \vee \neg Q\).

Question d#

Are the logical propositions \(\neg (P \wedge Q)\) and \(\neg P \vee \neg Q\) logically equivalent?

Question e#

We now wish to find a logical equivalence that applies to \(\neg (P \vee Q)\). Instead of repeating the truth table approach as above, then use the previous answer but with the logical propositions \(\neg P\) and \(\neg Q\) to derive a logically equivalent expression for \(\neg (P \vee Q)\).


Exercise 5: Negation in Everyday Speech#

Question a#

Let \(P\) be the proposition “The sun is shining” and \(Q\) the proposition “I am in a bad mood”. Explain what the below propositions mean in everyday speech:

  1. \(\neg P\)

  2. \(P \vee \neg Q\)

  3. \(\neg P \wedge \neg Q\)

  4. \(P \Rightarrow \neg Q\)

  5. \((\neg P \wedge \neg Q) \Rightarrow (\neg P)\)


Exercise 6: Implication#

Question a#

Which of the below expressions are logically equivalent to \(P \Rightarrow Q\)?

  1. \(Q \Rightarrow P\)

  2. \(\neg P \Rightarrow \neg Q\)

  3. \(\neg Q \Rightarrow P\)

  4. \(\neg Q \Rightarrow \neg P\)

Question b#

Show that the proposition \(P \Leftrightarrow Q\) is logically equivalent to \(\neg P \Leftrightarrow \neg Q\). Try to challenge yourself by showing this without using truth tables and instead using the above result along with a fitting theorem from our textbook.


Exercise 7: Contraposition#

An integer \(a\) is called even if \(a=2b\) for some integer \(b\). Likewise, an integer \(a\) is called odd if one can write \(a=1+2c\) for some integer \(c\).

Claim: Let \(a\) be an integer. If \(a^2\) is even, then \(a\) is even as well.

The purpose of this exercise is to confirm this claim using propositional logic.

Question a#

The above statement contains an implication. Formulate logical propositions \(P\) and \(Q\) such that the implication in the statement can be written as \(P \Rightarrow Q\).

Question b#

With \(P\) and \(Q\) as in Question a, describe in words the logical proposition \(\neg Q \Rightarrow \neg P\).

Question c#

From Exercise 6 we know that the logical propositions \(P \Rightarrow Q\) and \(\neg Q \Rightarrow \neg P\) are logically equivalent. Therefore we can show the claim in this exercise by showing that the proposition “If \(a\) is odd then \(a^2\) is odd” is true for any integer \(a\). Show this proposition.


Exercise 8: The NAND Operator#

The logical operator \(\uparrow\), also called NAND, has the following truth table:

\(A\)

\(B\)

\(A \uparrow B\)

\(\mathrm T\)

\(\mathrm T\)

\(\mathrm F\)

\(\mathrm T\)

\(\mathrm F\)

\(\mathrm T\)

\(\mathrm F\)

\(\mathrm T\)

\(\mathrm T\)

\(\mathrm F\)

\(\mathrm F\)

\(\mathrm T\)

A NAND operator can be interpreted as a component in an electrical network that takes two input currents \(A\) and \(B\), that each might be on (current is flowing) or off (current is not flowing), and produces an output current. If \(A\) has the value \(\mathrm T\) (respectively \(\mathrm F\)) then, in the electrical network, this can be interpreted as saying that \(A\) is on (respectively off). The truth values of \(B\) and the output \(A \uparrow B\) have similar interpretations. In the context of electrical networks the NAND operator is called a NAND gate. It is drawn as an electrical component on an electrical network schematic with a symbol as follows:

Also other logical operators such as the \(\neg\), \(\wedge\), and \(\vee\) can be interpreted as gates within electrical networks (see the Wikipedia page “Logic gate” if you wish to read more).

Question a#

Show that the two logical propositions \(A \uparrow B\) and \(\neg (A \wedge B)\) are logically equivalent. This explains the name NAND, which simply is an abbreviation of “not and”.

Question b#

Justify that the following electrical component has the same effect as \(\neg A\) by showing that the two logical propositions \(A \uparrow A\) and \(\neg A\) are logically equivalent.

Question c#

Justify that the following electrical network consisting of two logic gates has the same effect as \(A \wedge B\).

Question d#

Draw an electrical network with two input currents \(A\) and \(B\) that only uses NAND gates and that has the same effect as \(A \vee B\).


Exercise 9: Proof by Contradiction#

Consider the second-degree equation \(x^2+bx+c=0\) where \(b,c \in \Bbb{Z}\). As is well-known from highschool, such equation has a discriminant expressed as \(D=b^2-4c.\) Let \(P\) be the proposition that \(D\) can never take a value of \(2\) for \(b,c \in \Bbb{Z}\).

Question a#

What does the logical proposition \(\neg P\) tell about the discriminant \(D\)?

Question b#

Show that the proposition \(P\) is true using a proof by contradiction.


Exercise 10: Riddle#

Question a#

Try solving Example 1.5.2 in the textbook on your own. Alternatively, read and understand Example 1.5.2.