/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q11E In justifying our matrix multipl... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

In justifying our matrix multiplication algorithm (Section 2.5), we claimed the following block wise property: if X and Y are n×nn matrices, and

X=[ABCD],Y=[EFGH],

where A,B,C,D,E,F,G, and H are n/2×n/2 sub-matrices, then the product XY can be expressed in terms of these blocks:

XY=[ABCD][EFGH]=[AE+BGAF+BHCE+DGCF+DH]

Prove this property.

Short Answer

Expert verified

Justification of matrix multiplication

Step by step solution

01

Prove:

Environment multiplication

Allowing the following matrices:

X=ABCD and Y=EFGH

X and Y vectors are split into 4 size blocks. n2×n2. This combination between X or Y matrix (z) has the following i , j the elements because X and Y were n×nmatrices:

Zij=∑k=1XikYkj where 1≤i,j≤n

With each region of both the process of making the product, the specified property may be demonstrated (Z) .

For the sector in which i,j≤n2:

Zij=X,Yij=∑K=1nXikYkj=∑k=1nXikYkj+∑K=1nXikYkj=∑K=1n/2AikEkj+∑K=1n/2BikGkj=AE+BGij

For the sector in which i≤n2and n2≤j≤n:

Zij=(XY)ij =∑K=1nXikYkj=∑K=1nXikYkj+∑nk=-+12nXikYkj=∑K=1n/2AikFkj+∑K=1n/2BikHkj=AF+BHij

For the sector in which n2≤i≤nand j≤n2:

Zij=X,Yij=∑K=1nXikYkj=∑k=1nXikYkj+∑K=1nXikYkj=∑K=1n/2CikEkj+∑K=1n/2DikGkj=CE+DGij

For the sector in which n2≤i,j≤n :

Zij=X,Yij=∑K=1nXikYkj=∑k=1nXikYkj+∑K=1nXikYkj=∑K=1n/2CikFkj+∑K=1n/2DikHkj=CF+DHij

The product of X and Y can be expressed as follows:

Z=Zijwherei,j≤n2Zijwherei≤n2andn2<j≤nZijwheren2<i≤nandj≤n2Zijwheren2<i,j≤n

Z=AE+BGAF+BHCE+DGCF+DH

Therefore, the given property is proved.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

A k−way merge operation. Suppose you have ksorted arrays, each with nelements, and you want to combine them into a single sorted array ofkn elements.

(a)Here’s one strategy: Using the merge procedure from Section 2.3, merge the first two arrays, then merge in the third, then merge in the fourth, and so on. What is the time complexity of this algorithm, in terms of kand n?

(b) Give a more efficient solution to this problem, using divide-and-conquer.

In Section 2.1 we described an algorithm that multiplies two n-bit binary integers x and y in time na, where a=log23. Call this procedure fast multiply (x,y).

(a) We want to convert the decimal integer 10n(a 1 followed by n zeros) into binary. Here is the algorithm (assume n is a power of 2):

function pwr2bin(n)

if n = 1: return10102

else:

z= ???

return fastmultiply(z,z)

Fill in the missing details. Then give a recurrence relation for the running time of the algorithm, and solve the recurrence.

(b) Next, we want to convert any decimal integer x with n digits (where n is a power of 2) into binary. The algorithm is the following:

function dec2bin(x)

if n=1: return binary [ x ]

else:

split x into two decimal numbers xt,xRwith n/2 digits each

return ???

Here binary [.] is a vector that contains the binary representation of all one-digit integers. That is, binary role="math" localid="1659333641173" [0]=02, binary [1]=12, up to binary [9]=10012. Assume that a lookup in binary takes 0(1) time. Fill in the missing details. Once again, give a recurrence for the running time of the algorithm, and solve it.

Practice with the fast Fourier transform.

(a) What is the FFT of (1,0,0,0)? What is the appropriate value of Ó¬in this case? And of which sequence is (1,0,0,0)the FFT?

(b)Repeat for (1,0,1,-1).

Question: You are given an infinite array A[·]in which the first n cells contain integers in sorted order and the rest of the cells are filled with ∞. You are not given the value of n. Describe an algorithm that takes an integer x as input and finds a position in the array containing x, if such a position exists, in O(log n) time. (If you are disturbed by the fact that the array A has infinite length, assume instead that it is of length n, but that you don’t know this length, and that the implementation of the array data type in your programming language returns the error message ∞whenever elements A[i]withi>n are accessed.)

This problem illustrates how to do the Fourier Transform (FT) in modular arithmetic, for example, modulo .(a) There is a number such that all the powers Ó¬,Ó¬2,...,Ó¬6 are distinct (modulo ). Find this role="math" localid="1659339882657" Ó¬, and show that Ó¬+Ó¬2+...+Ó¬6=0. (Interestingly, for any prime modulus there is such a number.)

(b) Using the matrix form of the FT, produce the transform of the sequence (0,1,1,1,5,2) modulo 7; that is, multiply this vector by the matrix M6(Ó¬), for the value of Ó¬you found earlier. In the matrix multiplication, all calculations should be performed modulo 7.

(c) Write down the matrix necessary to perform the inverse FT. Show that multiplying by this matrix returns the original sequence. (Again all arithmetic should be performed modulo 7.)

(d) Now show how to multiply the polynomials and using the FT modulo 7.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.