Home > Riddles > The invisible submarine

The invisible submarine

Timeless ingenuityLevel 5 · Expert · ●●●●●

There is an infinite line of whole squares:

$$ \dots,-2,-1,0,1,2,\dots $$

An invisible submarine has:

  • unknown integer initial position $X$,
  • unknown constant integer velocity $V$ (can be negative, positive or zero).

On turn $t=1,2,3,\dots$, you can shoot a single entire square.
The submarine on turn $t$ is in:

$$ X+Vt. $$

Is there a strategy that guarantees impact in a finite number of turns, regardless of $X$ and $V$?

Hints

Show hints
  1. Since $\mathbb{Z}\times\mathbb{Z}$ is countable, we set an enumeration: $(x_1,v_1),(x_2,v_2),(x_3,v_3),\dots$.
  2. On turn k, you shoot at: x_k+v_k k = X+Vk, which is exactly its actual position.
  3. Yes, there is a guaranteed strategy in finite time.

Solution

Show full solution

Back to problem
Answer: Yes, there is a guaranteed strategy in finite time.
The initial state of the submarine is an integer pair $(X,V)\in\mathbb{Z}\times\mathbb{Z}$.
Since $\mathbb{Z}\times\mathbb{Z}$ is countable, we set an enumeration:

$$ (x_1,v_1),(x_2,v_2),(x_3,v_3),\dots $$

Strategy:

  • on turn $t$, shoot at the square

$$ x_t+v_t\,t. $$

The actual sub has some fixed state $(X,V)$, which matches a list element, say index $k$:

$$ (X,V)=(x_k,v_k). $$

On turn $k$, you shoot:

$$ x_k+v_k\,k = X+Vk, $$

which is exactly its real position.
Therefore, the impact is guaranteed.


Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: The Oracle Who Knows Himself · Next: Dashboard infection →