Re: Complexity of Discrete Log Algorithms
tomstdenis_at_gmail.com
Date: 06/08/05
- Next message: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Previous message: Gregory G Rose: "Re: Complexity of Discrete Log Algorithms"
- In reply to: Gregory G Rose: "Re: Complexity of Discrete Log Algorithms"
- Next in thread: Douglas A. Gwyn: "Re: Complexity of Discrete Log Algorithms"
- Reply: Douglas A. Gwyn: "Re: Complexity of Discrete Log Algorithms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 8 Jun 2005 11:04:23 -0700
Gregory G Rose wrote:
> You measure complexity in terms of the *length* of
> the input. Since the number n has length log(n),
> this complexity is O(e^(log n)) and hence it is
> fully exponential.
Just adding two bits here to help clarify the picture for the OP.
The big-O time/space is for the circuit time/size of the solution to
the problem. This stems from the classical theoretical view of
computing where programs are essentially combination of NAND gates
[though really they never specify hardware gates]. The idea is there
is some circuit of if/then/else statements which evaluate your problem.
Let's take a simple problem, adding two n-bit numbers. The circuit has
2n bits of input and produces n bits of output, each bit [after the
first] is dependent [and only computable] after the preceding bit has
been determined. This means the space is O(n) since we drop the
constant "2" and the time is O(n) since the result is only stable after
a linear number of gates have stabalized.
Now consider multiplication with double-add. Both double and add are
O(n) which means you take 2*O(n) = O(n) space but you pass through the
adder O(n) TIMES [once for each of the n bits] so you have a time
complexity of n additions which is O(n^2). Note that even if we move
up from bits to words [e.g. a typical BigNum library] the time is still
O(n^2) since we drop the constant.
Now consider a factoring sieve [e.g. Fermat]. The circuit is very
small at iirc roughly O(n) space but the time complexity is exponential
at q - p ~ 2^k [for some primes p and q of your modulus where q > p]
where the average k grows linearly as the size of the modulus [in bits]
grows linearly. so the time is O(2^k).
Note how in each case the time is dependent on the *length* of the
input not it's actual value, for example multiplying 127 * 65 takes the
same amount of time as 123*111 through a 8x8 multiplying circuit [as
far as big-oh is concerned]. E.g. double the bits, quadruple the
multiplication time or in the case of Fermat you essentially make the
problem intractable.
Quick ref of the Big ohs...
constant - O(1)
linear - O(n)
log - O(log n)
polynomial - O(n^k) for some constant k
sub-exp - O(e^logn)
exp - O(e^n)
It helps to graph them to see the difference and see how they grow.
Tom
- Next message: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Previous message: Gregory G Rose: "Re: Complexity of Discrete Log Algorithms"
- In reply to: Gregory G Rose: "Re: Complexity of Discrete Log Algorithms"
- Next in thread: Douglas A. Gwyn: "Re: Complexity of Discrete Log Algorithms"
- Reply: Douglas A. Gwyn: "Re: Complexity of Discrete Log Algorithms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|