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

The Hadamard matricesH0,H1,H2, are defined as follows:

  • H0 is the 1×1matrix[1]
  • For k>0,Hkisthe2k×2k matrix

localid="1658916810283" Hk=[Hk-1|Hk-1Hk-1|-Hk-1]

Show that if υ is a column vector of lengthlocalid="1658916598888" n=2k, then the matrix-vector product localid="1658916618774" Hkvcan be calculated using localid="1658916637767" O(nlogn) operations. Assume that all the numbers involved are small enough that basic arithmetic operations like addition and multiplication take unit time.

Short Answer

Expert verified

If is a column vector of length n=2k, then the matrix-vector product Hkv is calculated using role="math" localid="1658916653689" O(nlogn)operations.

Step by step solution

01

Explain Hadamard matrices.

The Hadamard matrix H0 is the matrix. Consider the 2k×2k matrix is defined asHk.,fork>0

. The Hadamard matrices should be defined with the mentioned properties as follows,

localid="1658916992923" Hk=[Hk-1|Hk-1Hk-1|-Hk-1]

02

Show that the matrix-vector product   can be calculated using   operations.

Consider the Hadamard matrices H0,H1,H2,defined as follows,

Hk=[Hk-1|Hk-1Hk-1|-Hk-1]

Consider that If is a column vector of length n=2k,, then the matrix-vector product Hkv is calculated as follows,

HkV=Hk-1Hk-1Hk-1-Hk-1VuVd=Hk-1vu+VdHk-1vu+Vd

The above calculation has the arithmetic operations that takes unit time. Then the complexity of operations can be calculated as follows,

Tn=2Tn2+On=Onlogn

Therefore, the matrix-vector product Hkv is calculated usingOnlognoperations.

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

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

Practice with polynomial multiplication by FFT.

(a) Suppose that you want to multiply the two polynomials x + 1 and x2+1using the FFT. Choose an appropriate power of two, find the FFT of the two sequences, multiply the results component wise, and compute the inverse FFT to get the final result.

(b) Repeat for the pair of polynomials 1+x+2x2and 2 + 3x.

An array A[1...n] is said to have a majority element if more than half of its entries are the same. Given an array, the task is to design an efficient algorithm to tell whether the array has a majority element, and, if so, to find that element. The elements of the array are not necessarily from some ordered domain like the integers, and so there can be no comparisons of the form “ is A[i]>A[j] ?”. (Think of the array elements as GIF files, say.) However you can answer questions of the form: “is ..?” in constant time.

(a) Show how to solve this problem in O(nlogn) time. (Hint: Split the array A into two arrays A1and A2of half the size. Does knowing the majority elements of A1and A2help you figure out the majority element of A? If so, you can use a divide-and-conquer approach.)

(b) Can you give a linear-time algorithm? (Hint: Here’s another divide-and-conquer approach:• Pair up the elements of A arbitrarily, to get n/2 pairs• Look at each pair: if the two elements are different, discard both of them; if they are the same, keep just one of them . Show that after this procedure there are at most n/2 elements left, and that they have a majority element if A does.)

What is the sum of the nth roots of unity? What is their product if n is odd? If n is even?

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.

Sign-up for free