SDSU CS 662
Theory of Parallel Algorithms
(Mathematical Preliminaries Solving Recurrence Relations via Ordinary Generating Functions)
CALCULATING THE NUMBER OF DIFFERENT N-NODE BINARY TREES
Let B(n) denote the number of different n-node binary trees. Our
SDSU CS 662
Theory of Parallel Algorithms
PRACTICE EXAM #1 KEY
(100 points; problems are equally weighted)
PROBLEM #1
Indicate whether each statement below is TRUE or FALSE by circling the appropriate letter
T
F
If a problem can be solved in O(log N) time
SDSU CS 662
Theory of Parallel Algorithms
PRACTICE EXAM #1
(100 points; problems are equally weighted)
PROBLEM #1
Indicate whether each statement below is TRUE or FALSE by circling the appropriate letter
T
F
If a problem can be solved in O(log N) time by
SDSU CS 662
Theory of Parallel Algorithms
Finding the greatest among N array elements
in (log log N) time using an N-processor CRCW PRAM
Solution of related recurrence relation
(ref: Horowitz & Sahni, p. 629)
We wish to solve the recurrence relation:
T (
SDSU CS-662
Theory of Parallel Algorithms
N-tuple prefix computation in (log2 N) time
using N/ (log2 N) processors
with CREW PRAM architecture
(HSR Algorithm 13.3)
Example: let the operation be ordinary addition, let N=16 and let p=4 .
T=0
INPUT
OUTPUT
1
SDSU CS-662
Theory of Parallel Algorithms
N-tuple prefix computation in (log2 N) time
using N processors
with EREW PRAM architecture
(Modified HSR Algorithm 13.2)
Example: let the operation be ordinary addition, let N=16 and let p=N.
T=0
INPUT
OUTPUT
AUX
SDSU CS-662
Theory of Parallel Algorithms
N-tuple prefix computation in (log2 N) time
using N processors
with CREW PRAM architecture
(HSR Algorithm 13.2)
Example: let the operation be ordinary addition, let N=16 and let p=N.
T=0
INPUT
OUTPUT
1
14
0
proces
SDSU CS 662
Theory of Parallel Algorithms
(Mathematical Preliminaries Solving Recurrence Relations via Ordinary Generating Functions)
A CLOSEDFORM FORMULA FOR THE N.th FIBONACCI NUMBER
Consider the function F defined by the following recurrence relation: