Part I
(you can’t use paper, you have to figure it out in your head)
i have a black triangle, a white triangle, a black circle and a white circle. if i gave you a shape (triangle or circle) and a color (black or white), the “frobby” items would be those that had either the shape or the color, but not both. that is, in order to be frobby, the item must be of the specified color OR the specified shape, but not both the specified shape AND the specified color. i’m thinking of a shape and a color in my head and i tell you that the white triangle is frobby. can you tell me the “frobbiness” of the other items?
Part II
there are four cards which have a letter on one side and a number on the other side. i lay them out and the cards appear as 2 5 F E. the rule is that a card with an odd number on one side must have a vowel on the other. what is the minimum number of cards you should turn over to prove the rule is true (and which cards would they be)?
Solution
You may be able to find the solution on the discussion forum.
2026 Update: Boolean Logic and Implication — From Puzzles to Code
Logical implication (X → Y) appears in interview puzzles, formal verification, and database constraint validation. “X implies Y” means: whenever X is true, Y must also be true. Equivalently: NOT X OR Y.
# Boolean implication truth table
def implies(x: bool, y: bool) -> bool:
"""X → Y is False ONLY when X is True and Y is False."""
return (not x) or y
# Print truth table
print("X | Y | X->Y")
print("-" * 12)
for x in [False, True]:
for y in [False, True]:
print(f"{int(x)} | {int(y)} | {int(implies(x, y))}")
# 0 | 0 | 1 (vacuously true: X is false, doesn't matter what Y is)
# 0 | 1 | 1
# 1 | 0 | 0 -- The ONLY false case
# 1 | 1 | 1
# Contrapositive: (X -> Y) is logically equivalent to (NOT Y -> NOT X)
def contrapositive(x: bool, y: bool) -> bool:
return implies(not y, not x)
# Verify equivalence
all_equivalent = all(
implies(x, y) == contrapositive(x, y)
for x in [True, False]
for y in [True, False]
)
print(f"Implication == Contrapositive: {all_equivalent}") # True
# Application: Wason Selection Task (famous cognitive bias test)
# Rule: "If a card has a vowel on one side, it has an even number on the other."
# Cards showing: A, K, 4, 7. Which must you flip to test the rule?
# Answer: A (has vowel -> must verify even on back) and 7 (odd -> must verify no vowel on back)
# People incorrectly pick 4 (even number says nothing about front -- rule only goes one way)
wason_must_flip = {
'A': 'Yes -- vowel shown, must verify even on back',
'K': 'No -- consonant shown, rule does not apply',
'4': 'No -- even number does not require a vowel on the front',
'7': 'Yes -- odd number shown, must verify no vowel on back (by contrapositive)',
}
for card, reason in wason_must_flip.items():
print(f" Flip {card!r}? {reason}")
# Practical: validating database access constraints
users = [
{'id': 1, 'role': 'admin', 'two_factor_enabled': True},
{'id': 2, 'role': 'admin', 'two_factor_enabled': False}, # Violation!
{'id': 3, 'role': 'user', 'two_factor_enabled': False}, # OK
]
def find_violations(users: list) -> list:
"""Find users violating: admin -> must have 2FA enabled."""
return [
u['id']
for u in users
if not implies(u['role'] == 'admin', u['two_factor_enabled'])
]
print(f"Policy violations: user IDs {find_violations(users)}") # [2]
Interview applications: Logical implication underlies SQL’s CHECK constraints, database foreign key validation, and formal program verification. The Wason selection task demonstrates that humans naturally reason well about concrete social contracts (“if you drink alcohol, you must be 21+”) but poorly about abstract implication — relevant to designing intuitive security policy UIs.