# Puzzle based on ranking

Seven persons - A, B, C, D, E, F and G – each of different height live on different floors of a seven storeyed building. The ground floor is considered the first floor and the floor just above the ground floor is considered second floor and so on. The following information is known about their heights and the floors on which they live.

Only two persons are shorter than E who lives neither on the third floor nor on the topmost floor. The number of persons who live between A and D is half the number of persons who live between C and G. G lives two floors above D who is neither the tallest nor the third tallest person. Both A and G the taller than both B and C. The one who is the tallest lives on the middle floor. The number of persons taller than B is equal to the number of persons shorter than G. The one who lives on the third floor is not the shortest.

## Find the floors in which the people live and the ranking based on their height.

Source: Top rankers question bank

Or go to

here --> Banking and Insurance --> SBI PO 2018 --> Attempt the first free test --> go to question 93

• What question are you asking? I see the setup for a puzzle, but am not sure what's being asked Apr 22, 2018 at 17:36
• My assumption is determine who lives on what floor but yeah no question was explicitly stated...
– Einb
Apr 22, 2018 at 17:37
• I think to put the order of the heights of a b - g and the level they live on. Apr 22, 2018 at 17:37
• Has a correct answer been given? If so, please don't forget to $\color{green}{\checkmark \small\text{Accept}}$ it :)
– Rubio
Apr 30, 2018 at 7:33

## Known facts

Rewriting the information provided:

1. E is #3 by height.
2. E doesn't live on the 3rd or 7th floors.
3. The number of floors between A and D is half the number of floors between C and G. (So these numbers are respectively (1,2) or (2,4), assuming the trivial (0,0) case is implicitly excluded.1)
4. G lives two floors above D.
5. D isn't #5 or #7 by height.
6. A and G are taller than B and C. (So A and G aren't #1 or #2 by height, while B and C aren't #6 or #7.)
7. The #7 by height lives on the 4th floor.
8. The number of people taller than B equals the number shorter than G.
9. The #1 by height does not live on the 3rd floor.

## Deductions

Putting fact 8 together with the knowledge from fact 6 that G is taller than B, we know that B and G are respectively (#1,#7) or (#2,#6) or (#3,#5) by height. Fact 1 excludes (#3,#5). If it's (#1,#7), then G lives on the 4th floor by fact 7, so D lives on the 2nd floor by fact 4. By fact 3, contradiction. So

B, E, and G are respectively #2, #3, #6 by height.

By facts 5 and 6, the #7 by height isn't C or D, so it must be A or F.
If it's A, then A lives on the 4th floor. By fact 3, D must live on the 1st, 2nd, 6th, or 7th floor. By fact 4, it can't be the 2nd, 6th, or 7th. So D lives on the 1st floor and G on the 3rd floor. By fact 3, contradiction.

So F is #7 by height and lives on the 4th floor. By fact 5, the #5 by height must be one of A and C; so by fact 6, it's A.

Let's consider facts 3 and 4 together.

• If there's one floor between A and D, then there are two between C and G; in this case, A lives two floors below D and four below G, so C lives three floors below G, between A and D: ?,A,C,D,*,G,?. None of A, C, D, G are on the 4th floor, so we must have them respectively on the 1st, 2nd, 3rd, 5th floors, with two more floors above G.
• If there's two floors between A and D, then there are four between C and G. Option one: A lives three floors below D and five below G, leaving nowhere for C, contradiction. Option two: A lives three floors above D and one above G while C lives five floors below G: ?,C,*,*,D,*,G,A,?. In this case, A, C, D, G must live respectively on the 7th, 1st, 4th, 6th floors. But F is on the 4th floor, contradiction.

So it must be the first of the above bullet points that applies. Now B and E must live on the 6th and 7th floors, and we know which way round by fact 2. Also, C and D must be #1 and #4 by height, and we know which way round by fact 9 since D lives on the 3rd floor.

A #5 1st
B #2 7th
C #1 2nd
D #4 3rd
E #3 6th
F #7 4th
G #6 5th

1 I found this to be a natural assumption, as (0,0) seems like a 'trick' solution not in the spirit of the puzzle. Turns out this assumption is also required for the puzzle to have a unique solution - see NL628's answer for a valid alternative solution if (0,0) is permitted.

• Yeah this is def the correct answer :D Good job :P Apr 22, 2018 at 20:05
• I was very confused at first by the fact you were ranking the height with the shortest as #1 rather than the tallest... Also was there any specific reason to exclude the 0,0 case for your data point #3 or just a guess that the puzzle creators probably didn't have that in mind? I'd personally have assumed 0,0 was possible until I proved otherwise. Edit: I see from comments on another answer that excluding this gives uniqueness which is a reasonable reason to exclude it in my opinion (sine the creators almost certainly intended a unique solution so you can use this fact to guess their intent). Apr 23, 2018 at 8:26
• @Chris 1 is a smaller (shorter) number than 7 :-P Re (0,0), it seemed natural to me to exclude that 'trick' solution anyway, and I'd started working on this answer before realising what the problem was with NL628's answer. But maybe I should add a note to justify the assumption ... Apr 23, 2018 at 12:07
• Yeah. I think an extra note would be good - I certainly thought 0,0 would be acceptable (probably because I'm a mathematician so think like that) so adding a note would probably be worthwhile. Especially since there is a better reason than "I don't think that is what the puzzle author intended". Though of course whether ensuring uniqueness is a valid reason to make a choice in a puzzle is another matter. :) Apr 23, 2018 at 12:09
• @Chris Done :-) (I'm also a mathematician, which is probably why I thought to even mention this trivial case at all, even in order to exclude it!) Apr 23, 2018 at 13:06

I feel that there is more than one solution...

But here is one that I found.

In order of shortest to tallest,

BCEDFAG

In order from 1st floor to 7th floor,