0
$\begingroup$

It's obvious that we cannot find min (or max) in an array of length n in strictly less than n "steps". It's also well-known that no comparison-based algorithm can sort an array faster than n * log n.

In both of these cases formal proof relies on a simple counting argument: number of all possible inputs to an algorithm is bigger that all its' possible outputs, which such algo can achieve in given time.

In essence, this means that any algorithm that works in general (outputs correct answer for all possible inputs) must "pay" the corresponding "price" -- n units for "max problem" and n * log n units for sorting.

My question: Can we use similar approach to prove lower bounds on time complexity for other polynomial algorithms? For example, it would be nice to show, by some clever counting, that some "intuitively quadratic" algorithm indeed requires at least n^2 steps, because we absolutely must consider all pairs of inputs' elements.

I understand that the whole thing is highly informal and maybe a bit naive, but still, how far can we push this counting argument?

$\endgroup$
2

1 Answer 1

0
$\begingroup$

Consider this fictional problem, where you need to test the following property: $\exists i,j$ such that $h(x_i + x_j) = 0$ where $1\le i,j\le n$ and $h(.)$ is a cryptographic hash function. Given that a cryptographically secure hash function is 'irreversible', we have no other way to avoid $n \choose 2$ comparisons.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.