Boolean Logic Flashcards
7 cards from real APCSP practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Boolean Logic flashcards as text
Given x = 5, which Boolean condition evaluates to TRUE?
Answer: x > 3 AND x < 10
5 > 3 is TRUE and 5 < 10 is TRUE, so the AND expression evaluates to TRUE.
What does the expression NOT(TRUE AND FALSE) evaluate to?
Answer: TRUE
TRUE AND FALSE = FALSE, then NOT(FALSE) = TRUE.
A login system uses the condition (username_correct AND password_correct). When does the user gain access?
Answer: When both username and password are correct
The AND operator requires both conditions to be TRUE for the overall expression to be TRUE, so both credentials must be correct.
Which Boolean expression is equivalent to NOT(A OR B) according to De Morgan's law?
Answer: NOT(A) AND NOT(B)
By De Morgan's law, NOT(A OR B) = NOT(A) AND NOT(B).
The condition (x > 0 OR y > 0) is TRUE when:
Answer: At least one of x or y is positive
OR is TRUE when at least one operand is TRUE, so only one of the values needs to be positive.
A security system uses the condition (door_locked AND alarm_on). What happens to the condition when the door is unlocked?
Answer: The overall condition becomes FALSE
If door_locked is FALSE, the AND expression is FALSE regardless of the value of alarm_on.
Which Boolean expression is TRUE only when n is between 1 and 10 inclusive?
Answer: n >= 1 AND n <= 10
Both conditions must be true simultaneously: n >= 1 AND n <= 10 covers the entire inclusive range from 1 to 10.