Logical Reasoning II: Arrangements, Syllogisms, Venn Diagrams and Puzzles
The second half of logical reasoning is about deduction: drawing conclusions that must be true from stated facts. These questions are slower than series and coding, because they need careful bookkeeping, so the method matters more than flair. The recipe is always the same: list the entities, draw a skeleton (a row, a circle, a table), place the definite facts first, and use the remaining clues to eliminate. Every puzzle in this chapter has been solved by an exhaustive program, which also confirms that each has a unique answer.
1. Linear arrangements
People sit or stand in a row. Draw numbered slots 1 to and fill the sure facts first.
Puzzle 1. Five people P, Q, R, S and T sit in a row facing north. Q sits immediately to the right of P. S sits immediately to the right of Q. R sits at the extreme right. T sits somewhere to the left of Q. Find the order from left to right.
Reasoning: P, Q, S are consecutive in that order. R is at position 5, so P-Q-S occupy three consecutive slots among 1 to 4: positions (1, 2, 3) or (2, 3, 4). T must be to the left of Q and cannot be in the P-Q-S block, so T needs a slot before Q: with P, Q, S in slots 2, 3, 4, T takes slot 1. With the block in 1, 2, 3 T would have no room to the left. The order is T, P, Q, S, R.
Questions: who is in the middle? Q. Who are S's neighbours? Q and R.
from itertools import permutations, product
order = [p for p in permutations("PQRST")
if p.index("Q") == p.index("P") + 1 and p.index("S") == p.index("Q") + 1
and p[4] == "R" and p.index("T") < p.index("Q")]
assert order == [("T", "P", "Q", "S", "R")] # exactly one arrangement satisfies every clue
arrangement = order[0]
assert arrangement[2] == "Q"
assert {arrangement[arrangement.index("S") - 1], arrangement[arrangement.index("S") + 1]} == {"Q", "R"}
Puzzle 2 (with more than one possible start). Five people A, B, C, D and E sit in a row. A is not at either end. C is immediately to the right of B. D sits at the right end. How many arrangements are possible? D is fixed at the right end, leaving positions 1 to 4 for A, B, C, E with A in position 2 or 3 and B-C adjacent in that order. Enumerating gives four arrangements.
solutions = [p for p in permutations("ABCDE")
if p[0] != "A" and p[-1] == "D" and p.index("C") == p.index("B") + 1]
assert len(solutions) == 4
assert ("B", "C", "A", "E", "D") in solutions and ("E", "A", "B", "C", "D") in solutions
When several arrangements remain, a question must be answerable from what holds in all of them, or it is flawed.
2. Circular arrangements
People sit around a table. Fix one person as a reference (rotations are equivalent) and place the rest relative to them. "Opposite" in a table of people means places away; "adjacent" means one place either side. If everyone faces the centre, a person's left-hand neighbour is the next person in the clockwise direction (seen from above); if everyone faces outwards, it is the other way round. Note which case a question uses.
Puzzle 3. Six people A, B, C, D, E, F sit around a circular table. A sits opposite D. B is adjacent to A. C is not adjacent to A. E is adjacent to both D and F. Find: who sits opposite B, who sits opposite C, and who are C's neighbours.
Reasoning: A and D are opposite. The positions next to D are held by E and one other; E is adjacent to D and to F, so the order around is D, E, F, and F must also touch A's side, giving the circle A, B, C, D, E, F (or its mirror image). The answers do not depend on the mirror image: opposite B is E; opposite C is F; C's neighbours are B and D.
def circular_solutions():
out = set()
for p in permutations("ABCDEF"):
if p[0] != "A":
continue # fix A at position 0: rotations are the same table
i = p.index
opposite = lambda x, y: (i(x) - i(y)) % 6 == 3
adjacent = lambda x, y: (i(x) - i(y)) % 6 in (1, 5)
if opposite("A", "D") and adjacent("B", "A") and not adjacent("C", "A") and adjacent("E", "D") and adjacent("E", "F"):
out.add(p)
return out
tables = circular_solutions()
assert len(tables) == 2 # a seating and its mirror image
for t in tables:
i = t.index
assert t[(i("B") + 3) % 6] == "E" and t[(i("C") + 3) % 6] == "F"
assert {t[(i("C") + 1) % 6], t[(i("C") - 1) % 6]} == {"B", "D"}
3. Tables, floors and schedules
Puzzles that assign attributes (floors, days, colours, professions) to people use a grid: rows are people, columns are attributes. Fill in definite facts, then use "not" clues to cross out options until only one remains. Always mark crossed-out cells, so you do not redo the work.
Puzzle 4. Five people A, B, C, D and E live on floors 1 to 5 of a building, one to a floor. C lives above A but below B. E lives above C. D lives above E but below B. Who lives on which floor? From the clues, A is below C, C is below E, E is below D, and D is below B. The chain from the bottom is A, C, E, D, B: A on floor 1, C on 2, E on 3, D on 4, B on 5.
floors = [p for p in permutations("ABCDE") # p[0] is floor 1
if p.index("A") < p.index("C") < p.index("B")
and p.index("C") < p.index("E")
and p.index("E") < p.index("D") < p.index("B")]
assert floors == [("A", "C", "E", "D", "B")]
4. Ordering and comparison
Statements like "A is taller than B" form a chain. Combine them into one ordering, writing the tallest on the left.
Puzzle 5. C is taller than A; A is taller than B; D is shorter than B; E is taller than C. Who is the tallest, and who is the shortest? Chain: E > C > A > B > D. Tallest E, shortest D; the third tallest is A.
people = [p for p in permutations("ABCDE") # tallest first
if p.index("C") < p.index("A") < p.index("B") < p.index("D") and p.index("E") < p.index("C")]
assert people == [("E", "C", "A", "B", "D")]
If the clues do not give a unique chain, the result of "who is the second tallest?" may be undetermined: say "cannot be determined" rather than guessing.
5. Syllogisms
A syllogism gives statements about groups and asks which conclusions definitely follow. The four statement types:
| Form | Meaning |
|---|---|
| All A are B (universal affirmative) | A is entirely inside B |
| No A is B (universal negative) | A and B do not overlap |
| Some A are B (particular affirmative) | A and B overlap, at least slightly |
| Some A are not B (particular negative) | part of A lies outside B |
Rules of thumb: "Some A are B" is equivalent to "Some B are A". "All A are B" does not give "All B are A" and does not give "Some B are A" for free, though in a standard test it does allow "Some A are B". A conclusion follows only if it holds in every Venn diagram consistent with the premises, not just one drawing.
The reliable method is to try all consistent diagrams. A program can do that exactly by listing which of the eight regions of a three-set Venn diagram are occupied.
REGIONS = list(product([0, 1], repeat=3)) # membership in (A, B, C)
def models():
for occupancy in product([0, 1], repeat=8):
cells = {r for r, o in zip(REGIONS, occupancy) if o}
if all(any(r[i] for r in cells) for i in range(3)): # every named group has at least one member
yield cells
def All(x, y): return lambda c: all(r[y] for r in c if r[x])
def No(x, y): return lambda c: not any(r[x] and r[y] for r in c)
def Some(x, y): return lambda c: any(r[x] and r[y] for r in c)
def SomeNot(x, y): return lambda c: any(r[x] and not r[y] for r in c)
def follows(premises, conclusion):
return all(conclusion(c) for c in models() if all(p(c) for p in premises))
A, B, C = 0, 1, 2
assert follows([All(A, B), All(B, C)], All(A, C)) # All A are B, All B are C: All A are C
assert not follows([All(A, B), Some(B, C)], Some(A, C)) # the overlap of B and C may miss A entirely
assert follows([All(A, B), Some(B, C)], Some(C, B)) # "some" statements are symmetric
assert follows([All(A, B), No(B, C)], No(A, C))
assert follows([Some(A, B), All(B, C)], Some(A, C))
assert follows([No(A, B), All(C, B)], No(C, A))
assert not follows([Some(A, B), Some(B, C)], Some(A, C)) # two overlaps need not chain
assert not follows([All(A, B), All(C, B)], All(A, C)) # A and C can be different parts of B
assert not follows([All(A, B), All(C, B)], Some(A, C))
assert follows([All(A, B), No(C, B)], SomeNot(A, C)) # all of A is in B, which does not touch C
Worked results
| Statements | Conclusion | Follows? |
|---|---|---|
| All A are B, All B are C | All A are C | Yes |
| All A are B, Some B are C | Some A are C | No: the part of B that is C may not include any A |
| All A are B, Some B are C | Some C are B | Yes (conversion of "some") |
| All A are B, No B is C | No A is C | Yes |
| Some A are B, All B are C | Some A are C | Yes |
| No A is B, All C are B | No C is A | Yes |
| Some A are B, Some B are C | Some A are C | No (two overlaps need not meet) |
| All A are B, All C are B | All A are C | No (both lie in B, perhaps apart) |
| All A are B, No C is B | Some A are not C | Yes |
"Either-or" cases. If two conclusions are complementary (such as "Some A are B" and "No A is B") and neither follows by itself but one of them must hold, the answer is "either conclusion I or II follows". Use this rule only when the two are exact opposites and nothing else decides it.
6. Venn diagrams with numbers
For overlapping groups use inclusion-exclusion: , and for three sets .
Example 1. Of 100 students, 60 play cricket, 50 play football and 20 play both. How many play neither, and how many play only one game? Union , so neither . Only cricket , only football .
Example 2. In a survey of 200 people, 120 read newspaper P, 90 read Q, 70 read R, 50 read P and Q, 40 read Q and R, 30 read P and R, and 20 read all three. How many read none? Union , so none .
assert 100 - (60 + 50 - 20) == 10 and (60 - 20, 50 - 20) == (40, 30)
assert 200 - (120 + 90 + 70 - 50 - 40 - 30 + 20) == 20
7. Truth-tellers and liars (knights and knaves)
Each person always tells the truth (a knight) or always lies (a knave). Test each assignment: a knight's statement must be true and a knave's statement must be false.
Puzzle 6. A says, "B is a knave." B says, "A and I are the same type." What are A and B? If A is a knight then B is a knave, and B's statement "we are the same type" would then be false, which suits a knave: consistent. If A is a knave, B must be a knight, and then B's statement says they are the same type, which is false, so B would be lying: contradiction. So A is a knight and B is a knave.
Puzzle 7. A says, "Exactly one of us is a knave." B says, "Exactly two of us are knaves." C says, "All of us are knaves." Who is what? Only B can be telling the truth, so B is a knight, A and C are knaves.
sols = [(a, b) for a, b in product([True, False], repeat=2) # True means knight
if a == (not b) and b == (a == b)]
assert sols == [(True, False)]
sols3 = []
for a, b, c in product([True, False], repeat=3):
knaves = sum(not x for x in (a, b, c))
if a == (knaves == 1) and b == (knaves == 2) and c == (knaves == 3):
sols3.append((a, b, c))
assert sols3 == [(False, True, False)]
8. Statements and conclusions, assumptions, arguments
Common verbal-logic formats:
- Statement and conclusions: a conclusion follows only if it is directly supported by the statement, not by outside knowledge.
- Statement and assumptions: an assumption is something the statement takes for granted. Test it by negating: if the statement would collapse without it, it is an assumption. Example: "Use our toothpaste for strong teeth" assumes that people want strong teeth.
- Strong and weak arguments: a strong argument is relevant, specific and important. An argument based on a single example, a personal opinion or an emotive claim is weak.
- Course of action: the action must address the problem stated and be practical.
- Cause and effect: decide whether one is the cause of the other, both are effects of a common cause, or they are independent.
Practise by always asking: what exactly does the text say, and what would have to be true for this to follow?
9. Data sufficiency
You are asked whether the given statements suffice to answer a question. The standard options: (A) statement 1 alone is sufficient; (B) statement 2 alone is sufficient; (C) both together are needed; (D) either alone is sufficient; (E) neither is sufficient even together.
Example 3. What is the value of ? (1) . (2) . Statement 1 gives or , which is not unique. Statement 2 alone gives nothing specific. Together they give : (C).
domain = range(-10, 11)
s1 = [x for x in domain if x * x == 9]
s2 = [x for x in domain if x > 0]
both = [x for x in s1 if x > 0]
assert s1 == [-3, 3] and len(s2) == 10 and both == [3]
The test is whether the set of values left is exactly one. Do not solve the question beyond what is needed.
10. A systematic approach for any puzzle
- List every entity and attribute and set up the skeleton.
- Place the definite clues first.
- Take negative clues ("not next to", "not at the end") and cross out options.
- Look for a unique fit, then propagate.
- Check every clue against the final arrangement.
- Answer from what holds in all arrangements if more than one remains.
11. Common traps
- Mixing up left and right (draw who faces which way).
- Treating "some" as "all", or "not all" as "none".
- Using real-world knowledge in a syllogism ("all cats are animals" is irrelevant unless stated).
- Assuming a seating is unique when only a mirror image or one extra possibility remains.
- Skipping the check of the final arrangement against every clue.
- Treating "adjacent" as "to the immediate left" (adjacent means either side).
- Spending too long on one puzzle; a well-drawn skeleton and a clear order of clues usually solve it in two minutes.
12. Practice set with answers
- Six people sit in a row. A is to the left of B, and C is to the right of B but to the left of D. E is at the left end. F is somewhere to the right of D. In what order do they sit, from left to right?
- All pens are books; some books are tables. Which conclusions follow? (i) Some pens are tables. (ii) Some tables are books. (iii) Some books are pens.
- In a group of 90, 50 speak Hindi, 40 speak Tamil, and 15 speak both. How many speak neither?
- A is older than B; C is younger than B; D is older than A. Who is the youngest and who is the oldest?
- A says "I am a knave." Can this be said by a knight? By a knave?
- P is the only brother of Q; Q is the mother of R. How is P related to R?
- How many ways can 3 men and 3 women sit alternately in a row of 6?
- Statements: "All who passed the screening are invited. Meera was invited." Conclusion: Meera passed the screening. Does it follow?
row = [p for p in permutations("ABCDEF")
if p[0] == "E" and p.index("A") < p.index("B") < p.index("C") < p.index("D") < p.index("F")]
assert row == [("E", "A", "B", "C", "D", "F")]
assert not follows([All(A, B), Some(B, C)], Some(A, C)) # (i) does not follow (A = pens, B = books, C = tables)
assert follows([All(A, B), Some(B, C)], Some(C, B)) # (ii) follows
assert follows([All(A, B)], Some(B, A)) # with non-empty groups, "all pens are books" gives "some books are pens"
assert 90 - (50 + 40 - 15) == 15
older = [p for p in permutations("ABCD") if p.index("D") < p.index("A") < p.index("B") < p.index("C")]
assert older == [("D", "A", "B", "C")] # oldest first: D, A, B, C
patterns = {m for m in permutations("MMMWWW") if all(m[i] != m[i + 1] for i in range(5))}
assert len(patterns) == 2 and len(patterns) * 6 * 6 == 72 # two alternating gender patterns, 3! orders of men, 3! of women
Answers: 1) E, A, B, C, D, F; 2) (ii) and (iii) follow, (i) does not; 3) 15; 4) youngest C, oldest D; 5) a knight cannot say it (it would be false), and a knave cannot say it either (it would be true), so no one on such an island can say "I am a knave"; 6) uncle (P is Q's brother, so he is R's maternal uncle); 7) 72 ways (2 patterns for the genders, times for the men, times for the women); 8) no, the conclusion does not follow: being invited is known to be a consequence of passing, not a proof that passing happened (Meera may have been invited for another reason).