Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Section 3.

3
16. A day has 24hours*60minutes*60seconds=86400 seconds
Operations in a second= 1second/10-11=1011
Operations in a day=864*1013
a) log n = 864*1013
13

n=286410

b) 1000n = 864*1013
n=

864001011
=86410 10
1000

c) n2 =864*1013
13
n= 86410 92951600

d) 1000n2 =864*1013
2

10

n =86410

10
n= 86410 2939387

e) n3 =864*1013
3

13
n= 86410 205197

f ) 2n=864*1013
13
n= log 2(86410 ) =52

g) 22n =86400*1011
n=

log 2 (8641013 )
=26
2

h)

22 =864*1013
13

n= log 2 log 2 (86410 ) =5

18. 2n2 + 2n operations, each requiring 109 seconds


t = (2n2 + 2n )* 109 seconds
a) n=10

t=(2*102 + 210 )* 109=1.224*10-6 seconds


b) n=20
t=(2*202 + 220 )* 109=1.049*10-3 seconds
c) n=50
t=(2*502 + 250 )* 109=1125899.907 seconds 13 days
d) n=100
t=(2*1002 + 2100 )* 109=1.26765*1021 seconds 4*1013 years
20.
a) t=log(log n)
when n is doubled:
log log 2 nlog logn=log

If n is large,

1+ log n
log n

log2+ log n
1+ logn
=log
log n
log n
is approximately equal to 1

Thus the expression is approximately equal to 0


b) t=log n
when n is doubled:
t=log(2n)=logn+log2=t+log2=t+1 (milliseconds)
c) t=100n
when n is doubled:
t=100*(2n)=2*100n=2t (milliseconds)
d) t=n log n
when n is doubled:
t=2n log(2n)=2n(logn + log2)=2n(logn)+2n(log2)=2t+2n(log2) =2t+2n
e) t=n2
when n is doubled:
t=(2n)2=4n2=4t
f) t=n3
when n is doubled:
t=(2n)3=8n3=8t
g) t=2n

when n is doubled:
t=22n=(2n)2=t2

You might also like