Question
just p1.1.3

P1.1.3 Give an O(n) algorithm for computing C = (ay?) where I and y are n-vectors. ✓ P1.1.4 Suppose D = ABC where A E RMXN, B
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Assuming x and y be n*1 and (x*y.T)^k means element wise powering

Algorithm

set res[n][n]

for i =1 to n do

-> for j = 1 to n do

->-> res[i][j] = x[i][1]*y[j][1]

->end

end

return res

Time complexity = O(n*n) for 2 nested loops each running from 1 to n

Add a comment
Know the answer?
Add Answer to:
just p1.1.3 P1.1.3 Give an O(n) algorithm for computing C = (ay?) where I and y...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Here is a recursive algorithm that answers the same question as posed on Group HW3, finding...

    Here is a recursive algorithm that answers the same question as posed on Group HW3, finding the number of people who are taller than everyone before them in line. NumCanSeeRec(a1,... , an : list of n 2 1 distinct heights) (a) ifn -1 then (b return 1 (c) c= ŅumCanSeeRee(a1, , an-1) d) for i:- 1 ton- 1 (e) if a, an then return c (g) return c+1 Answer the following questions about this algorithm. Please show your work. (a)...

  • Give a context free grammar for the language L where L = {a"bam I n>:O and...

    Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...

  • 3. Consider the multiple linear regression model iid where Xi, . . . ,Xp-1 ,i are observed covariate values for observation i, and Ei ~N(0,ơ2) (a) What is the interpretation of B1 in this model? (b)...

    3. Consider the multiple linear regression model iid where Xi, . . . ,Xp-1 ,i are observed covariate values for observation i, and Ei ~N(0,ơ2) (a) What is the interpretation of B1 in this model? (b) Write the matrix form of the model. Label the response vector, design matrix, coefficient vector, and error vector, and specify the dimensions and elements for each. (c) Write the likelihood, log-likelihood, and in matrix form. aB (d) Solve : 0 for β, the MLE...

  • I already solved part A and I just need help with part B 1. Matrix Multiplication...

    I already solved part A and I just need help with part B 1. Matrix Multiplication The product of two n xn matrices X and Y is a third n x n matrix 2 = XY, with entries 2 - 21; = xixYk x k=1 There are n’ entries to compute, each one at a cost of O(n). The formula implies an algorithm with O(nº) running time. For a long time this was widely believed to be the best running...

  • 8. (tan (u-1-e", r-6v2) and g(x, y) (eno-n), 8(x-y)). Letf (u, v)s - (Use symbolic notation and fractions where needed.) (Give your answer as comma separated list of a, h, c, d from Do g)(, I) -...

    8. (tan (u-1-e", r-6v2) and g(x, y) (eno-n), 8(x-y)). Letf (u, v)s - (Use symbolic notation and fractions where needed.) (Give your answer as comma separated list of a, h, c, d from Do g)(, I) - 8. (tan (u-1-e", r-6v2) and g(x, y) (eno-n), 8(x-y)). Letf (u, v)s - (Use symbolic notation and fractions where needed.) (Give your answer as comma separated list of a, h, c, d from Do g)(, I) -

  • 5. A three-heap with n elements can be stored in an array A, where A[O] contains...

    5. A three-heap with n elements can be stored in an array A, where A[O] contains the root of the tree. a) Draw the three-heap that results from inserting 5, 2, 8, 3, 6, 4, 9, 7, 1 in that order into an initially empty three-heap. You do not need to show the array representation of the heap. You are only required to show the final tree, although if you draw intermediate trees. b) Assuming that elements are placed in...

  • I just need c, d, and e. Consider the circuit below, where R-5000Ω ,C-0.25μF . The...

    I just need c, d, and e. Consider the circuit below, where R-5000Ω ,C-0.25μF . The voltage amplitude is 10 V and the frequency of oscillation is ω-180 rad / s , when voltages and currents are requested, express them in purely real terms. Note: this circuit is examined in some detail in Chapter 7, section 2. Have a look at that first. What is the total impedance? Express it as both a complex number and as magnitude and phase....

  • C++ assignment help! The instructions are below, i included the main driver, i just need help...

    C++ assignment help! The instructions are below, i included the main driver, i just need help with calling the functions in the main function This assignment will access your skills using C++ strings and dynamic arrays. After completing this assignment you will be able to do the following: (1) allocate memory dynamically, (2) implement a default constructor, (3) insert and remove an item from an unsorted dynamic array of strings, (4) use the string class member functions, (5) implement a...

  • I just need f, g, and h. Consider the circuit below, where R-5000Ω ,C-0.25μF . The...

    I just need f, g, and h. Consider the circuit below, where R-5000Ω ,C-0.25μF . The voltage amplitude is 10 V and the frequency of oscillation is ω-180 rad / s , when voltages and currents are requested, express them in purely real terms. Note: this circuit is examined in some detail in Chapter 7, section 2. Have a look at that first. What is the total impedance? Express it as both a complex number and as magnitude and phase....

  • this is all 1 problem! Ive been trying this for 4 hours and I just cant...

    this is all 1 problem! Ive been trying this for 4 hours and I just cant figure all these answers out. please circle all answers and remember the box with values, thank you so much and Ill be sure to give you a good rating and Ill also Venmo/Cashapp you 20 for this if you want. thank you here is the example problem to help lead you in the right direction Lab 1: Electric Charge, Electric Field and Electric potential...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT