Home Puzzle mathematics – Pursuit-evasion game – Puzzling Stack Exchange

mathematics – Pursuit-evasion game – Puzzling Stack Exchange

0
mathematics – Pursuit-evasion game – Puzzling Stack Exchange

[ad_1]

A criminal has been spotted along a straight single-filed road of length $L$ at position $P$, measured from the left endpoint of the road! Two police officers arrive to the road at positions $A$ and $B$ respectively, also measured from the left endpoint of the road. The chase begins! Pursuit occurs in 1 time unit intervals, of which the following can happen in order:

  1. The police officers can choose to wait, or move to the left or right of where they are by 1 unit distance.

  2. The criminal can choose to wait, or move to the left or right of where he is by 1 or 2 unit distance. However, if a police officer occupies the same position as the criminal, he can only move 1 unit distance now as he needs to perform a manoeuvre to evade them!

  3. The police officer captures the criminal!

What is the longest time the criminal can evade the police officers for?

Assume the following:

  • $0 \leq A \leq L$
  • $0 \leq B \leq L$
  • $0 \leq P \leq L$
  • $A \ne B \ne P$.

Seems like a classic pursuit-evasion question. However, I seem to be missing something. These are my following considerations thus far:

  1. Start tracking $T$, the time the criminal has evaded the police officers for so far.
  2. First, I will just consider $A < B$ as I can freely swap the police officer’s positions anyway.
  3. If the criminal is to the left or right of both police officers, i.e. $P < A$ or $P > B$ where he is not in between them, he can only run to the left or right end of the road, so I will arbitrarily just set $P$ to either be $0$ or $L$. Else, I will note that he was between the officers.
  4. Now, I will make the police officers travel together. This stops the criminal from evading the police officers multiple times in a row if they happen to end up on the same square. So while $B – A > 2$, I will move $B$ to the left and $A$ to the right. Of course, this takes time in itself, so I will increment $T$ for every movement they make.
  5. So here, if the criminal is actually at an endpoint, the solution is fairly simple. You wil simply move either $A$ to the right if the criminal is at the right endpoint ($P = L$) by $L – A – 1$ units, or move $B$ to the left if the criminal is at the left endpoint ($P = 0$) by $B – 1$ units, and catch the criminal there.
  6. However, if the criminal was originally between the officers, I now need to check if there is a space between the officers, and subsequently either move $A$ to the right or $B$ to the left (and also increment $T$). Then, I can say that the officers will catch the criminal in $max(A, L – B)$.

Logically this makes sense to me, but yet it is not the correct answer (solution is implemented as code and ran against test cases using judging software). Any hints or ideas?

[ad_2]

Previous article Developer interview with Arielle Grimes
Next article Ludology: Ludology Episode 42a – TradeMed Trade Goods
Hello there! My name is YoleeTeam, and I am thrilled to welcome you to AmazonianGames.com. As the premier destination for all things related to Amazon Games' universe, we are dedicated to providing you with the most exciting and immersive gaming experiences out there. From captivating visuals to exhilarating gameplay, our website is packed with comprehensive insights, updates, and reviews to keep you ahead of the game. Whether you're a seasoned gamer or new to the scene, I am here to guide you through this virtual frontier. If you have any questions or suggestions, feel free to reach out to me at john@yoleesolutions.com. Embark on your Amazon gaming journey today with AmazonianGames.com and let the adventure begin!