English to logic translation exercises with answers
Ten sentences to translate into one formula each: rules with “unless”, “only if”, “neither … nor”, “if and only if”, “not both”, exclusive choices, and necessary and sufficient conditions. Choose the connective, name the inputs, and compare with the formula and truth table under each problem.
Four connectives cause most slips. “Unless” in a rule means “and not”: members may enter unless banned is member AND NOT banned, not an implication. “Only if” points the arrow at the condition: you may board only if you have a ticket is board -> ticket, the ticket is necessary, not sufficient. “Neither A nor B” is NOT A AND NOT B, which De Morgan also writes as NOT (A OR B). “Either … or” is often exclusive in speech, XOR, while a bare “or” in a rule is inclusive.
Input names are part of the answer: use one name per proposition, in snake_case, and write the formula so that the truth table reads like the sentence. The expression under each problem is the translation; its table is the check, so read the rows that should fail the rule and make sure they do. The simplifier may rewrite a translation into a shorter equivalent, as it does for the neither-nor sentence; the two forms are the same function.
1. Translate: “Members may enter unless they are banned.” Inputs member, banned.
member AND NOT banned
| # | member | banned | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
member AND NOT banned Classification: contingent
member AND NOT banned. In a rule, “unless” removes the exception from the permission: entry requires membership and the absence of a ban. The only TRUE row is member = TRUE, banned = FALSE.
2. Translate: “You may board only if you have a ticket.” Inputs board, ticket.
board -> ticket
| # | board | ticket | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
board -> ticket Classification: contingent
board -> ticket: “only if” makes the ticket a necessary condition, so boarding without a ticket (board = TRUE, ticket = FALSE) is the one row the rule forbids. A ticket alone does not force boarding.
3. Translate: “Neither rain nor snow is forecast.” Inputs rain, snow.
NOT rain AND NOT snow
| # | rain | snow | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | FALSE |
NOT rain AND NOT snow- De Morgan's law ·
NOT A AND NOT B = NOT (A OR B)NOT rain AND NOT snow→NOT (rain OR snow)Result:NOT (rain OR snow)
Classification: contingent
NOT rain AND NOT snow: both are ruled out, TRUE only on rain = FALSE, snow = FALSE. The simplifier rewrites it by De Morgan as NOT (rain OR snow), the same function in fewer symbols.
4. Translate: “Shipping is free for orders over 50 or for Prime members, but never for oversized items.” Inputs over_50, prime, oversized.
(over_50 OR prime) AND NOT oversized
| # | over_50 | prime | oversized | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | TRUE |
| 5 | TRUE | FALSE | TRUE | FALSE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
(over_50 OR prime) AND NOT oversized Classification: contingent
(over_50 OR prime) AND NOT oversized: an inclusive OR for the two ways to qualify, and “but never” as an AND NOT that overrides both. The table is TRUE on three rows, each with oversized = FALSE.
5. Translate: “The alarm sounds if the system is armed and a door or a window opens.” Inputs armed, door, window.
armed AND (door OR window)
| # | armed | door | window | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | FALSE |
| 5 | TRUE | FALSE | TRUE | TRUE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
armed AND (door OR window) Classification: contingent
armed AND (door OR window). The parentheses matter: without them, armed AND door OR window would sound the alarm for a window even when disarmed, because AND binds tighter than OR.
6. Translate: “Exactly one of the two switches is on.” Inputs switch_a, switch_b.
switch_a XOR switch_b
| # | switch_a | switch_b | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
switch_a XOR switch_b Classification: contingent
switch_a XOR switch_b: TRUE when the switches differ and FALSE when both are on or both off. An inclusive OR would wrongly accept both on.
7. Translate: “Access is granted if and only if the user is an admin or has an invitation.” Inputs access, admin, invited.
access <-> (admin OR invited)
| # | access | admin | invited | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | FALSE |
| 5 | TRUE | FALSE | TRUE | TRUE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
access <-> admin OR invited Classification: contingent
access <-> (admin OR invited): “if and only if” is the biconditional, so access is granted in exactly those cases and refused in all others. With a plain “if” the formula would be (admin OR invited) -> access, which says nothing about the other rows.
8. Translate: “The pump and the valve are never both on.” Inputs pump, valve.
NOT (pump AND valve)
| # | pump | valve | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT (pump AND valve) Classification: contingent
NOT (pump AND valve), a NAND: FALSE only on pump = TRUE, valve = TRUE. It is not NOT pump AND NOT valve, which would forbid either one alone.
9. Translate: “A defective item is a sufficient condition for a refund.” Inputs defective, refund.
defective -> refund
| # | defective | refund | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
defective -> refund Classification: contingent
defective -> refund: sufficient means the condition guarantees the outcome, so the arrow starts at the condition. A refund for other reasons (defective = FALSE, refund = TRUE) does not break the rule.
10. Translate: “Passing the exam is a necessary condition for graduating.” Inputs graduate, pass_exam.
graduate -> pass_exam
| # | graduate | pass_exam | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
graduate -> pass_exam Classification: contingent
graduate -> pass_exam: necessary means the outcome cannot happen without the condition, so the arrow points at the condition. Passing without graduating is allowed; graduating without passing (graduate = TRUE, pass_exam = FALSE) is the one forbidden row.
Questions
Is “A is sufficient for B” the same as “A is necessary for B”?
No: sufficient is A -> B and necessary is B -> A. A defective item is sufficient for a refund, defective -> refund; passing the exam is necessary for graduating, graduate -> pass_exam. Swapping them is the converse slip, and the two formulas differ on one row.
Related
Pitfalls
See also
- “Unless” in a rule: AND NOT, not OR
- “Neither A nor B” is NOT A AND NOT B
- Necessary vs sufficient: “only if” is not “if”
- Writing business rules in plain English that translate to logic
- Lesson 5: If, only if, unless: necessary and sufficient conditions (intermediate, 15 min)
Practice
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.