Learn AP Comp Sci

☰

Problem of the Day

Thursday, October 15, 2026


Problem:

A Halloween monster can be described in terms of its size (small or large) and whether or not it is scary. The boolean variable small is true if the monster is small, and false if it is large. The boolean variable scary is true if the monster is scary, and false if the monster is not scary.

Which boolean expression will evaluate as true for a Halloween monster that is both scary and large?

  1. !small || scary
  2. !( !small || !scary)
  3. !( !(!small && scary))
  4. !(small && scary)

Show solution:

The correct answer is c. This solution requires two applications of DeMorgan's law to untangle the leading "not" ( ! ) symbols.