Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

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 1i,jn

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

For the sector in which i,jn2:

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

For the sector in which in2and n2jn:

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

For the sector in which n2inand jn2:

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

For the sector in which n2i,jn :

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,jn2Zijwherein2andn2<jnZijwheren2<inandjn2Zijwheren2<i,jn

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 Vaia!

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

Consider the task of searching a sorted array A[1,,n] for a given element x: a task we usually perform by binary search in time O(logn) . Show that any algorithm that accesses the array only via comparisons (that is, by asking questions of the form “is A[i]z 0?”), must take Ω(logn) steps.

In our median-finding algorithm (Section 2.4), a basic primitive is the split operation, which takes as input an array S and a value V and then divides S into three sets: the elements less than V , the elements equal to V , and the elements greater than V . Show how to implement this split operation in place, that is, without allocating new memory.

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.

In Section 1.2.3, we studied Euclid’s algorithm for computing the greatest common divisor (gcd) of two positive integers: the largest integer which divides them both. Here we will look at an alternative algorithm based on divide-and-conquer.

(a) Show that the following rule is true.

gcd(a,b)={2gcd(a2,b2)ifa,bareevengcd(ab2)ifaisodd,bisevengcd(a-b2,b)ifa,bareodd

(b) Give an efficient divide-and-conquer algorithm for greatest common divisor.

(c) How does the efficiency of your algorithm compare to Euclid’s algorithm if a and b are n-bit -bit integers? (In particular, since n might be large you cannot assume that basic arithmetic operations like addition take constant time.)

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.)

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.

Sign-up for free