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

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.

Short Answer

Expert verified
  1. ω=3
  2. Transformation of the sequence (0,1,1,1,5,2)is(3,6,4,2,3,3). .
  3. Transformation of the sequence (3,6,4,2,3,3)is(0,1,1,1,5,2). .
  4. Transformation of the sequence (3,6,4,2,3,3)is(-1,1,1,3,1,1)..

Step by step solution

01

Solution of part (a) and (b)  

a.)

Find the value of ω:

On observing, the value of ω=3 ……

The powers of w are distinct modulo:

Value of ω2:

• Substitute ω=3 in localid="1659340352169" ω2and take modulo .

ω2=32mod7=9mod7=2

Value of ω3:

• Substitute ω=3inω3 and take modulo .

ω3=27mod7=6

Value of ω4:

• Substitute ω=3inω4 and take modulo .

localid="1659340501146" ω4=34mod7=81mod7=4

Value of ω5:

• Substitute ω=3inω5 and take modulo .

ω5=35mod7=243mod7=5

Value of ω6:

• Substitute ω=3inω6 and take modulo .

ω6=36mod7=729mod7=1

The values of (ω=3,ω2=2,ω3=6,ω4=4,ω5=5,ω6=1) are distinct.

To show ω+ω2+ω3+ω4+ω5+ω6=0 :

• Substitute the values (ω=3,ω2=2,ω3=6,ω4=4,ω5=5,ω6=1)and take modulo in following:

ω+ω2+ω3+ω4+ω5+ω6(2)

Thus,

(ω+ω2+ω3+ω4+ω5+ω6)mod7=(3+2+6+4+5+1)mod7=21mod7=0

Therefore, ω+ω2+ω3+ω4+ω5+ω6=0

02

Solution of part   (b).  

b.)

Coefficient representation of 6×6matrix of FFT (Fast Fourier Transform)M6(ω) ,is shown below:

M6(ω)=1111111ωω2ω3ω4ω51ω2ω4ω6ω8ω101ω3ω6ω9ω12ω151ω4ω8ω12ω16ω201ω5ω10ω15ω20ω25 (3).....

From section (a) the value of powers of are obtained as:

ω=3,ω2=2,ω3=6,ω4=4,ω5=5,ω6=1 (4) ……

The value of is,

ω8=38=6561mod7=2ω9=39=19683mod7=6ω10=310=59049mod7=4ω12=312=531441mod7=1ω15=315=14348907mod7=6ω16=316=143046721mod7=4ω20=320=3486784401mod7=2ω25=325=84728809443mod7=3 …… (5)

Substitute the powers of w from equation (4) and equation (5) in equation (3).

localid="1659341811588" M6(ω)=111111132645124124161616142142154623. (6)....

The FFT of (0,1,1,1,5,2)is calculated as follows:

FFT of A=M6(ω)×A …… (7)

Substitute the values M6(ω)from Equation (6) and A as (0,1,1,1,5,2) in Equation .

Multiplying the sequence (0,1,1,1,5,2) with equation (6) .

localid="1659341818991" FFTofA=111111132645124124161616142142154623

=1×01×11×11×11×51×21×03×02×16×14×55×21×02×14×11×12×54×21×06×11×16×11×56×21×04×12×11×14×52×21×05×14×16×12×53×2

=104125303131...... (8)

Taking modulo for equation .

10mod714mod725mod730mod732mod731mod7=364233

Therefore, the transformation of the sequence (0,1,1,1,5,2)is(3,6,4,2,3,3)

03

Solution of part (c).  

c.)

Inverse FFT of (3,6,4,2,3,3)::

Let P=(3,6,4,2,3,3) …… (9)

Coefficient representation of M6(ω(-1)) is shown below:

Inverse FFT(P)=16PM6(ω-1)…… (10)

To represent the matrix form for the inverse FFT with modulo first find the modular inverse. Modular inverse of,

1mod7=12mod7=43mod7=54mod7=25mod7=36mod7=6(11)

To get localid="1659345943519" M6(ω-1), substitute the inverse of each values. Thus,

localid="1659346430928" M6(ω-1)=111111111111111514161213111412111412111611161116111214111214111312161415

Substitute equation (9), equation (12) in equation (10).

localid="1659346499692" InverseFTT(P)=1/6111111111111111514161213111412111412111611161116111214111214111312161415×364233……

Thus, substitute the arithmetic value for the arithmetic value 11, for the arithmetic value 1,12, for the arithmetic value 5,14, for the arithmetic value 2,15, for the arithmetic value 3 and 16 for the arithmetic value 6 from equation (11) in equation (13) to find the inverse.

InverseFTT(P)=1/6111111111111111514161213111412111412111611161116111214111214111312161415×364233

=6×1×31×61×41×21×31×31×35×64×46×22×33×31×34×62×41×24×32×31×36×61×46×21×36×31×32×64×41×22×34×31×33×62×46×24×35×3=6×217655765168=126456330456306408 …… (14)

Taking modulo 7 for equation ( 14 ).

=126mod7456mod7330mod7446mod7306mod7408mod7=011152

Therefore, the transformation of the sequence (3,6,4,2,3,3)is(0,1,1,1,5,2)..

04

Solution of part (d).  

d.)

The standard form for degree-d polynomial is

A(x)=a0+a1x++adxd(15)

The first polynomial is x2+x+1(16)

