Skip to content

Commit

Permalink
#118 4.2-3
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtask committed Mar 5, 2024
1 parent 2f13737 commit fc483ca
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion chapter4/sections/2/3.tex
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
\workinprogress % TODO
For convenience, we'll assume that $n$ is an exact power of 3.
Similarly to equation (4.2), let's partition the matrices into nine $n/3\times n/3$ submatrices.
We can then treat the input matrices as two $3\times3$ matrices that we multiply using $k$ multiplications.
Each of those is in fact a multiplication of two $n/3\times n/3$ matrices and can be performed by running the algorithm recursively.

Let $T(n)$ be the worst-case time to multiply two $n\times n$ matrices by this algorithm.
If we did the partitioning using index calculations, then we get the recurrence
\[
T(n) = kT(n/3)+\Theta(1)
\]
which, by the master method, has the solution $T(n)=\Theta(n^{\log_3k})$.
According to \refProblem{3-1}(d), $T(n)=o(n^{\lg7})$ if $\log_3k<\lg7$, which gives us $k<3^{\lg7}\approx21.85$.
Hence, the largest integer value for $k$ is 21 and then the running time of the algorithm is $T(n)=\Theta(n^{\log_321})=O(n^{2.78})$.

0 comments on commit fc483ca

Please sign in to comment.