Attribution Non-Commercial (BY-NC)

2 vues

Attribution Non-Commercial (BY-NC)

- Buku Manual Suzuki Katana PDF
- An Introduction to Probability Theory - Geiss
- Infinity Tech New
- 10809004h1
- Proceedings of SLACTIONS 2011 International Conference
- DAA-unit I
- Lecture 01
- F. K. Miyazawa and Y. Wakabayashi- Two- and Three-dimensional Parametric Packing
- Ans
- computacional2
- 02.Solutions
- reward based wireless network algorithm
- Modeling and Optimization of Resource Allocation in Supply Chain
- ptoticAnalysis
- lecture2(9)
- Integration
- Lecture 2 & 3 Unit Commitment and ELD
- slides9-8
- MIT18_335JF10_pset1.pdf
- The Multiplicative Complexity of Boolean Functions on Four and Five Variables

Vous êtes sur la page 1sur 64

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

ECE750 Lecture 1: Asymptotics, Resources,

& Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Electrical & Computer Engineering

University of Waterloo

Canada

Sept. 11, 2008

1 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Part I

Asymptotics

2 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotics: Motivation I

for the job.

space; for circuits: area, depth.

applications

number of gates in a 64-bit addition circuit.

, n

1/2

for

latency-throughput, HINT curves for linear algebra

(characterize performance through dierent cache

regimes), etc.

...

3 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotics: Motivation II

approximation of performance that describes behaviour

on big problems

4 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotics: Brief history

Innitarcalc ul (calculus of innities) developed in the

1870s.

Bois-Reymonds ideas in his monograph Orders of

Innity (1910) [5].

(1894), and popularized by Landau (hence sometimes

called Landau notation.)

resource consumption, independent of small machine

dierences, languages, compilers, etc.

5 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic asymptotic notations I

Asymptotic means behaviour as n , where for our

purposes n is the problem size.

Three basic notations:

f _ g (f is asymptotically dominated by g)

6 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic asymptotic notations II

f g means lim

n

f (n)

g(n)

= 1

Example: 3x

2

+ 2x + 1 3x

2

.

is an equivalence relation:

Transitive: (x y) (y z) (x z)

Reexive: x x

Symmetric: (x y) (y x).

Basic idea: We only care about the leading term,

disregarding less quickly-growing terms.

7 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic asymptotic notations III

f _ g means limsup

n

f (n)

g(n)

<

i.e.,

f (n)

g(n)

is eventually bounded by a nite value.

(limsup means the maximum value a function attains

innitely often. For example, lim

x

cosx does not exist,

but limsup

x

cosx = 1.)

quickly as g.

Transitive: (f _ g) (g _ h) (f _ h).

Reexive: f _ f

8 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic asymptotic notations IV

antisymmetric: there are functions f , g where f _ g

and g _ f but f ,= g. Example:

f (n) = 2

n+cos n

g(n) = 2

n

Here

f (n)

g(n)

= 2

cos n

, which oscillates between

1

2

and 2.

Variant: g _ f means f _ g.

9 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic asymptotic notations V

Write f g when there are positive constants c

1

, c

2

such that

c

1

f (n)

g(n)

c

2

for suciently large n.

Examples:

n 2n

n (2 + sin n)n

is an equivalence relation.

10 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Strict forms

Write f g when f _ g but f , g.

n

f (n)

g(n)

= 0.

Examples

x

2

x

3

log x x

Variant: f ~ g means g f

11 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Orders of growth I

We can use as a ruler by which to judge the growth of

functions. Some common tick marks on this ruler are:

log log n log n log

k

n n

n n

2

2

n

n! n

n

2

2

n

We can always nd in a dense total order without

endpoints. i.e.,

(The canonical example of a dense total order without

endpoints is Q, the rationals.)

the axes are asymptotes.

without endpoints is isomorphic to Q, ), i.e., the

rationals under the usual ordering.

12 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Orders of growth II

asymptotes in a one-to-one correspondence with the

