Boolean Expressions - AP Computer Science Principles

  1. What is the result of the Boolean expression: NOT (true AND true)\text{NOT } (true \text{ AND } true)?
    false. Parentheses evaluate first: (true AND true)=true(true \text{ AND } true) = true, then NOT true=false\text{NOT } true = false.
  2. Identify the result: NOT (false AND true)\text{NOT } (false \text{ AND } true)
    true. Parentheses evaluate first: (false AND true)=false(false \text{ AND } true) = false, then NOT false=true\text{NOT } false = true.
  3. What is the result of the expression: NOT (true OR false)\text{NOT } (true \text{ OR } false)?
    false. Parentheses force OR first, then NOT: NOT true=false\text{NOT } true = false.
  4. What is the result of the expression: true AND (NOT false)true \text{ AND } (\text{NOT } false)?
    true. NOT false=true\text{NOT } false = true, then true AND true=truetrue \text{ AND } true = true.
  5. What does the Boolean expression x AND yx \text{ AND } y evaluate if x=falsex = false?
    false. AND returns false when either operand is false.
  6. What is the result of the expression: NOT (false OR true)\text{NOT } (false \text{ OR } true)?
    false. Parentheses evaluate first: (false OR true)=true(false \text{ OR } true) = true, then NOT true=false\text{NOT } true = false.
  7. State De Morgan's Law for NOT (A AND B).
    NOT A OR NOT B. De Morgan's Law distributes NOT over AND.
  8. State De Morgan's Law for NOT (A OR B).
    NOT A AND NOT B. De Morgan's Law distributes NOT over OR.
  9. Identify the result: false AND (true OR false)false \text{ AND } (true \text{ OR } false)
    false. Parentheses evaluate first: (true OR false)=true(true \text{ OR } false) = true, then false AND true=falsefalse \text{ AND } true = false.
  10. What is the result of the expression: (true AND false) OR false(true \text{ AND } false) \text{ OR } false?
    false. Parentheses evaluate first: (true AND false)=false(true \text{ AND } false) = false, then false OR false=falsefalse \text{ OR } false = false.
  11. What is the result of the Boolean expression: NOT (true OR true)\text{NOT } (true \text{ OR } true)?
    false. Parentheses evaluate first: (true OR true)=true(true \text{ OR } true) = true, then NOT true=false\text{NOT } true = false.
  12. What is the result of true OR (NOT true)true \text{ OR } (\text{NOT } true)?
    true. NOT true=false\text{NOT } true = false, then true OR false=truetrue \text{ OR } false = true.
  13. Which Boolean operator is associative: AND, OR, NOT?
    AND, OR. Both AND and OR can group operands differently without changing result.
  14. What is the result of the expression: NOT (true AND false)\text{NOT } (true \text{ AND } false)?
    true. Parentheses evaluate first: (true AND false)=false(true \text{ AND } false) = false, then NOT false=true\text{NOT } false = true.
  15. What is the precedence order of Boolean operators NOT, AND, OR?
    NOT, AND, OR. NOT has highest precedence, then AND, then OR.
  16. What is the result of the expression: NOT (false OR false)\text{NOT } (false \text{ OR } false)?
    true. Parentheses evaluate first: (false OR false)=false(false \text{ OR } false) = false, then NOT false=true\text{NOT } false = true.
  17. What is the identity element for the AND operation?
    true. AND with true leaves the other operand unchanged.
  18. What does the expression x AND xx \text{ AND } x simplify to?
    x. Idempotent law: a variable AND with itself equals itself.
  19. What is the result of false OR (NOT false)false \text{ OR } (\text{NOT } false)?
    true. NOT false=true\text{NOT } false = true, then false OR true=truefalse \text{ OR } true = true.
  20. What is the result of the expression: true OR (false AND true)true \text{ OR } (false \text{ AND } true)?
    true. Parentheses evaluate first: (false AND true)=false(false \text{ AND } true) = false, then true OR false=truetrue \text{ OR } false = true.
  21. What is the result of the Boolean expression: NOT false\text{NOT } false?
    true. NOT reverses the Boolean value.
  22. What is the result of the Boolean expression: NOT true\text{NOT } true?
    false. NOT reverses the Boolean value.
  23. Which Boolean operation is performed first: AND or OR?
    AND. AND has higher precedence than OR in Boolean operations.
  24. What does the expression x OR NOT xx \text{ OR } \text{NOT } x simplify to?
    true. Complement law: a variable OR its negation always equals true.
  25. Which Boolean operator is commutative: AND, OR, NOT?
    AND, OR. Both AND and OR can switch operand order without changing result.
  26. What is the result of the Boolean expression: true AND truetrue \text{ AND } true?
    true. AND returns true only when both operands are true.
  27. What is the result of the Boolean expression: (NOT false) AND true(\text{NOT } false) \text{ AND } true?
    true. Parentheses evaluate first: (NOT false)=true(\text{NOT } false) = true, then true AND true=truetrue \text{ AND } true = true.
  28. What is the result of the expression: true AND false OR truetrue \text{ AND } false \text{ OR } true?
    true. AND evaluates first: (true AND false) OR true=false OR true=true(true \text{ AND } false) \text{ OR } true = false \text{ OR } true = true.
  29. What is the result of the Boolean expression: (NOT true) OR false(\text{NOT } true) \text{ OR } false?
    false. Parentheses evaluate first: (NOT true)=false(\text{NOT } true) = false, then false OR false=falsefalse \text{ OR } false = false.
  30. What does the expression x AND NOT xx \text{ AND } \text{NOT } x simplify to?
    false. Complement law: a variable AND its negation always equals false.
  31. What is the identity element for the OR operation?
    false. OR with false leaves the other operand unchanged.
  32. What does the Boolean expression x OR yx \text{ OR } y evaluate if x=truex = true?
    true. OR returns true when either operand is true.
  33. What is the result of the Boolean expression: NOT (NOT false)\text{NOT } (\text{NOT } false)?
    false. Double negation: NOT (NOT false)=NOT true=false\text{NOT } (\text{NOT } false) = \text{NOT } true = false.
  34. What is the result of the Boolean expression: true OR falsetrue \text{ OR } false?
    true. OR returns true if at least one operand is true.
  35. What is the result of false AND (NOT true)false \text{ AND } (\text{NOT } true)?
    false. NOT true=false\text{NOT } true = false, then false AND false=falsefalse \text{ AND } false = false.
  36. What is the result of the Boolean expression: true AND (NOT false)true \text{ AND } (\text{NOT } false)?
    true. NOT false=true\text{NOT } false = true, then true AND true=truetrue \text{ AND } true = true.
  37. What is the result of the Boolean expression: (NOT true) AND false(\text{NOT } true) \text{ AND } false?
    false. Parentheses evaluate first: (NOT true)=false(\text{NOT } true) = false, then false AND false=falsefalse \text{ AND } false = false.
  38. What does the expression x OR xx \text{ OR } x simplify to?
    x. Idempotent law: a variable OR with itself equals itself.
  39. What is the result of the Boolean expression: false OR falsefalse \text{ OR } false?
    false. OR returns false only when both operands are false.
  40. What is the result of the Boolean expression: true AND falsetrue \text{ AND } false?
    false. AND requires both operands to be true.

Study these flashcards