Boolean Expressions - AP Computer Science Principles
40 cards. Flip a card to check yourself, or study the whole deck card by card.
Card 1 of 40
Study these flashcards All 40 cards in this deck
- What is the result of the Boolean expression: NOT (true AND true)?
- false. Parentheses evaluate first: (true AND true)=true, then NOT true=false.
- Identify the result: NOT (false AND true)
- true. Parentheses evaluate first: (false AND true)=false, then NOT false=true.
- What is the result of the expression: NOT (true OR false)?
- false. Parentheses force OR first, then NOT: NOTÂ true=false.
- What is the result of the expression: true AND (NOT false)?
- true. NOT false=true, then true AND true=true.
- What does the Boolean expression x AND y evaluate if x=false?
- false. AND returns false when either operand is false.
- What is the result of the expression: NOT (false OR true)?
- false. Parentheses evaluate first: (false OR true)=true, then NOT true=false.
- State De Morgan's Law for NOT (A AND B).
- NOT A OR NOT B. De Morgan's Law distributes NOT over AND.
- State De Morgan's Law for NOT (A OR B).
- NOT A AND NOT B. De Morgan's Law distributes NOT over OR.
- Identify the result: false AND (true OR false)
- false. Parentheses evaluate first: (true OR false)=true, then false AND true=false.
- What is the result of the expression: (true AND false) OR false?
- false. Parentheses evaluate first: (true AND false)=false, then false OR false=false.
- What is the result of the Boolean expression: NOT (true OR true)?
- false. Parentheses evaluate first: (true OR true)=true, then NOT true=false.
- What is the result of true OR (NOT true)?
- true. NOT true=false, then true OR false=true.
- Which Boolean operator is associative: AND, OR, NOT?
- AND, OR. Both AND and OR can group operands differently without changing result.
- What is the result of the expression: NOT (true AND false)?
- true. Parentheses evaluate first: (true AND false)=false, then NOT false=true.
- What is the precedence order of Boolean operators NOT, AND, OR?
- NOT, AND, OR. NOT has highest precedence, then AND, then OR.
- What is the result of the expression: NOT (false OR false)?
- true. Parentheses evaluate first: (false OR false)=false, then NOT false=true.
- What is the identity element for the AND operation?
- true. AND with true leaves the other operand unchanged.
- What does the expression x AND x simplify to?
- x. Idempotent law: a variable AND with itself equals itself.
- What is the result of false OR (NOT false)?
- true. NOT false=true, then false OR true=true.
- What is the result of the expression: true OR (false AND true)?
- true. Parentheses evaluate first: (false AND true)=false, then true OR false=true.
- What is the result of the Boolean expression: NOTÂ false?
- true. NOT reverses the Boolean value.
- What is the result of the Boolean expression: NOTÂ true?
- false. NOT reverses the Boolean value.
- Which Boolean operation is performed first: AND or OR?
- AND. AND has higher precedence than OR in Boolean operations.
- What does the expression x OR NOT x simplify to?
- true. Complement law: a variable OR its negation always equals true.
- Which Boolean operator is commutative: AND, OR, NOT?
- AND, OR. Both AND and OR can switch operand order without changing result.
- What is the result of the Boolean expression: true AND true?
- true. AND returns true only when both operands are true.
- What is the result of the Boolean expression: (NOTÂ false)Â ANDÂ true?
- true. Parentheses evaluate first: (NOT false)=true, then true AND true=true.
- What is the result of the expression: true AND false OR true?
- true. AND evaluates first: (true AND false) OR true=false OR true=true.
- What is the result of the Boolean expression: (NOTÂ true)Â ORÂ false?
- false. Parentheses evaluate first: (NOT true)=false, then false OR false=false.
- What does the expression x AND NOT x simplify to?
- false. Complement law: a variable AND its negation always equals false.
- What is the identity element for the OR operation?
- false. OR with false leaves the other operand unchanged.
- What does the Boolean expression x OR y evaluate if x=true?
- true. OR returns true when either operand is true.
- What is the result of the Boolean expression: NOTÂ (NOTÂ false)?
- false. Double negation: NOTÂ (NOTÂ false)=NOTÂ true=false.
- What is the result of the Boolean expression: true OR false?
- true. OR returns true if at least one operand is true.
- What is the result of false AND (NOT true)?
- false. NOT true=false, then false AND false=false.
- What is the result of the Boolean expression: true AND (NOT false)?
- true. NOT false=true, then true AND true=true.
- What is the result of the Boolean expression: (NOTÂ true)Â ANDÂ false?
- false. Parentheses evaluate first: (NOT true)=false, then false AND false=false.
- What does the expression x OR x simplify to?
- x. Idempotent law: a variable OR with itself equals itself.
- What is the result of the Boolean expression: false OR false?
- false. OR returns false only when both operands are false.
- What is the result of the Boolean expression: true AND false?
- false. AND requires both operands to be true.