Last reviewed 22 Sept 2026 · 5 min read
The one formula
For a single line of people, where a person is th from one end and th from the other:
The is because that person is counted from both ends. Rearranged, .
Everything in this chapter is that formula, applied carefully.
Counting between two people
If two people are at positions and from the same end, the number between them is , and the number from one to the other inclusive is .
"How many are between A and B" excludes both. "How many from A to B" includes both. One word changes the answer by two.
When the counts overlap
If a class has students and someone is th from the top and th from the bottom with , then people have been counted twice — this is the standard "overlap" question, and the two positions describe different lines or a ranking with ties stated in the question.
Conversely, if , there are people who are neither.
Comparison puzzles
"A is taller than B, C is shorter than B, D is taller than A" — draw a single line, tallest at the left, and place each name as it arrives. Use > between names and never keep two half-finished lines. The questions asked are: who is tallest, who is shortest, who is in the middle, and which statement cannot be determined.
Cannot be determined is a real answer here: if the puzzle never compares C with D, no ordering between them may be claimed.
Interchanged positions
When two people exchange places, everyone else stays put. If A was 7th from the left and after exchanging with B becomes 11th from the left, then B was 11th; and if the question also gives A's new rank from the right, the total follows from the formula.
Worked examples
In a row, Ram is 7th from the left and 12th from the right. How many are in the row?
Solution. 18.
In a class of 40, Sita is 15th from the top. What is her rank from the bottom?
Solution. 26th.
In a queue, A is 9th from the front and B is 17th from the front. How many stand between them?
Solution. 7.
In a row of 25, P is 8th from the left and Q is 6th from the right. How many are between them?
Solution. Q's position from the left is → between 11.
In a class, a boy is 10th from the top and 25th from the bottom, and there are 30 students. How many have been counted twice?
Solution. against 30, so 4 students are counted in both lists.
In a row of 30, A is 8th from the left and B is 9th from the right. How many are neither A, nor B, nor between them?
Solution. B from the left is ; between them . Counting A and B, the block is 15 → 15 others are outside it.
In a row, A is 11th from the left and B is 9th from the right. They exchange places; now A is 17th from the left. How many are in the row?
Solution. After the exchange A stands where B stood, so B was 17th from the left and also 9th from the right → 25.
A is taller than B. C is taller than A. D is shorter than B. Who is the tallest, and who the shortest?
Solution. → tallest C, shortest D.
P is heavier than Q. R is heavier than S. Q is heavier than S. Who is the lightest?
Solution. and , so S is lighter than P, Q and R → S. But the order of R against P and Q cannot be determined.
In a class of 45, Anil ranks 12th in mathematics and 20th from the bottom in science. These are different lines — what can be said about his overall rank?
Solution. Nothing — ranks in two different orderings cannot be combined. The question tests whether the formula is applied blindly.