The exercises below use AP CSP Pseudocode. For Java, see Boolean expression practice.
Exercise 1
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
false |
false |
false |
true |
false |
true |
false |
true |
true |
true |
true |
false |
Which of the following expressions is equivalent to the value of the expression shown in the table?
(A) (a AND b) OR ((NOT a) AND (NOT b))
(B) (a OR b) AND ((NOT a) OR (NOT b))
(C) (a OR (NOT b)) AND (b OR (NOT a))
(D) (a OR (NOT b)) OR (b OR (NOT a))
Exercise 2
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
true |
true |
false |
true |
false |
true |
false |
true |
false |
false |
false |
false |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) a AND b
(B) a AND (NOT b)
(C) NOT ((NOT a) OR b)
(D) NOT (a AND b)
Exercise 3
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
true |
true |
true |
true |
false |
false |
false |
true |
true |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) NOT (a AND b)
(B) NOT (a OR b)
(C) NOT (a AND (NOT b))
(D) (NOT a) OR b
Exercise 4
The following table shows the value of an expression based on the values of a, b, and c.
Value of a |
Value of b |
Value of c |
Value of expression |
---|---|---|---|
true |
true |
true |
false |
true |
true |
false |
true |
true |
false |
true |
true |
true |
false |
false |
true |
false |
true |
true |
true |
false |
true |
false |
true |
false |
false |
true |
true |
false |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) (NOT a) OR (NOT b) OR (NOT c)
(B) NOT (a OR b OR c)
(C) NOT (a AND b AND c)
(D) (NOT a) AND (NOT b) AND (NOT c)
Exercise 5
The following table shows the value of an expression based on the values of a
, b
, and c
.
Value of a |
Value of b |
Value of c |
Value of expression |
---|---|---|---|
true |
true |
true |
false |
true |
true |
false |
false |
true |
false |
true |
false |
true |
false |
false |
false |
false |
true |
true |
false |
false |
true |
false |
false |
false |
false |
true |
false |
false |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) (NOT a) AND (NOT b) AND (NOT c)
(B) NOT (a OR b OR c)
(C) (NOT a) OR (NOT b) OR (NOT c)
(D) NOT (a AND b AND c)
Additional resources
Help & comments
Get help from AP CS Tutor Brandon Horn