Sort A, B, C, D and E

Logic Level 2

There are 5 people, A , B , C , D , E A, B, C, D, E that are standing in a line facing to the left. A A can see no one, while E E can see everyone. Starting with A A , each of them is asked "How many people standing before you are also taller than you are?". The replies from each of them were 0, 1, 1, 0 and 1 respectively.

Arrange these 5 people according to their height, starting with the shortest.

Note: Assume that no two people have the same height.

BAEDC BACED ABCED BCAED

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Nisarg Thakkar
Apr 11, 2014

A-B-C-D-E are standing in this order.

  • A will obviously reply 0,
  • B says 1 so, A>B
  • C says 1, so B cant be taller than C, otherwise C's reply would be 2. so, from this, we get A>C>B
  • now, D says 0 so he is the tallest among A,B,C, and D
  • E says 1 so applying same logic as in C's case above, we get D>E>A>C>B.

we want in ascending order, so BCAED.

Ugh! I really need to observe more carefully.

A Former Brilliant Member - 7 years, 1 month ago

If E is shorter than D, how can E see everyone ?

Chandrodoy Chattopadhyay - 5 years, 4 months ago

Log in to reply

Had the same question. Probably everyone can see all others in front them except A obviously. We can also infer this by the answers, none of which has E as the taller.

John Miller - 5 years ago

'E' is not a machine that he cannot jump or tilt sideways... :)

Avinash Kamath - 4 years, 6 months ago

How is this related to computer science?

Adarsh Kumar - 7 years, 1 month ago

Log in to reply

In an array ordering, obviously.

Normando Mendonça - 7 years, 1 month ago

why doesn't this question bring into account of the fact that having a taller guy in front of you will block your vision ?

InkWhite 2000 - 5 years, 1 month ago

Log in to reply

'E' is not a machine that he cannot jump or tilt sideways... :)

Avinash Kamath - 4 years, 6 months ago

wow!good solution

Ayush Sharma - 5 years, 10 months ago

poorly worded question; I assumed no-one can see past a taller person in which case there is no solution. Looking at the answer I realise that my assumption is wrong else E would only 'see' D (the others being obscured). . Also if you are facing left there is no-one 'before' you. Bad English

Stuart McGuinness - 4 years, 8 months ago
Frodo Baggins
Apr 15, 2014

Since B says 1, A is taller than B. C also says 1, so either A or B is taller than C, but if B was taller than C, then A would be too and C would have said 2. The only option with A taller than B and C is BCAED.

Levi Titan
Jul 20, 2014

ABCDE 01101. This is just sorting from left to right. Person A sees nobody taller so he stays in position. Person B sees 1 taller so switches places with A. The numbers are now 00101

Person C sees 1 person taller so switches places with B. 00001

ABCDE = 01101

BACDE = 00101

BCADE = 00001

BCAED = 00000

You can infer from this that you just move from left to right. If the letter is 1 it switches places with the letter left of it. If the letter = 0 it remains in position.

Lokesh Chauhan
May 25, 2014

ABCDE are arranged facing left When A says 0, there's no one taller than him When B says one, it means A is taller than B So the sequence now will be BACDE Now again C said there's one bigger than him. So the sequence now will be BCADE And there's only one option with BCA in starting So no need to check others.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...