rationals.

asymptotes; this gives us an intuitive way to visualize

how e.g. the behaviour of an algorithm changes as we

vary parameters.

13 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Big-O notations I

Big-O is a convenient family of notations for asymptotics:

O(g) f : f _ g

i.e., O(g) is the set of functions f so that f _ g.

O(n

2

) contains n

2

, 7n

2

, n, log n, n

3/2

, 5, . . .

expression as if it were a term:

x

2

+ 2x

1/2

+ 1

. .

x

1/2

= x

2

+ O(x

1/2

)

The above equation can be read as there exists a

function f O(x

1/2

) such that

x

2

+ 2x

1/2

+ 1 = x

2

+ f (x).

14 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Big-O notations II

machine/compiler/language-independent complexity

properties.

5.73n log n seconds, on another it might take

9.42n log n + 3.2n seconds.

algorithm runs in O(n log n) seconds.

like f (n):

than f (n).

15 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Basic properties of big-O notation I

Given a choice between an sorting algorithm that runs in

O(n

2

) time and one that runs in O(n log n) time, which

should we choose?

1. Gut instinct: the O(n log n) one, of course!

2. But: note that the class of functions O(n

2

) also

contains n log n. Just because we say an algorithm is

O(n

2

) does not mean it takes n

2

time!

3. It could be that the O(n

2

) algorithm is faster than the

O(n log n) one.

16 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Additional notations I

To distinguish between at most this fast, at least this

fast, etc. there are additional big-O-like notations:

f O(g) f _ g upper bound

f o(g) f g strict upper bound

f (g) f g tight bound

f (g) f _ g lower bound

f (g) f ~ g strict lower bound

17 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Tricks for a bad remembering day

if f (g) then g comes after f in asymptotic ordering.

asymptotes converge to one another

18 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Notation: o()

f o(g) means f g

Example:

n

k=0

2

k

= 2

1

2

n

= 2 + o(1)

lim

n

g(n)

1

= 0, which means lim

n

g(n) = 0.

n

n! = o(n

n

).

19 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Notation: ()

f (g) means f ~ g

h

n

=

n

k=0

1

k

ln n + + O(n

1

)

h

n

(1) (It is unbounded.)

h

n

(ln ln n)

n! = (2

n

) (grows faster than 2

n

)

20 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Notation: ()

f (g) means f _ g

2

) time. (At

least enough time to look at each of the n

2

entries in the

matrices.)

21 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Notation: ()

f (g) means f g

contained in a nite positive interval [c

1

, c

2

].

(Tight! Not much faster or slower!)

ln n! n ln n n +O(ln n) implies that ln n! is (n ln n)

means lim

n

f (n)

g(n)

= k for some constant k.

22 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Algebraic manipulations of big-O

always keep in mind what the symbols mean!

_ f (n):

n

2

+ n

1/2

+ O(n) + 3 = n

2

+ O(n)

The n

1/2

and 3 on the l.h.s. are meaningless in the

presence of an O(n) term.

1

) times n +O(n

1/2

)?

_

ln n + + O(n

1

)

_

n + O(n

1/2

)

_

= n ln n + n + O(n

1/2

ln n)

The terms O(n

1/2

), O(n

1/2

), O(1), etc. get

swallowed by O(n

1/2

ln n).

23 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Sharpness of estimates

Example: for a constant c,

ln(n + c) = ln

_

n

_

1 +

c

n

__

= ln n + ln

_

1 +

c

n

_

= ln n +

c

n

c

2

2n

2

+ (Maclaurin series)

= ln n +

_

1

n

_

It is also correct to write

ln(n + c) = ln n + O(n

1

)

ln(n + c) = ln n + o(1)

since (n

1

) O(

1

n

) o(1). However, the (

1

n

) error term

is sharper a better estimate of the error.

24 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Sharpness of estimates & The Riemann

Hypothesis

Example: let (n) be the number of prime numbers n.

The Prime Number Theorem is that

(n) Li(n) (1)

where Li(n) =

_

n

x=2

1

ln x

dx is the logarithmic integral, and

Li(n)

n

ln n

Note that (1) is equivalent to:

(n) = Li(n) + o(Li(n))

It is known that the error term can be improved, for example

to

(n) = Li(n) + O

_

n

ln n

e

a

ln n

_

25 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Sharpness of estimates & The Riemann

Hypothesis

The famous Riemann hypothesis is the conjecture that a

sharper error estimate is true:

(n) = Li(n) + O(n

1

2

ln n)

This is one of the Clay Institute millenium problems, with a

$1,000,000 reward for a positive proof. Sharp estimates

matter!

26 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Sharpness of estimates

To maintain sharpness of asymptotic estimates during

analysis, some caution is required.

E.g. If f (n) = 2

n

+ O(n), what is log f (n)?

Bad answer: log f (n) = n + o(n).

More careful answer:

log f (n) = log(2

n

+ O(n))

= log(2

n

(1 + O(n2

n

)))

= log(2

n

) + log(1 + O(n2

n

))

Since log(1 + (n)) O((n)) if o(1),

log f (n) = n + O(n2

n

)

i.e., log f (n) is equal to n plus some value converging

exponentially fast to 0.

27 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Sharpness of estimates

log f (n) = n + O(n2

n

)

is a reasonably sharp estimate (but, what happens if we take

2

log f (n)

with this estimate?)

If we dont care about the rate of convergence we can write

f (n) = n + o(1)

where o(1) represents some function converging to zero.

This is less sharp since we have lost the rate of convergence.

Even less sharp is

f (n) n

which loses the idea that f (n) n 0, and doesnt rule out

things like f (n) = n + n

3/4

.

28 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotic expansions I

An asymptotic expansion of a function describes how that

function behaves for large values. Often it is used when an

explicit description of the function is too messy or hard to

derive.

e.g. if I choose a string of n bits uniformly at random (i.e.,

each of the 2

n

possible strings has probability 2

n

), what is

the probability of getting

3

4

n 1s?

Easy to write the answer: there are

_

n

k

_

ways of arranging k

1s, so the probability of getting

3

4

n 1s is:

P(n) =

n

k=

3

4

n

2

n

_

n

k

_

This equation is both exact and wholly uninformative.

Can we do better? Yes!

29 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotic expansions II

The number of 1s in a random bit string is a binomial

distribution and is well-approximated by the normal

distribution as n :

n

k=

1

2

n+

n

2

n

_

n

k

_

_

x=

1

2

e

x

2

2

dx

= 1 F()

where F(x) =

1

2

_

1 +erf

_

x

2

__

is the cumulative normal

distribution.

Maples asympt command yields the asymptotic expansion:

F(x) 1 O

_

1

xe

x

2

2

_

30 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotic expansions III

We want to estimate the probability of

3

4

n 1s:

1

2

n +

n =

3

4

n

gives =

n

4

. Therefore the probability is

P(n) 1 F

_

n

4

_

1 1 + O

_

1

ne

n

32

_

= O

_

1

ne

n

32

_

So, the probability of having more than

3

4

n 1s converges to

0 exponentially fast.

31 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotic Expansions

ln n! n ln n n + O(1)

rather than

ln n! = n ln n n + O(1)

Writing is a clue to the reader that an asymptotic

expansion is being taken, rather than just carrying an

error term around.

case analysis, where we are interested in characterizing

how an algorithm performs for most inputs.

technique is to obtain an asymptotic estimate of the

probability of running in time ~ f (n), and show it

converges to zero very quickly.

32 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Another asymptotic exansion example I

How does log

2

_

n

n/2

_

behave as n ?

% maple

...

> asympt(log[2](n!/(n/2)!/(n/2)!),n);

bytes used=4000224, alloc=3472772, time=1.35

1/2

2

ln(-----) - 1/2 ln(n)

1/2

Pi 1 1 1

