Boolean problem

a && !(b || a)

  1. Always true?

  2. Always false?

  3. True if and only if a is false?

  4. True if and only if b is false?

  5. True if and only if either a or b is true?

a && !(b || a)

Apply De Morgan’s Law.

a && !b && !a

Reorder.

a && !a && !b

Group.

(a && !a) && !b

a && !a is a contradiction.

Contradictions are always false.

false && !b

false && x is false for all x.

false

Therefore the answer is, “2. Always false.”

We can also analyze this with a truth table

How to write a truth table, part 1

Write a column for each variable.

Add a column for each sub expression in terms of a single operator and one of the expressions in a column to the left.

How to write a truth table, part 2

With n variables write 2n rows under the header.

In the first column write 2n-1 Fs and then 2n-1 Ts.

In the next column alternate 2n-2 Fs with 2n-2 Ts.

And so on until 2n-n (i.e. alternating single Fs and Ts.)

Truth table

a b a || b !(a || b) a && !(a || b)
F F
F T
T F
T T