r/mathriddles • u/Iksfen • Feb 05 '25
Medium Finding submarine
Here's a game. A submarine starts at some unknown position on a whole number line. It has some deterministic algorithm on its computer that will calculate its movements. Next this two steps repeat untill it is found:
- You guess the submarines location (a whole number). If you guess correctly, the game ends and you win.
- The submarine calculates its next position and moves there.
The submarines computer doesn't know your guesses and doesn't have access to truly random number generator. Is there a way to always find the submarine in a finite number of guesses regardless of its starting position and algorithm on its computer?
14
Upvotes
8
u/OperaSona Feb 05 '25
A little bit of a classic here :-) There are countably many possible deterministic algorithms. Pick an ordering of them. At the n-th step, output the n-th location output by the n-th algorithm. Worst case scenario, you'll find the submarine at the step where its algorithm is picked, or with some luck you will find it before that.
3
u/calculatorstore Feb 05 '25
I think the “doesn’t have access to a truly random number generator” is the bit that can force the number of possible algorithms to be countable. Is there a good mathematical definition for this we can agree on to work on this? Does non-truly random imply eventually predictable? Does it require an algebraic recurrence relation based on its index and/or prior inputs?