n + --------------------- - 1/4 ------- + 1/24 -------- + O(----)

ln(2) ln(2) n 3 5

ln(2) n n

So, log

2

_

n

n/2

_

n O(ln n).

33 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Example: Asymptotic Expansions for

Average-Case Analysis I

carry adder is proportional to the longest carry

sequence.

sequence of length t(n) satises

Pr(carry sequence t(n)) 2

t(n)+log n+O(1)

conclude that the average running time is O(log n).

Pr(carry sequence log n + (1)) 0

Translation: The probability of having a carry

sequence longer than log n + (n), where (n) is any

unbounded function, converges to zero.

34 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

The Taylor series method of asymptotic

expansion I

that works for simple cases; it is one technique Maples

asympt function uses.

function

[continuous derivatives of all orders exist] about x = 0

is given by:

f (x) = f (0) + xf

(0) +

x

2

2!

f

(0) +

x

3

3!

f

(0) +

F(n) as n ,

1. Substitute n = x

1

into F(n). (Then n as

x 0.)

2. Take a Taylor series about x = 0.

3. Substitute x = n

1

.

35 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

The Taylor series method of asymptotic

expansion II

4. Use the dominating term(s) as the expansion, and the

next term as the error term.

Example expansion: F(n) = e

1+

1

n

.

Obviously lim

n

F(n) = e, so we expect something of the

form F(n) e + o(1).

1. Substitute n = x

1

into F(n): obtain F(x

1

) = e

1+x

2. Taylor series about x = 0:

e

1+x

= e + xe +

x

2

2

e +

x

3

6

e +

3. Substitute x = n

1

:

= e +

e

n

+

1

2n

2

e +

1

6n

3

e +

36 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

The Taylor series method of asymptotic

expansion III

4. Since e ~

1

n

e ~

1

2n

2

e ~ ,

F(n) e +

_

1

n

_

37 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Asymptotics of algorithms

Asymptotics is a key tool for algorithms and data structures:

estimates of asymptotic resource consumption (e.g.,

time, space)

estimate e.g. probabilities

according to design criteria

(combinations) of algorithms and data structures.

38 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

References on asymptotics

Knuth and Oren Patashnik, Ch. 9 Asymptotics [4]

Advanced:

asymptotic expansions [7]

39 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Part II

Resource Consumption

40 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Resource Consumption

To decide which algorithm or data structure to use, we are

interested in their resource consumption. Depending on the

problem context, we might be concerned with:

Number of gates

Depth

Area

Heat production

Number of processors

Error probability

41 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Machine models I

analyzed with reference to some machine model that

denes:

memory; arithmetic; obtaining a random bit; etc.)

for theoretical arguments only;

eectively fork its execution at each step, so that after t

steps it can behave as if it were a parallel machine with

e.g. 2

t

processors;

corresponds more-or-less to an everyday single-CPU

desktop machine, but with innite memory;

42 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Machine models II

computing.

when you change machine models. e.g., many problems

believed to take exponential time (assuming P ,= NP)

on a RAM can be solved in polynomial time on a

Nondeterministic TM.

resource bounds on one machine model to another:

Turing machine can be simulated in

O(T(n) log log S(n)) time by a RAM;

RAM can be simulated in O(T

3

(n)(S(n) + T(n))

2

)

time by a Turing machine.

a RAM or similar machine model.

43 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Machine models III

machine model.

nonspecialists have proven outlandish complexity

results by making basic mistakes

be stored in O(1) space and multiplied, added, etc. in

O(1) time. On realistic sequential (nonparallel)

machine models, d-digit real numbers take:

O(d) space

44 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Example of time and space complexity

tree, sorted array. Let n be the number of elements

stored.

Space Search time Insert time

List (n) (n) (1)

Balanced tree (n) (log n) (log n)

Sorted array (n) (log n) (n)

tree or sorted array will be faster than a list for

suciently large n.

performance for small cases.

45 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Example: Circuit complexity

