Exercises for Lesson 11
Exercise 1: Compound Boolean expressions
Evaluate the following expressions.
x = 4
y = 2
(a) x > 0 and y < 5
(b) x == 4 and False
(c) (not x == 3) and (not y <= 2)
(d) x == 0 or (x > 1 and y != 14)
Exercise 2: Truth tables
Write truth tables for the following expressions.
(a) a and (not b)
(b) (a and b) or (not a and not b)
(c) not (a and b)
Exercise 3: Truth tables, revisited
Write truth tables for the following expressions.
(a) a and (not b or a)
(b) (a or b) and (a or not b)
(c) not (a or (b and a))