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

How many multiplications of entries are used by the algorithm found in Exercise 41 for multiplying twon×nupper triangular matrices?

Short Answer

Expert verified

16n(n+1)(n+2)

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Previous Exercise

Solution previous exercise:

for i = j to n

for j := 1 to n

cij:=0

if ijthen

for q:=itoj

cij:=cij+aiqbqj

return C

GENERAL SUMS

k=1na=ank=1nk=n(n+1)2k=1nk2=n(n+1)(2n+1)6

02

Solution

We note that for every iteration of the for-loop of the variable q one multiplication is made (aiqbqj) , while q can take on values from i to j and thus every time the for-loop of the variable q is executed, j - i+ 1 multiplications are used.

j can take on the values from 1 to n, while ican take on the values from 1 to n as well. However, when j < i , no multiplications are made as we know that the element is and thus there are only made any multiplications for j from i to n.

Using the above general sums, we then obtain:

localid="1668664755742" i=1nj=in(ji+1)=i=1nk=1ni+1k=i=1n(ni+1)(ni+2)2=i=1nn2in+nni+i2i+2n2i+22=i=1nn22in+3n+i23i+22=12n2i=1n12ni=1ni+3ni=1n1+i=1ni23i=1ni+2i=1n1

Further simplify as:

localid="1668664759736" i=1nj=in(ji+1)=12n2n2nn(n+1)2+3nn+n(n+1)(2n+1)63n(n+1)2+2n=12n3n3+n2+3n2+n(n+1)(2n+1)632n2+32n(n+1)+2n=1212n2+12n+n(n+1)(2n+1)6=1212n(n+1)+n(n+1)(2n+1)6

03

Simplify

Further simplify as:

i=1nj=in(ji+1)=12n(n+1)12+2n+16=12n(n+1)36+2n+16=12n(n+1)2n+46=n(n+1)n+26=16n(n+1)(n+2)

One App. One Place for Learning.

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

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free