Exercises – Short Day#
Exercise 1: Repetition Exercise about Negation#
Consider again the logical propositions \(u\), \(v\), and \(w\) from Exercise 1 on Long Day.
Question a#
Write out the truth tables for \(\neg u\), \(\neg v\), and \(\neg w\).
Hint
Use the truth tables that you created in Exercise 1 on Long Day rather than starting over from scratch.
Question b#
Now, let \(P\) and \(Q\) denote the negation of the logical propositions:
“\(6\) is an odd number” and “\(3<7\)”.
What are the truth values of the three propositions \(u\), \(v\), and \(w\)?
Answer
\(u\): \(\mathrm T\) (that is, true), \(v\): \(\mathrm T\) and \(w\): \(\mathrm F\).
Exercise 2: Implication#
Question a#
Let \(P\) be a logical proposition. Write out the truth tables for \((P \Rightarrow P) \Rightarrow P\) and \(P \Rightarrow (P \Rightarrow P)\).
Question b#
Are the above two logical propositions equivalent?
Answer
No.
Exercise 3: Implication vs. Biimplication#
Question a#
Solve the first-degree equation \(x-2 = 3\).
Question b#
Maybe a student solves the above first-degree equation in a rather laborious manner with more steps than necessary. Also, they might forget to place implication arrows between the steps along the way. The steps might look as follows:
\(x-2=3\)
\((x-2)^2 =3^2\)
\(x^2 -4x+4=9\)
\(x^2 -4x -5 =0\)
\(x=-1 \vee x=5\)
Between which steps can we place biimplication arrows and between which only implication arrows? Explain why not every shown option for \(x\) after the last step necessarily is a solution to the original equation.
Hint
According to Equation (1.22) in Theorem 1.3.4 in the textbook one can place a biimplication arrow between two logical propositions \(P\) and \(Q\) precisely if \(P\) implies \(Q\) and \(Q\) implies \(P\).
Question c#
Another student solves the above first-degree equation in another (and still rather laborious) way:
\(x-2=3\)
\(x-5 =0\)
\((x-5)^2 =0\)
\(x^2 -10x +25 =0\)
\(x=5\) (there is only one solution to the second-degree equation)
Between which steps can we place biimplication arrows and between which only implication arrows? Explain why this time every option for \(x\) after the last step is a solution to the original equation.
Answer
Here, biimplication arrows are to be placed between all steps.
Exercise 4: Tautology#
Consider the logical proposition: \((P \vee Q)\vee (\neg P \wedge \neg Q)\).
Question a#
Show by the use of truth tables that this is a tautology.
Hint
If you are in doubt about what a tautology is, then see the text in the textbook between Definition 1.3.1 and Example 1.3.1.
Question b#
Explain in words that the above is a tautology.
Hint
In words one can pronounce \(\neg P \wedge \neg Q\) as “not \(P\) and also not \(Q\)”. Alternatively, one can say “neither \(P\) nor \(Q\)”. Now try in a similar manner to interpret \((P \vee Q)\vee (\neg P \wedge \neg Q)\) in words.
Question c#
Repeat Question a but with the proposition \((P \Rightarrow Q)\vee (Q \Rightarrow P)\).
Question d#
Repeat Question a but now with the proposition \((P \Rightarrow Q)\vee (\neg P \Rightarrow Q)\).
Exercise 5: Equations#
Solve the following four equations by first introducing a tautology.
Question a#
Solve the equation \(|x|=-x+1\).
Solve the equation \(|x|=2x+1\).
Solve the equation \(3|2x-1|=-4x+3\).
Solve the equation \(|2x+1|=|-5x+3|\).
Hint
See Example 1.4.2 in the textbook for inspiration.
Hint
Rewrite the equation to \(|x|=-x+1 \wedge ( x<0 \vee x \ge 0)\).
Answer
\(x=\frac{1}{2}\)
\(x=-\frac{1}{3}\)
\(x=0 \vee x=\frac{3}{5}\)
\(x=\frac{4}{3} \vee x=\frac{2}{7}\)
Exercise 6: Python Exercise#
In this exercise you will need the command console Python on your computer.
Question a#
Python can determine the truth value of some simple logical expressions. As examples, run the following Python code (note that Python displays the full words True
and False
rather than the short-hand \(\mathrm T\) and \(\mathrm F\) as used in the textbook):
2>5
3>1
1==1
Question b#
The logical operations \(\neg\), \(\wedge\), and \(\vee\) are written in Python as not
, and
, and or
, respectively. As examples, run the following Python code and check whether the output is correct:
2>5 and 3>1
2>5 or 3>1
not (2>5 and 3>1)
True or False
not (True and False)
Question c#
In place of True
and False
one can also write 1
and 0
, respectively, in Python. As examples, run the following Python code:
True == 1
False == 0
0 or 1
Question d#
Now fill in the truth table in Example 1.3.2 in the textbook using Python. It can be advantageous to use the shorter notation with 0
and 1
rather than False
and True
.
Hint
The first line in the table will read: 1 or (1 and (not 1))
.