se, but a family of circuits, one for each problem size

(e.g., addition circuits for n-bit integers).

model is gates that have nite fan-in and fan-out, i.e.,

gates have 2-inputs and output signals can be fed into

at most k inputs

fan-out

area

Adder type Gates Depth

Ripple-carry adder 7n 2n

Carry-skip (1L) 8n 4

n

Carry lookahead 14n 4 log n

Conditional-sum adder 3n log n 2 log n

46 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Resource consumption tradeos I

resources.

Miller-Rabin test takes time (k log

3

n) and has

probability of error 4

k

.

3

n) and probability

of error 2

40

.

Choosing k =

1

2

log n yields time (log

4

n) and

probability of error

1

n

.

Cracking passwords has a time-space tradeo:

recover: e.g. htpasswd (web passwords) turns foobar

into AjsRaSQk32S6s

47 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Resource consumption tradeos II

precompute a database of size O(n) containing every

possible encrypted password and its plaintext. Crack

passwords in O(log n) time by looking them up in the

database.

64

.

2/3

) time using a

database of size O(n

2/3

).

they are stored hashed (encrypted). With a

precomputed database of size 1.4Gb (two CD-ROMs),

99.9% of all alphanumerical password hashes can be

cracked in 13.6 seconds [8].

48 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Part III

Complexity classes

49 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Kinds of problems

Does this le contain a valid Java program?

that minimizes (maximizes) some objective function.

Example: Find a circuit made out of AND, OR, and

NOT gates that computes the sum of two 8-bit

integers, and has the fewest gates.

satisfy some criterion. Example: For how many inputs

will this circuit output zero?

50 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Complexity classes

a style of problem

problems that can be solved in polynomial time (i.e.,

time O(n

d

) for some d N) on a Turing machine.

Complexity classes:

they are

non-radical changes of machine model (e.g., the class P

on a TM is the same as the class P on a RAM).

51 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Some basic distinctions

come in three varieties:

solve. What this course is about! (Program will always

stop and say yes or no, and be right!)

programs to solve (e.g., deciding whether a Java

program runs in polynomial time)

of natural numbers. e.g., prime numbers.

there are

0

(countably many) problem denitions.

(They can be put into 1-1 correspondence with the

natural numbers).

There are 2

0

(uncountably many) problems

subsets of A N. (They can be put into 1-1

correspondence with the reals.)

52 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

An aside: Hasse diagrams I

complexity classes.

is also in class PSPACE (polynomial space on TM).

contained in the class PSPACE.

orders.

Professors are people; programmers are people (are

too!)

me professors

me programmers

professors people

programmers people

53 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

An aside: Hasse diagrams II

people

professors

o

o

o

o

o

o

o

programmers

Q

Q

Q

Q

Q

Q

Q

Q

me

N

N

N

N

N

N

N

n

n

n

n

n

n

n

n

n

54 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Whirlwind tour of major complexity classes I

classes are interesting primarily to structural complexity

theorists they capture ne distinctions that were not

concerned with day-to-day.)

above, beside, and below it that are not shown;

is strict: e.g., when the diagram shows NP above P,

this means P NP, not P NP.

55 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Whirlwind tour of major complexity classes II

Decidable

EXP

PSPACE

coNP

m

m

m

m

m

NP

P

P

P

P

P

P

Q

Q

Q

Q

Q

Q

Q

n

n

n

n

n

n

n

EXPTIME)

56 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Randomness-related classes

ZPP, RP, coRP, BPP: probabilistic classes (machine has

access to random bits)

EXPTIME

NP

n

n

n

n

n

n

BPP coNP

R

R

R

R

R

RP

n

n

n

n

n

n

coRP

R

R

R

R

R

ZPP

P

P

P

P

P

P

l

l

l

l

l

l

PTIME

with access to a random number source, with

probability of error <

1

2

. (Run many times and vote:

get error as low as you like.)

with access to a random number source, with zero

probability of error.

57 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Polynomial-time and below

