Matrix chain multiplication Flashcards

1
Q

If I do A(nxm) * B(m*k)
what is the dimensions of C

A

n x k

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many ways to parenthesise a chain of n matrices

A

sum to n-1 i starts at 1
p(i)p(n-i)

p(1) = 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the run time of Matrix chain multiplication (with memoization)

A

O(n^3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the run time of Matrix chain multiplication (without memoization)

A

O(2^n)

thats how many ways there are to parentesize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the recursive formula for matrix chain multiplication

A

m[i,j] -> min(m[i,k]+m[k,j]+ pi−1​pk​pj)

where i,k is the left sub chain
and k,j is the right sub chain
and pi-1pkpj is the cost to multiply the two

when p is in this form
p=[3,7,6,2,9]
chain of 3x7 * 7x6 .. etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly