Coffee Room

Discuss anything here - everything that you wish to discuss with fellow engineers.

12921 Members

Join this group to post and comment.

# solve the recurrence problem with detail(time complexity)

**solve the recurrence problem with detail(time complexity)**

T(n)=T(n-1)+1/n, if n>1

= 1 otherwise

To solve this,

T(n)=T(n-1)+1/n

put n=n-1

T(n-1)=T(n-2)+1/(n-1)+1/n

...

finally it will result in

1/n+1/(n-1)+1/(n-2)+... +1/3+...

For an infinite series, this can be approximated for ln

T(n)=T(n-1)+1/n

put n=n-1

T(n-1)=T(n-2)+1/(n-1)+1/n

...

finally it will result in

1/n+1/(n-1)+1/(n-2)+... +1/3+...

For an infinite series, this can be approximated for ln

T(n)=T(n-1)+1/n

put n= n-1

T(n)=T(n-2)+1/(n-1)+1/n

and so on

............

solve the total it will give sum of nth terms in harmonic series

T(n)=1+1/2+1/3+.....+1/(n-3)+1/(n-2)+1/(n-1)+1/n

approximately sum of n terms in harmonic series is ln(n)+.5772156649...

T(n)=ln(n)+.5772156649

put n= n-1

T(n)=T(n-2)+1/(n-1)+1/n

and so on

............

solve the total it will give sum of nth terms in harmonic series

T(n)=1+1/2+1/3+.....+1/(n-3)+1/(n-2)+1/(n-1)+1/n

approximately sum of n terms in harmonic series is ln(n)+.5772156649...

T(n)=ln(n)+.5772156649

**timecomplextiy is O(ln(n))**
hi, this problem uses log n series ....i can evalute only up to sum of n term ...........thanx for reply to this question........i already posted one question .......... average paged m/y access time question........till anyone cant solve the problem?....u solve the problem

Suppose the cache and main memory access times are 100 ns and 1200 ns respectively. The cache is used for paging and the hit ratio of finding the page table entry in the cache is 98%, what is the effective paged memory access time?

(A) 240 ns (B) 220 ns(C) 250 ns (D) 1200 ns

(A) 240 ns (B) 220 ns(C) 250 ns (D) 1200 ns