Compare equation (15) and (16) equation

a0=1a1=1a2=1a3=0a4=0a5=0(17)

Consider the formula of polynomial to matrix transformation.

localid="1659427656504" a0a1a2a3a4a5 ……

Substitute the values of a0,a1,a2,a3,a4,a5 in Equation (18)

A=111000……

Find FFT of (1,1,1,0,0,0)::

Substitute the values M6(ω) from Equation (6) and A from Equation (19) in Equation (7) .

localid="1659418277264" FFTofA=111111132645124124161616142142154623×111000=1×1+1×1+1×1+1×0+1×0+1×01×1+3×1+2×1+6×0+4×0+5×01×1+2×1+4×1+1×0+2×0+4×01×1+6×1+1×1+6×0+1×0+6×01×1+4×1+2×1+1×0+4×0+2×01×1+5×1+4×1+6×0+2×0+3×0=3278710......20

Taking modulo 7 for the FFT of equation (20) .

3mod76mod77mod78mod77mod710mod7=360103

Therefore, the transformation of the sequence (1,1,1,0,0,0)is(3,6,0,1,0,3)

The second polynomial is x3+2x-1……

Compare equations (21) and equation (15)

a0=-1a1=2a2=0a3=1a4=0a5=0(22)

The value of is so take modulo as shown below:

-1mod7=6(23)

Thus,a0=-1 substitute a0 as 6 in equations (22)

a0=6a1=2a2=0a3=1a4=0a5=0

Consider the formula of polynomial to matrix transformation.

B=a0a1a2a3a4a5.....24

Substitute the values of a0,a1,a2,a3,a4,a5 in Equation (24) .

B=620100.....25

Find FFT of (6,2,0,1,0,0):

Substitute the values M6(ω)from Equation (6) and B from Equation (25) in Equation (7) .

FFTofB=111111132645124124161616142142154623×620100=1×61×21×01×11×01×01×63×22×06×14×05×01×62×24×01×12×04×01×66×21×06×11×06×01×64×22×01×14×02×01×65×21×06×12×03×0=91811241522.....26

Taking modulo 7 for equation (26)

=9mod718mod711mod724mod715mod722mod7=244311

Therefore, the transformation of the sequence (6,2,0,1,0,0)is(2,4,4,3,1,1)

Let the product of FFT of A and B be P. The product is calculated as shown below:

P=A×B(27)

Substitute the value of “ A” from Equation (19) and “B ” from Equation (25) in Equation(27) .

P=360103×244311=630303....28 ……

Modular inverse of,

6mod7=624mod7=240mod7=03mod7=30mod7=03mod7=3....29

Substitute the Equation in Equation . Thus, the product is shown below:

P=630303....30

Inverse FFT:

To get the final polynomial in coefficient representation takes the inverse FFT for the product.

Substitute equation (30) , equation (12) in equation (10) .

InverseFTT(P)=16111111111111111514161213111412111412111611161116111214111214111312161415×630303......31

Thus, substitute the arithmetic value 11 for the arithmetic value 1, 12 for the arithmetic value 4,13 for the arithmetic value 5,14 for the arithmetic value 2,15 for the arithmetic value 3 and 16 for the arithmetic value 6 from equation in(11) equation (13) to find the inverse.

localid="1659426193884" InverseFTT(P)=6×111111111111111514161213111412111412111611161116111214111214111312161415×630303=6×1×6+1×3+1×0+1×3+1×0+1×31×6+3×3+2×0+6×3+4×0+5×31×6+2×3+4×0+1×3+2×0+4×31×6+6×3+1×0+6×3+1×0+6×31×6+4×3+2×0+1×3+4×0+2×31×6+5×3+4×0+6×3+2×0+3×3=6×124827622748=90288162360162288......32

Taking modulo for equation .

=90mod7288mod7162mod7360mod7162mod7288mod7=611311......30

From equation (23) substitute 6 as -1 in equation (33)

InverseFFTof(P)=-111311

Therefore, the transformation of the sequence (3,6,4,2,3,3)is(-1,1,1,3,1,1). .

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

Suppose we want to evaluate the polynomial P(x) = a0 + a1x + a2x2 + ... + anxn at point x.

  1. Show that the following simple routine, known as Horner’s rule, does the job and leaves the answer in z.
    z = an
    for I = n-1 down to 0 :
    z = zx + ai
  2. How many additions and multiplications does this routine use, as a function of n ? Can you find a polynomial for which an alternative method is substantially better?

Given a sorted array of distinct integersA[1,...,n] , you want to find out whether there is an indexi for which A[i]=i. Give a divide-and-conquer algorithm that runs in time O(logn).

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, a A2 nd 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(nlog n) time. (Hint: Split the array A into two arrays A1 and of half the size. Does knowing the majority elements of A1 and A2 help 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.)

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.

Suppose you are choosing between the following three algorithms: • Algorithm A solves problems by dividing them into five sub-problems of half the size, recursively solving each sub-problem, and then combining the solutions in linear time. •

Algorithm B solves problems of size n by recursively solving two sub-problems of size n-1and then combining the solutions in constant time. • Algorithm C solves problems of size n by dividing them into nine sub-problems of size n/3, recursively solving each sub-problem, and then combining the solutions in O(n2)time.

What are the running times of each of these algorithms (in big- O notation), and which would you choose?

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