- Recognise and build “object–property” and “object–object” tables.
- Move verbal conditions into a “+ / –” table and solve a logic puzzle step by step.
- Use count conditions (everyone has 2 items, n people in total) and ordering conditions (left, right, the mean).
- Check every option against the table in a “which statement is true” task.
Four friends, four surnames, five or six short sentences and a question: “Which statement is true?” A logic puzzle like this appeared once in every informatics paper of the 2025–2026 entrance exams in Azerbaijan (group I), under the topic “Table information model”. If you try to keep the sentences in your head, everything gets tangled; once you move them into a table, the puzzle almost solves itself.
In the lesson “Models and modelling” we saw that a table is one kind of information model. In this lesson we use the table as a tool for solving problems.
Two types of table models
Objects are written in the rows and their properties in the columns; a cell holds the value of that property for that object. Examples: a class register, a library catalogue (author, title, year), a price list.
Objects are written both in the rows and in the columns; a cell shows the relation between two objects: a distance, the result of a game, or a “+” (they match) or “–” (they do not). The tables for logic puzzles are of this type.
The table below shows the lengths of the roads between four villages K, L, M and N in kilometres. It is an “object–object” table. Notice two properties: the main diagonal holds zeros (the distance from a village to itself is 0), and the table is symmetric about the diagonal (K to L is as far as L to K).
| K | L | M | N | |
|---|---|---|---|---|
| K | 0 | 12 | 7 | 15 |
| L | 12 | 0 | 9 | 6 |
| M | 7 | 9 | 0 | 10 |
| N | 15 | 6 | 10 | 0 |
- nthe number of objects (villages, teams)
The number of different pairs of n objects: a symmetric table needs exactly this many different numbers, and there are twice as many non-zero cells, n · (n − 1).
According to the table above, which statement is true?
A) The village nearest to L is M
B) Going from K to L and then to N is shorter than going from K to N directly
C) The table has 6 non-zero cells
D) The greatest distance is between K and N
E) The distance K–M is greater than M–N
Extra question: with 6 villages, how many different distances would the table hold?
Show solutionHide solution
B: 12 + 6 = 18 km, directly it is 15 km ✗.
C: 4 of the 16 cells are on the diagonal, so 12 cells are non-zero ✗.
D: the greatest number in the table is 15, for K and N ✓.
E: 7 < 10 ✗.
Answer: D.
Extra question: 6 · 5 / 2 = 15 different distances (and 30 non-zero cells).
| Day | 1 | 2 | 3 |
|---|---|---|---|
| Monday | Maths | Informatics | History |
| Tuesday | Physics | Maths | Literature |
| Wednesday | Informatics | Chemistry | Maths |
According to the timetable, which statement is true?
A) Maths is the same lesson number every day
B) Informatics takes place twice, on two different days
C) On Tuesday the 2nd lesson is Physics
D) Chemistry is on Monday
E) History takes place 3 times
Show solutionHide solution
Answer: B. In such a task it is enough to “read” the table row by row and column by column.
The “+ / –” method step by step
In the most common puzzle the elements of two sets are matched one to one: every person has one surname and every surname has one owner. For such a puzzle you build an “object–object” table and write “+” (yes) or “–” (no) in the cells.
- 1Build the table
Write one set (names) in the rows and the other (surnames, projects, places) in the columns.
- 2Direct facts
“X is not Y” → “–”, “X is Y” → “+”.
- 3Hidden facts
“X and Y play football” means X and Y are two different people, so X’s surname is not Y. People with different properties (a footballer and a chess player, one who got 5 and one who got 3) cannot be the same person either.
- 4The row–column rule
As soon as you put a “+”, fill the rest of its row and column with “–”. If a row or column has one empty cell left and no “+”, put a “+” there.
- 5Check
When the table is full, check all the conditions again, then compare the options with the table one by one.
The one-to-one rule: an n × n table ends with n “+” signs and n · (n − 1) “–” signs.
Aysel, Murad and Leyla go to three clubs: chess, swimming and drawing (one club each, one person per club). Murad goes neither to swimming nor to drawing. Aysel does not go to swimming. Which statement is true?
A) Leyla goes to chess B) Murad goes to swimming C) Leyla goes to drawing D) Aysel goes to chess E) Aysel goes to drawing
Show solutionHide solution
Aysel: chess “–”, swimming “–” → drawing “+”.
Leyla: only swimming is left → “+”.
Answer: E.
The surnames of Tural, Nihad, Rauf and Elmar are Tahirov, Nuriyev, Ramazanov and Eyvazov (one each). Each of them plays either football or chess. It is known that:
— Tural and Ramazanov play football, while Nihad and Eyvazov play chess;
— Tahirov is older than Nuriyev, and Elmar is younger than Nuriyev;
— Rauf does not play chess;
— Nihad is older than Tural.
Find the true statement.
A) Nihad’s surname is Nuriyev B) Elmar is older than Tural C) Rauf plays chess D) Tahirov is older than Tural E) Eyvazov plays football
Show solutionHide solution
2) Second condition: Elmar is younger than Nuriyev, and Tahirov is even older than Nuriyev → Elmar ≠ Nuriyev, Elmar ≠ Tahirov.
3) Rauf does not play chess, but Eyvazov does → Rauf ≠ Eyvazov.
4) The Eyvazov column has three “–” → Elmar is Eyvazov. The Ramazanov column has “–” for Tural, Nihad and Elmar → Rauf is Ramazanov.
5) Tahirov and Nuriyev are left for Tural and Nihad. If Tural were Tahirov, Nihad would be Nuriyev and Tural would be older than Nihad, which contradicts the fourth condition. So Tural is Nuriyev and Nihad is Tahirov.
Options: A ✗; B — Elmar is younger than Nuriyev, i.e. than Tural ✗; C ✗; D — Tahirov is Nihad, who is older than Tural ✓; E — Eyvazov (Elmar) plays chess ✗.
Answer: D.
Puzzles with count conditions
Sometimes one object gets several “+”: every project has 2 workers, every buyer bought 2 items. Then the rule “one + per row” no longer works; instead you are given the totals of the rows and columns. The “+” signs can be counted in two ways — by rows and by columns — and the result must be the same. This is both a check and often the key to the solution.
The check sum: if each of 6 people bought 2 items, the column totals must also add up to 6 · 2 = 12.
A company’s 8 employees — Aysel, Bahar, Kamal, Leyla, Emin, Fidan, Samir and Zaur — work on 4 projects: Atlas, Delta, Neo and Sigma. Each project has exactly 2 people and each employee works on one project. It is known that:
— Kamal works on Sigma;
— Leyla and Fidan work on the same project, which is neither Atlas nor Sigma;
— one of the Atlas workers is Bahar, the other is not Zaur;
— Samir works on Neo;
— neither Aysel nor Zaur works on Kamal’s project.
Who works on the same project as Aysel?
A) Kamal B) Emin C) Bahar D) Zaur E) Leyla
Show solutionHide solution
1) Kamal — Sigma, Bahar — Atlas, Samir — Neo.
2) Leyla and Fidan together can be on Delta or Neo. Neo already has Samir and only 1 place left → Leyla and Fidan are on Delta. Delta is full.
3) Three places are left for Aysel, Emin and Zaur: Atlas (1), Neo (1), Sigma (1). Zaur is not on Atlas and not with Kamal (Sigma) → Zaur is on Neo.
4) Aysel is not with Kamal → Aysel is on Atlas and Emin on Sigma.
Result: Atlas — Aysel, Bahar; Delta — Leyla, Fidan; Neo — Samir, Zaur; Sigma — Kamal, Emin. Answer: C.
Aynur, Kamran, Nigar, Davud and Elnur bought apples, pears, plums and peaches at the market. It is known that:
— everyone bought 2 different kinds of fruit;
— 3 people bought apples, 2 bought pears, 2 bought plums and 3 bought peaches;
— Aynur and Davud bought the same fruits;
— Kamran bought no apples, Elnur no plums and Nigar no peaches;
— nobody bought both apples and pears;
— Kamran and Nigar did not buy the same fruits.
Which statement is true?
A) Davud bought pears B) Elnur bought apples C) Nigar bought apples and plums D) Kamran bought peaches E) Aynur bought plums
Show solutionHide solution
1) The key: 3 people bought apples and 2 bought pears, 5 in all — as many as there are people — and nobody bought both. So everyone bought exactly one of apples/pears and exactly one of plums/peaches.
2) Nigar bought no peaches → plums; Elnur bought no plums → peaches. If Aynur and Davud had bought plums, there would be 3 plum buyers (not 2) → both bought peaches. Peaches already have 3 buyers (Aynur, Davud, Elnur) → Kamran bought plums.
3) Kamran bought no apples → pears. If Aynur and Davud had bought pears, there would be 3 pear buyers → both bought apples. Of Nigar and Elnur, one bought apples and one pears. If Nigar had bought pears, her fruits would equal Kamran’s (pears, plums) → Nigar apples, Elnur pears.
Answer: C.
Ordering puzzles
In an ordering puzzle, objects are matched to places: the 1st, 2nd, … book on a shelf from left to right, the 1st, 2nd, … person in a queue. The columns of the table are the place numbers, and the conditions sound like “to the left”, “to the right”, “right next to”, “there are two people between them”. Conditions with numbers often use the mean.
- a₁, …, aₙthe numbers (page counts, scores)
- nhow many numbers there are
The mean. Finding it and seeing which object it belongs to is often the first step of an ordering puzzle.
Five books with white, green, blue, red and black covers stand on a shelf from left to right in order of increasing number of pages. The books have 120, 135, 145, 150 and 200 pages. It is known that:
— the red book has as many pages as the mean of all the books;
— the blue book is to the right of the green one and to the left of the black one;
— the white book is either the leftmost or the rightmost;
— the black book is thicker than the red one.
How many pages does the blue book have?
A) 120 B) 135 C) 145 D) 150 E) 200
Show solutionHide solution
2) The black book is thicker than the red one → black has 200 pages, 5th place.
3) The white book cannot be rightmost (black is there) → white is in 1st place.
4) Green and blue are left for places 2 and 3, and blue is to the right of green → green is 2nd (135), blue is 3rd (145).
Answer: C.
Anar, Bahar, Tahir, Sevda and Emil stand in a queue. It is known that:
— Bahar is neither first nor last;
— there are exactly two people between Anar and Emil;
— Tahir stands right behind Bahar;
— Sevda is ahead of Anar.
Which statement is true?
A) Sevda is first in the queue B) Tahir is ahead of Bahar C) Bahar is fourth D) There are two people between Emil and Tahir E) Anar is third
Show solutionHide solution
2) If they are 1 and 4: in places 2, 3, 5 Bahar with Tahir right behind her fits only into 2 and 3, and Sevda would be 5th. But Sevda must be ahead of Anar, who is 1st or 4th — a contradiction.
3) So Anar and Emil are in places 2 and 5. Places 1, 3, 4 remain: Bahar 3rd, Tahir 4th, Sevda 1st.
4) Which of Anar and Emil is 2nd and which is 5th stays unknown — but the question does not need it.
A ✓; B, C, E ✗; D — Emil is 5th or 2nd and Tahir is 4th: between them there is nobody or one person ✗.
Answer: A.
Samir, Leyla, Murad and Fidan scored 60, 70, 80 and 90 points in a test (all different). Leyla’s score is the mean of Samir’s and Murad’s scores. Fidan scored more than Leyla, and Samir more than Murad. Which statement is true?
A) Murad scored 70 B) Samir scored 60 C) Leyla scored 80 D) Leyla scored more than Samir E) Fidan got the highest score
Show solutionHide solution
2) If Leyla had 80, Samir and Murad would have 70 and 90 and Fidan would be left with 60 — but Fidan scored more than Leyla ✗.
3) So Leyla has 70, Samir and Murad have 60 and 80, and Fidan 90. Samir scored more than Murad → Samir 80, Murad 60.
Answer: E.
Puzzles with three features and typical mistakes
Sometimes two properties of every person are wanted: their city and their job. Then you build two tables (name–city and name–job), and conditions such as “the doctor lives in Shaki” link them: every “+” found in one table gives a result in the other.
Narmin, Orkhan and Parviz live in Baku, Ganja and Shaki; one of them is a doctor, one a teacher and one an engineer. It is known that:
— the doctor lives in Shaki;
— Orkhan is not a teacher and does not live in Baku;
— Narmin lives in Ganja;
— Parviz is not an engineer.
Which statement is true?
A) The teacher lives in Baku B) Narmin is a doctor C) Orkhan lives in Ganja D) Parviz is an engineer E) The engineer lives in Shaki
Show solutionHide solution
2) From city to job: the doctor lives in Shaki, and Orkhan lives in Shaki → Orkhan is the doctor.
3) Name–job table: Parviz is neither the engineer nor the doctor → teacher; Narmin → engineer.
Result: Narmin — Ganja, engineer; Orkhan — Shaki, doctor; Parviz — Baku, teacher.
Answer: A.
Tables are not only for logic puzzles: in the following lessons you will see that the adjacency matrix of a graph is also an “object–object” table. Next lesson: “Tree information models”.
Key points
- In an “object–property” table rows are objects and columns are properties; in an “object–object” table both are objects and a cell shows how they are related.
- A distance table is symmetric with zeros on the diagonal; n objects need n · (n − 1) / 2 different numbers.
- In a one-to-one puzzle every row and column has exactly one “+”; once a “+” is placed, its row and column are filled with “–”.
- “X and Y …” means X ≠ Y; people with different properties cannot be the same person.
- With count conditions the row totals and the column totals add up to the same number — a check and often the key.
- The answer is the statement that must be true by the table; sometimes the question does not need the full solution.
Check yourself
12 questions. Every correct answer earns XP.