PTIME

Polynomial time

NC Nicks class

LOGSPACE

Logarithmic space

NC

1

Logarithmic depth circuits, bounded fan in/out

AC

0

Constant depth circuits, bounded fan in/out

58 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Structural complexity theory

classes and their interrelationships

NP, like placement & routing for VLSI, designing

communication networks, etc.)

in NP by ipping coins, with some error so tiny we

dont care.

contains NP, then RP=NP and PH is contained in

BPP; any proof of BPP=P would require showing either

NEXP is not in P/poly or that #P requires

superpolynomial sized circuits.

with basic, practical complexity classes only.

59 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Part IV

Bibliography

60 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Bibliography I

[1] Thomas H. Cormen, Charles E. Leiserson, and Ronald R.

Rivest.

Intoduction to algorithms.

McGraw Hill, 1991.

[2] David Culler, Richard Karp, David Patterson, Abhijit

Sahay, Klaus Erik Schauser, Eunice Santos, Ramesh

Subramonian, and Thorsten von Eicken.

LogP: Towards a realistic model of parallel computation.

In Marina Chen, editor, Proceedings of the 4th ACM

SIGPLAN Symposium on Principles and Practice of

Parallel Programming, pages 112, San Diego, CA, May

1993. ACM Press.

61 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Bibliography II

[3] David E. Culler, Richard M. Karp, David Patterson,

Abhijit Sahay, Eunice E. Santos, Klaus Erik Schauser,

Ramesh Subramonian, and Thorsten von Eicken.

Logp: a practical model of parallel computation.

Commun. ACM, 39(11):7885, 1996.

[4] Ronald L. Graham, Donald E. Knuth, and Oren

Patashnik.

Concrete Mathematics: A Foundation for Computer

Science.

Addison-Wesley, Reading, MA, USA, second edition,

1994.

62 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Bibliography III

[5] G. H. Hardy.

Orders of innity. The Innitarcalc ul of Paul du

Bois-Reymond.

Hafner Publishing Co., New York, 1971.

Reprint of the 1910 edition, Cambridge Tracts in

Mathematics and Mathematical Physics, No. 12.

[6] Donald E. Knuth.

Big omicron and big omega and big theta.

SIGACT News, 8(2):1824, 1976.

[7] A. H. Lightstone and Abraham Robinson.

Nonarchimedean elds and asymptotic expansions.

North-Holland Publishing Co., Amsterdam, 1975.

North-Holland Mathematical Library, Vol. 13.

63 / 64

ECE750 Lecture 1:

Asymptotics,

Resources, &

Complexity Classes

Todd Veldhuizen

tveldhui@acm.org

Bibliography IV

[8] Philippe Oechslin.

Making a faster cryptanalytic time-memory trade-o.

In Dan Boneh, editor, CRYPTO, volume 2729 of Lecture

Notes in Computer Science, pages 617630. Springer,

2003.

[9] John R. Shackell.

Symbolic asymptotics, volume 12 of Algorithms and

Computation in Mathematics.

Springer-Verlag, Berlin, 2004.

64 / 64

