HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Is it possible for the runtime and input size in an algorithm to be inversely related?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
thesizeruntimerelatedinputalgorithmpossibleforandinversely

Problem

I'm wondering if it's possible for algorithms that have monotonically decreasing runtime with the input-size - just as a fun mental exercise. If not, is it possible to disprove this claim? I haven't been able to come up with an example or counterexample so far, and this sounds like an interesting problem.

P.S. Something like $O(\frac{1}{n})$, I guess (if it exists)

Solution

Try brute force searching of a key for a cryptographic algorithm. The more of the key you give it to start with, the less you have to search for. True that trend stops at the limit of keysize (but that's still monotonic), and there are probably other examples in the field of extensive search where the more input data, the easier it is to prune branches of the potential tree.

Context

StackExchange Computer Science Q#129853, answer score: 10

Revisions (0)

No revisions yet.