Professional Documents
Culture Documents
Submitted To:
RIZOAN TOUFIQ
ASSISTANT PROFESSOR
Department of Computer Science & Engineering
Rajshahi University of Engineering & Technology
Submitted By:
No Items Page
Table -1:
Select 1 Select 1 Select 2 Select 2
Page |4
Plotting Graph:
Bar Graph:
Comparison Graph
10000
9000
8000
7000
6000
5000
4000
3000
2000
1000
0
10000 20000 30000 40000
Line Graph:
Comparison Graph
10000
9000
8000
7000
6000
5000
4000
3000
2000
1000
0
10000 20000 30000 40000
TAvg (n) is the average computing time of Select1. Where it can be shown
that , TAvg ≤ R(n). Similarly, , TAvg (n)= O(n).
Select 2:
Obtaining the recurrence relation, we have:
Where c1 is a suitable constant (integer). Additional space is needed for
the recursion stack call.
So we get,
Matrix Multiplication:
Machine Configuration:
Machine used for this lab experiment
Page |9
Table -2:
Required Time
*NB: time given in microseconds.
P a g e | 10
Plotting Graph:
Bar Graph:
Comparison Graph
300000
250000
200000
150000
100000
50000
0
2x2 10x10 20x20
Line Graph:
Comparison Graph
300000
250000
200000
150000
100000
50000
Given the matrix A and B, and resultant matrix C, we see that both are
partitioned into four square sub-matrices, each sub-matrix having dimensions
n/2 * n/2. Then the product AB can be computed by using the given formula
(below) for the product of 2 × 2 matrices:
In order to compute AB using above equation, we need to perform eight
multiplications of n/2 x n/2 matrices and four additions of n/2 x n/2 matrices.
Since two n/2 x n/2 matrices may be added in time cn 2 for some constant c,
the overall computing time,
Strassen’s Approach:
Strassen provided the method below to solve this which requires little but less
time than previous method.
Giving us the recurrence relation for T(n):
Where a and b are the constants ,
From the formula we get:
P a g e | 14
Analysis:
3
Both of the algorithm is of O(n ). But Strassen requires less operation time
than as usual divide and conqueror method. Which is O(n2.81) or O(nlog27)
P a g e | 15
P a g e | 16
P a g e | 17
P a g e | 18
Table -1:
Required Time
1000 14 6
2500 23 17
10000 56 61
12500 59 79
15000 61 94
Plotting Graph:
P a g e | 20
P a g e | 21
P a g e | 22
P a g e | 23
P a g e | 24