Discrete Mathematics/Logic/Exercises

Logic Exercise 1
1
 * Which of the following are propositions?


 * (a) Buy Premium Bonds!


 * (b) The Apple Macintosh is a 16 bit computer.


 * (c) There is a largest even number.


 * (d) Why are we here?


 * (e) 8 + 7 = 13


 * (f) a + b = 13

2
 * p is "1024 bytes is known as 1MB"


 * q is "A computer keyboard is an example of a data input device".


 * Express the following compound propositions as English sentences in as natural a way as you can. Are the resulting propositions true or false?


 * (a) p $$\scriptstyle \wedge$$ q


 * (b) p &or; q


 * (c) &not;p

3
 * p is "x < 50"; q is "x > 40".


 * Write as simply as you can:


 * (a) &not;p


 * (b) &not;q


 * (c) p $$\scriptstyle \wedge$$ q


 * (d) p &or; q


 * (e) &not;p $$\scriptstyle \wedge$$ q


 * (f) &not;p  $$\scriptstyle \wedge$$ &not;q


 * One of these compound propositional functions always produces the output true, and one always outputs false. Which ones?

4
 * p is "I like Maths"


 * q is "I am going to spend at least 6 hours a week on Maths"


 * Write in as simple English as you can:


 * (a) (&not;p) $$\scriptstyle \wedge$$ q


 * (b) (&not;p) &or; q


 * (c) &not;(&not;p)


 * (d) (&not;p) &or; (&not;q)


 * (e) &not;(p &or; q):


 * (f) (&not;p) $$\scriptstyle \wedge$$ (&not;q)

5
 * In each part of this question a proposition p is defined. Which of the statements that follow the definition correspond to the proposition &not;p?  (There may be more than one correct answer.)


 * (a)
 * p is "Some people like Maths".


 * (i) "Some people dislike Maths"


 * (ii) "Everybody dislikes Maths"


 * (iii) "Everybody likes Maths"


 * (You may assume in this question that no-one remains neutral: they either like or dislike Maths.)


 * (b)
 * p is "The answer is either 2 or 3".


 * (i) "Neither 2 nor 3 is the answer"


 * (ii) "The answer is not 2 or it is not 3"


 * (iii) "The answer is not 2 and it is not 3"


 * (c)
 * p is "All people in my class are tall and thin".


 * (i) "Someone in my class is short and fat"


 * (ii) "No-one in my class is tall and thin"


 * (iii) "Someone in my class is short or fat"


 * (You may assume in this question that everyone may be categorised as either tall or short, either thin or fat.)

Answers

Back to Logic.

Logic Exercise 2
1
 * Construct truth tables for:


 * (a) &not;p &or; &not;q


 * (b) q $$\scriptstyle \wedge$$ (&not;p &or; q)


 * (c) p $$\scriptstyle \wedge$$ (q &or; r)


 * (d) (p $$\scriptstyle \wedge$$ q) &or; r

2
 * Construct truth tables for each of the following compound propositions. What do you notice about the results?


 * (a) p &or; (&not;p $$\scriptstyle \wedge$$ q)


 * (b) p &or; q

3
 * Repeat question 2 for:


 * (a) p $$\scriptstyle \wedge$$ (q $$\scriptstyle \wedge$$ p)


 * (b) p $$\scriptstyle \wedge$$ q

Answers

Back to Logic.

Logic Exercise 3
1
 * For each pair of expressions, construct truth tables to see if the two compound propositions are logically equivalent:


 * (a)
 * (i) p &or; (q $$\scriptstyle \wedge$$ &not;p)
 * (ii) p &or; q


 * (b)
 * (i) (&not;p $$\scriptstyle \wedge$$ q) &or; (p $$\scriptstyle \wedge$$ &not;q)
 * (ii) (&not;p $$\scriptstyle \wedge$$ &not;q) &or; (p $$\scriptstyle \wedge$$ q)

2
 * Construct the truth table for each of the following expressions. Try to find a simpler logical equivalent in each case:


 * (a)
 * &not;a &or; &not;b &or; (a $$\scriptstyle \wedge$$ b $$\scriptstyle \wedge$$ &not;c)


 * (b)
 * (a $$\scriptstyle \wedge$$ b) &or; (a $$\scriptstyle \wedge$$ b $$\scriptstyle \wedge$$ &not;c $$\scriptstyle \wedge$$ d) &or; (&not;a $$\scriptstyle \wedge$$ b)

3
 * Use the Laws of Logic or truth tables to simplify as far as possible:


 * (a)
 * &not;(&not;a $$\scriptstyle \wedge$$ &not;b)


 * (b)
 * (a $$\scriptstyle \wedge$$ b) &or; (a $$\scriptstyle \wedge$$ &not;b) &or; (&not;a $$\scriptstyle \wedge$$ b)


 * (c)
 * (q $$\scriptstyle \wedge$$ &not;p) &or; p

