简体   繁体   中英

How does one prove an upper/lower bound of a parallel algorithm?

Suppose a Fibonacci algorithm:

在此处输入图片说明

We are asked to prove the upper/lower bound of this algorithm.

How do I proceed?

Update

So I'll explain what I have done myself and show where I'm stuck.

I don't know why but I decided to use recurrence relation here to see where I can get my final result. But the reason why I doubt my working out is that Upper/lower bound is the identification of the "limitless" of an algorithm in terms of resources.

So, the parallel algorithm has:

Work(n) = W(n - 1) + W(n - 2) + Θ(1)

At this point, I decided to use recurrence relation - have no idea -

Work(n) = [W(n - 1) + W(n - 2) + Θ(1)] + W(n - 2) + Θ(1)
        = W(n - 2) + W(n - 2) + 2Θ(1)
        = 2W(n - 2) + 2
        = Stuck here

Honestly, I don't know even if that makes sense.

A formal solution was given: 在此处输入图片说明

But I didn't quite understand the steps that were taken above

I would say that the processors are of almost no concern since the recurrence is a tree and this tree has an exponential number of nodes. These nodes represent the merge that has to be done in each step. So even if the number of processors is unlimited it does not help solving this recurrence as they can only compute something independently in the last row, ie, W(1) and W(0).

I just saw in the comments that the sample solution was supplied and partially explained: Here some further "insight": The idea is to expand the recurrence and look for a way to collect the factors. Here they collect the 2 in a way that they apply an inequality: W(n-1)+W(n-2) >= 2 W(n-2). So now you have W(n)>= 2 W(n-2). How often do we subtract the 2 until we have W(0) on the right side? n/2 times. Then you end up with the Omega(2^(n/2)) lower bound. You can use the more or less same approach to show an upper bound.

Just as a small side note, these bounds are not tight: Related Post

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM