- Foundation
- About 13 min
- 5 practice questions
Swapping places and shifting positions
Handle questions in which two people exchange places or someone joins or leaves a line, by tracking the position that changes.
If something looks wrong, please tell us.
Some questions change the line: two people swap seats, or someone moves forward a few places. The trick is to remember that only the positions that are named change, and that the total stays the same unless people join or leave.
Principles
When the line changes
- Two people swap Each takes the other's old position.
- Moving k places forward The position from the front drops by k.
- k people join in front Position from the front rises by k; from the back it is unchanged.
- People leave The total falls by the same amount.
- When two people swap, each takes the other's old position.
- If someone moves k places forward in a queue, the position from the front drops by k.
- If k people join in front of a person, that person's position from the front rises by k, and the position from the back is unchanged.
- If people leave from a side, the total falls by the same amount.
Worked examples
Example 1. A is 8th from the left and B is 20th from the left. They swap places. What is A's new position from the left? A takes B's old place: 20th.
Example 2. In a row, R is 12th from the left. After he swaps with S, R is 20th from the left. Where was S originally? S was in R's new position: 20th from the left.
Example 3. In a queue, A is 7th from the front. When 4 people join in front of him, what is his position from the front? 7 + 4 = 11th.
Example 4. Priya is 14th from the left. After she moves 5 places to the right, what is her position from the left, and from the right if the row has 40 people? She is now 14 + 5 = 19th from the left. From the right: 40 - 19 + 1 = 22nd.
Example 5. A is 10th from the left and B is 25th from the left, in a row of 40. They swap. What is A's position from the right? A is now 25th from the left, so from the right 40 - 25 + 1 = 16th.
After a swap, each person simply takes the other's old position. The total does not change.
Key takeaways
- In a swap, the two positions exchange.
- Joining in front adds to the position from the front.
- Recompute the position from the other end with Total - position + 1.
Check your understanding
-
1. A is 6th from the left and B is 15th from the left. They swap places. What is A's new position from the left?
- 6th
- 9th
- 15th
- 21st
Show answer
Answer: C. In a swap each person takes the other's old position, so A moves to B's old place, 15th from the left.
-
2. In a queue, Mira is 12th from the front. Then 5 people join the queue in front of her. What is her position from the front now?
- 17th
- 7th
- 12th
- 16th
Show answer
Answer: A. People joining in front push her back: 12 + 5 = 17th from the front.
-
3. In a row of 36, Kiran is 11th from the left. He moves 6 places to the right. What is his position from the right now?
- 19th
- 20th
- 21st
- 26th
Show answer
Answer: B. New position from the left = 11 + 6 = 17. From the right = 36 - 17 + 1 = 20. The total does not change when someone moves.
-
4. R is 7th from the left. After R swaps places with S, R is 18th from the left. What is S's position from the left now?
- 18th
- 11th
- 25th
- 7th
Show answer
Answer: D. R's new place is S's old place (18th), and S's new place is R's old place, which is 7th from the left.
-
5. In a queue of 20, Om is 5th from the back. Three people join at the front of the queue. What is Om's position from the front now?
- 16th
- 22nd
- 19th
- 18th
Show answer
Answer: C. Before, Om was 20 - 5 + 1 = 16th from the front. Three people join in front of him, so he is now 16 + 3 = 19th. Check: the queue now has 23 and he is still 5th from the back, so 23 - 5 + 1 = 19.
Sign in to keep track of the lessons you finish.