3 ms·
Here's a similar one: What's the best possible time complexity of a program that plays perfect chess, assuming we could write such a program? Answer: O(1), sin
by jks 7y ago
Here's a similar one: What's the best possible time complexity of a program that plays perfect chess, assuming we could write such a program?
Answer: O(1), since it could be written as one big lookup table from game state to optimal move. To get a nontrivial complexity class, you have to have some parameter that can vary, so e.g. the question "what's the time complexity of a program that plays perfect chess on an n-by-n board?" (assuming a suitable generalization of the chess rules is given) is much harder to answer.
- clarry 7y agoI think that works only if n-by-n can vary to infinity. Otherwise I'll just have a lut for every possible board size. By the same method, you can sort any finite sequence in O(1).. but then you don't really sort infinite sequences, do you? So I'm not sure this is a good trick question.