Skip to content
Tutorials Center
My learning

Topics

Lesson 71 of 86 ยท Puzzles and Arrangements

Ranking, Order and Comparison Puzzles

Master rank and position counting, tallest-and-heaviest ordering puzzles, inequality chains and coded inequalities with worked examples and a checker.

Not every reasoning puzzle has seats. Some ask where someone stands in a queue, who ranked where in an exam, who is the tallest of five friends, or whether "P > Q" must follow from a few given relations. All of them are about order, and they all reduce to a handful of small ideas: add two positions and subtract one, chain comparisons, and be careful with the difference between "must be true" and "could be true".

In this lesson you learn the position formulas, how to solve ordering puzzles of the tallest-and-heaviest type, how inequality chains combine (including the coded version with symbols such as @ and #), and how to check a conclusion with a short program.

Position from left and right, rank from top and bottom

Imagine a row of people. If a person is L-th from the left and R-th from the right, then the people counted from either side overlap on that one person. So:

total people = L + R - 1

The same formula covers ranks in a class: someone who is 7th from the top and 35th from the bottom is part of a class of 7 + 35 - 1 = 41 students. And the number of people between two persons at positions p and q (counted from the same side) is |p - q| - 1.

flowchart LR
    L["L people from the left<br/>including the person"] --> M["The person is counted twice"]
    R["R people from the right<br/>including the person"] --> M
    M --> T["Total = L + R - 1"]

The person is counted once from each side, so one is subtracted to count the person only once.

Useful companion facts:

  • Position from the other end: n - k + 1.
  • Swapping seats: when two people exchange places, each takes the other's old position. So "after exchanging, A is 15th from the left" tells you where B's old position was.
  • Overlap of ranks: if A ranks 12th from the top and 28th from the bottom, there are 12 + 28 - 1 = 39 students.

Example 1 (swap). Rahul is 8th from the left in a row. Meena is 9th from the right. They swap places, and Rahul is now 15th from the left. How many people are in the row? Rahul now stands in Meena's old seat, so Meena's seat is 15th from the left and 9th from the right: total = 15 + 9 - 1 = 23. Meena is now in Rahul's old seat, so she is 8th from the left.

Example 2 (between). In a row of 45 students, A is 14th from the left and B is 18th from the right. B's position from the left is 45 - 18 + 1 = 28, so there are 28 - 14 - 1 = 13 students between them.

Tallest, heaviest and oldest: ordering puzzles

Here you get statements like "A is taller than B" and must find the full order or answer questions about it. The method is to write every statement as a short link and join the links into a single line from tallest to shortest.

Worked puzzle 1. Five friends A to E. A is taller than B. C is taller than A. D is shorter than B. E is taller than C.

Join the links: E > C > A > B > D. The order is complete because every neighbor pair was given directly, so E is tallest, D is shortest, and A is third. If one link were missing (say, the E-versus-C statement was dropped), E could stand anywhere above or below the C chain and the puzzle would not have a single answer; the program below shows that.

Worked puzzle 2. Six friends A to F are compared by height. Exactly two people are taller than F. B is taller than F. C is taller than B. A is taller than E. D is the shortest.

"Exactly two people are taller than F" fixes F as 3rd from the tallest. B is above F, so B is 1st or 2nd; C is above B, so C is 1st and B is 2nd. D is the shortest, 6th. A is taller than E, so A is 4th and E is 5th. The order is C, B, F, A, E, D.

Watch out for questions that mix directions: if "exactly three people are shorter than G" in a group of six, then G is 3rd from the tallest, not 3rd from the shortest. Convert to one direction first.

JS Find every order that fits the clues

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Inequalities: chains and conclusions

Inequality questions give relations between letters and ask which conclusion follows. The relations are > (greater than), >= (greater than or equal), < , <= and =. Two rules cover everything.

Rule 1: the chain only works in one direction. You can join relations that point the same way, and the result is as strict as its strictest link.

First link Second link Combined
A > B B > C A > C
A > B B >= C A > C
A >= B B >= C A >= C
A > B B = C A > C
A >= B B = C A >= C

Mixed directions give no relation: from A > B < C you know nothing about A and C (A > B and C > B, so A and C are both above B, but either may be higher).

Rule 2: certain means in every case. A conclusion follows only if it is true in every arrangement allowed by the statements. If it is true in some but not others, it does not follow. If it is false in every case, it is definitely false.

Either-or. When neither of two conclusions is certain on its own, but at least one of them is true in every possible arrangement (for example "A > C" and "A <= C", which cover every possible comparison of A and C), the answer is "either I or II follows". The two conclusions must be about the same pair of letters.

Coded inequalities

Bank exams often replace the signs with symbols. In this lesson we use one common code (always check the code in your exam):

Symbol Meaning
@ greater than (>)
$ greater than or equal to (>=)
# less than (<)
% less than or equal to (<=)
& equal to (=)

Your first step is always to decode the statements into ordinary signs, then solve normally.

Example 3. Statements: J # K, K & L, L % M. This decodes to J < K = L <= M. The chain gives J < M. Conclusion I (J @ M, meaning J > M) is false; conclusion II (J # M, meaning J < M) is true.

Example 4. Statements: P @ Q, Q $ R, R & S. Decoded: P > Q >= R = S. Both P > S and S <= Q follow.

Example 5 (either-or). Statements: A $ B, B % C, so A >= B <= C. Conclusions: I. A @ C (A > C); II. A % C (A <= C). The statements allow A above C and A at or below C, so neither is certain. But together they cover every case, so either I or II follows.

The checker below tries every way of arranging the letters in order (including ties) and reports whether each conclusion is true in all of them, in none, or in some. It is a brute-force version of the same reasoning.

JS Inequality and coded-inequality checker

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Putting it together: a checklist

  1. Rank or position question? Use total = L + R - 1, and n - k + 1 for the other side.
  2. Order puzzle? Write each statement as a link, join into one line, and convert "exactly k taller/shorter" into a rank in one direction.
  3. Inequality question? Decode symbols, check chains (same direction only), then ask whether the conclusion is true in every case. Two conclusions on the same pair may form an either-or.
  4. Still unsure? Try two extreme cases (all letters equal, or all different) to test a conclusion quickly. One counter-example proves it does not follow.

A strict sign wins in a chain: one ">" anywhere in a same-direction chain makes the whole result strict, but a ">=" alone never does.

Next you will move from ordering people to ordering numbers through machines and grids.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Neha ranks 7th from the top and 35th from the bottom in a class. How many students are in the class?

    Total = 7 + 35 - 1 = 41. Neha is counted from both ends, so one is subtracted.
  2. 2. In worked puzzle 1 the order from tallest is E, C, A, B, D. Who is the third tallest?

    Counting from the tallest: E is 1st, C is 2nd, A is 3rd.
  3. 3. Rahul is 8th from the left, Meena is 9th from the right. They swap seats and Rahul is now 15th from the left. How many people are in the row?

    Meena's original seat is 15th from the left and 9th from the right, so the total is 15 + 9 - 1 = 23.
  4. 4. Statements (with @ meaning >, # meaning <, $ meaning >=, % meaning <=): P # Q, Q % R. Which conclusion definitely follows?

    Decoded: P < Q <= R, so P < R. The other three say P > R, P >= R and R <= P, which are all false.
  5. 5. From A > B < C, which of these must be true?

    A and C are both above B, but nothing says which is higher. A > C and A < C are each true in some cases and false in others.

Summary

  • Total people (or rank list) = L + R - 1; position from the other end = n - k + 1; people between two positions = difference - 1.
  • Swapped people take each other's old positions, which gives an extra position clue.
  • In ordering puzzles, join the links into one line and convert every "exactly k" clue to a rank in one direction.
  • A chain of inequalities works only in one direction; a strict link makes the whole result strict.
  • A conclusion follows only if it is true in every possible case; two conclusions on the same pair may form an either-or.

Next: Input-Output, Matrices and Pattern Puzzles.