- Buku Manual Suzuki Katana PDFTransféré paradoel
- An Introduction to Probability Theory - GeissTransféré parChhim Tykoykinds
- Infinity Tech NewTransféré parratnakar_erdci9642
- 10809004h1Transféré parb1b11b111b1111
- Proceedings of SLACTIONS 2011 International ConferenceTransféré parResearch conference on virtual worlds – Learning with simulations
- DAA-unit ITransféré parmonicadoss85
- Lecture 01Transféré parAnil Saini
- F. K. Miyazawa and Y. Wakabayashi- Two- and Three-dimensional Parametric PackingTransféré parMnaom
- AnsTransféré parSunil Patil
- computacional2Transféré parcanvercero
- 02.SolutionsTransféré parMichael Reid
- reward based wireless network algorithmTransféré parJyothiradithyan M
- Modeling and Optimization of Resource Allocation in Supply ChainTransféré parcrazyfrog1991
- ptoticAnalysisTransféré parpullasunil
- lecture2(9)Transféré parsatyabasha
- IntegrationTransféré parAmrik Singh
- Lecture 2 & 3 Unit Commitment and ELDTransféré parSantosh Thapa
- slides9-8Transféré parEartha
- MIT18_335JF10_pset1.pdfTransféré parEren Võ
- The Multiplicative Complexity of Boolean Functions on Four and Five VariablesTransféré parDCS Sitoe
- EfficienciesTransféré parbumbleshet
- Introduction_to_DAA.pdfTransféré parAkhter Jahangir
- Recursion02Transféré parfor_books
- Lec_2.2Transféré parnouraiz
- Apple t NotesTransféré par8527479210
- (2018) a Lyapunov Analysis of Momentum Methods in OptimizationTransféré parMatheus Portela
- Unit 1 DS.pdfTransféré parDheresh Soni
- si-notesTransféré parguukizl
- epdf.tips_fundamentals-of-algorithmics.pdfTransféré parmax crax
- DAA pt2 2 marksTransféré parBoopathi Boopathi

- ECE750_F2008_Algorithms3Transféré partveldhui
- ECE750_F2008_Algorithms2Transféré partveldhui
- ECE750_F2008_Algorithms11Transféré partveldhui
- ECE750_F2008_Algorithms10Transféré partveldhui
- ECE750_F2008_Algorithms9Transféré partveldhui
- ECE750_F2008_Algorithms8Transféré partveldhui
- ECE750_F2008_Algorithms7Transféré partveldhui
- ECE750_F2008_Algorithms6Transféré partveldhui
- ECE750_F2008_Algorithms5Transféré partveldhui
- ECE750_F2008_Algorithms4Transféré partveldhui
- SE362_SoftwareProjectManagementTransféré partveldhui

- Analysis of algorithmsTransféré parPratyush Shrotriya
- BRICS-RS-99-13Transféré parMaheshwar Bhat
- ama-ch2Transféré parfathur_rachman83
- hw3Transféré parmodparadigm
- Modeling, Simulation and Optimization - Focus on ApplicationsTransféré parNichol Dimalanta
- Data Structures and File ProcessingTransféré parapi-3820001
- Lecture1_Introduction.pptxTransféré parCory Patterson
- DAA-unit ITransféré parmonicadoss85
- Data Structures OutlineTransféré parshahzad jalbani
- Big O Stack OverflowTransféré parCrazy Farm
- CLRS3Transféré parEdwin Camilo Cubides Garzón
- 25. ISC Computer Science -2015Transféré parBimal Roy Mehta
- Lec8_RecurrenceRelationsTransféré parshahzad5alam
- Schoenstadt Fourier PDETransféré parWendel Alessandro
- Evaluation Multiple ZetaTransféré parlsunart
- Zijlema Lecturenotes ODE and SWETransféré parRossy Dinda Pratiwi
- Experimental Analysis of AlgorithmTransféré parDeepak Menghani
- CAB301_Levitin_Ch2.pdfTransféré parArchie Rudy Su'a
- Neutral NetworksTransféré parAnirud Thyagharajan
- Summer.2012.e8 SolutionsTransféré parRaj Shetty
- Checking Robust Nonsingularity is NP-hardTransféré pardarismendy
- AsymptoticNotations.pptTransféré parmnkshgupta
- BallsTransféré parkishoje
- Script-QITransféré parDavid Diering
- 14-bigOhTransféré parvenkat
- DaaTransféré parjayanthikrishnan
- 1Transféré parEduardVallejos
- A Beginner’s Guide to Big O Notation « Rob BellTransféré parUmesh Narayanan
- Cs 1311 Lecture 23 WdlTransféré parjauy

## Bien plus que des documents.

Découvrez tout ce que Scribd a à offrir, dont les livres et les livres audio des principaux éditeurs.

Annulez à tout moment.