4
 * Use a truth table to show that the proposition p &or; (q &or; &not;p) is always true (T), whatever the values of p and q.

5
 * p, q and r represent conditions that will be true or false when a certain computer program is executed. Suppose you want the program to carry out a certain task only when p or q is true (but not both) and r is false.


 * Using p, q, r, $$\scriptstyle \wedge$$, &or; and &not;, write a statement that will only be true under these conditions.

6
 * Use truth tables to show that:


 * &not;((p &or; &not;q) &or; (r $$\scriptstyle \wedge$$ (p &or; &not;q))) &equiv; &not;p $$\scriptstyle \wedge$$ q

7
 * Use the laws of logical propositions to prove that:


 * (z $$\scriptstyle \wedge$$ w) &or; (&not;z $$\scriptstyle \wedge$$ w) &or; (z $$\scriptstyle \wedge$$ &not;w) &equiv; z &or; w


 * State carefully which law you are using at each stage.

Answers

Back to Logic.

Logic Exercise 4
1
 * Propositions p, q, r and s are defined as follows:


 * p is "I shall finish my Coursework Assignment"


 * q is "I shall work for forty hours this week"


 * r is "I shall pass Maths"


 * s is "I like Maths"


 * Write each sentence in symbols:


 * (a) I shall not finish my Coursework Assignment.


 * (b) I don’t like Maths, but I shall finish my Coursework Assignment.


 * (c) If I finish my Coursework Assignment, I shall pass Maths.


 * (d) I shall pass Maths only if I work for forty hours this week and finish my Coursework Assignment.


 * Write each expression as a sensible (if untrue!) English sentence:


 * (e) q &or; p


 * (f) &not;p &rArr; &not;r

2
 * Draw up truth tables to determine whether or not each of the following propositions is always true:


 * (a) p &rArr; (p &or; q)


 * (b) (p &rArr; q) &rArr; (q &rArr; p)


 * (c) (p $$\scriptstyle \wedge$$ (p &rArr; q)) &rArr; q


 * (d) (p $$\scriptstyle \wedge$$ q) &rArr; p


 * (e) q &hArr; (&not;p &or; &not;q)

3
 * Draw up truth tables to show that p &rArr; q, &not;p &or; q and &not;q &rArr; &not;p are all logically equivalent.

Answers

Back to Logic Page 2.

Logic Exercise 5
The following predicates are defined:


 * friend is "… is a friend of mine"


 * wealthy is "… is wealthy"


 * clever is "… is clever"


 * boring is "… is boring"

Write each of the following propositions using predicate notation:

1 Jimmy is a friend of mine.

2 Sue is wealthy and clever.

3 Jane is wealthy but not clever.

4 Both Mark and Elaine are friends of mine.

5 If Peter is a friend of mine, then he is not boring.

6 If Jimmy is wealthy and not boring, then he is a friend of mine.

Answers

Back to Logic Page 2.

Logic Exercise 6
1
 * Using the same predicates you defined in Exercise 5, symbolise each of the following.


 * (a) Some of my friends are clever.


 * (b) All clever people are boring.


 * (c) None of my friends is wealthy.


 * (d) Some of my wealthy friends are clever.


 * (e) All my clever friends are boring.


 * (f) All clever people are either boring or wealthy.

2
 * Define suitable propositional functions, and hence symbolise:


 * (a) All pop-stars are overpaid.


 * (b) Some RAF pilots are women.


 * (c) No students own a Rolls-Royce.


 * (d) Some doctors cannot write legibly.

Answers

Back to Logic Page 2.

Logic Exercise 7
1
 * In each of the following, define suitable one-place predicates and a suitable universe of discourse. Then symbolise the statements.


 * (a) Some computer programmers can’t understand spreadsheets.


 * (b) Every prisoner deserves a fair trial.


 * (c) There are some intelligent people who support Crystal Palace Football Club.


 * (d) Some stupid people don’t like curry.


 * (e) All university students are good-looking or intelligent.


 * (f) Not all cars are noisy and dirty.

2
 * In the following, the universe of discourse is {people}. One-place predicates are defined as follows:


 * cheats is "... cheats at cards"


 * punk is "… has punk hair"


 * scout is "... is a Boy Scout"


 * Write the following propositions as sensible English sentences:


 * (a) &exist; x, scout(x) $$\scriptstyle \wedge$$ cheats(x)


 * (b) &forall; x, punk(x) &rArr; cheats(x)


 * (c) &forall; x, scout(x) &rArr; &not;(punk(x) &or; cheats(x))


 * (d) &exist; x, cheats(x) $$\scriptstyle \wedge$$ &not;punk(x)

3
 * Translate the following into symbolic form, using two-place predicates, defining a suitable universe of discourse in each case.


 * (a) All cows eat grass.


 * (b) Harry is better at Maths than someone.


 * (c) Somebody likes the Rolling Stones.


 * (d) No-one expects the Spanish Inquisition.

Answers

Back to Logic Page 2.