Question

Suppose that two n x n matrices A and B are stored on a 2D mesh...

Suppose that two n x n matrices A and B are stored on a 2D mesh of n2 pro-
cessors such that Pi;j holds A[i; j] and B[j; i]. Write pseudocode for an asynchronous
algorithm that computes the product of A and B in O(n).

Homework Answers

Answer #1

here we have two nxn matrices are A and B are sorted on a 2D of n2 processors

psuedocode : it is defined as the outline of the programming language.

input: writing psudocode for the asynchronus algorithm that computes the product of A and B in O(n).

output: user enter the A and B matrices

matrices should contain 2D like two rows and two colomns

here P=AxB

while P marice solve within O(n)

its ok

otherwise reset the A and B matrice values

and perform product operations to get the O(n).

Know the answer?
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
Similar Questions
9. Suppose AB is defined and you know all the entries in both matrices.                a)...
9. Suppose AB is defined and you know all the entries in both matrices.                a) Find the entry in row i and column j of AB                b) Write column j of AB as a linear combination of columns of A.                c) Write row i of AB as a liner combination of rows of B                d) If A is size m×n and B is size x p , write AB as the sum of n matrices of...
Suppose A, B, C are n x n matrices with det. A =1,det B =-1, det...
Suppose A, B, C are n x n matrices with det. A =1,det B =-1, det C is 2, find AB, A+B,
We see that this computes the product of two matrices. Add a new kernel code, called...
We see that this computes the product of two matrices. Add a new kernel code, called sum, to compute the sum of the two matrices. #include <stdio.h> #include <math.h> #include <sys/time.h> #define TILE_WIDTH 2 #define WIDTH 6 // Kernel function execute by the device (GPU) __global__ void product (float *d_a, float *d_b, float *d_c, const int n) {    int col = blockIdx.x * blockDim.x + threadIdx.x ;    int row = blockIdx.y * blockDim.y + threadIdx.y ;    float...
1. Given an n-element array A, Algorithm X executes an O(n)-time computation for each even number...
1. Given an n-element array A, Algorithm X executes an O(n)-time computation for each even number in A and an O(log n)-time computation for each odd number in A. What is the best-case running time of Algorithm X? What is the worst-case running time of Algorithm X? 2. Given an array, A, of n integers, give an O(n)-time algorithm that finds the longest subarray of A such that all the numbers in that subarray are in sorted order. Your algorithm...
Suppose A and B are invertible matrices, with A being m x m and B being...
Suppose A and B are invertible matrices, with A being m x m and B being n x n. For any m x n matrix C and any n x m matrix D, show that : a) (A + CBD)-1 = A-1- A-1C(B-1 + DA-1C)-1DA-1 b) If A, B and A + B are all m x m invertible matrices, then deduce from (a) above that (A + B)-1 = A-1 - A-1(B-1 + A-1)-1A-1
Write a function that will accept two integer matrices A and B by reference parameters, and...
Write a function that will accept two integer matrices A and B by reference parameters, and two integers i and j as a value parameter. The function will return an integer m, which is the (i,j)-th coefficient of matrix denoted by A*B (multiplication of A and B). For example, if M = A*B, the function will return m, which is equal to M[i][j]. Explain the time complexity of this function inside of the code as a comment.
Write pseudocode for a simple algorithm for addition of two n-digit numbers (one of them could...
Write pseudocode for a simple algorithm for addition of two n-digit numbers (one of them could be &lt; n digits with 0&#39;s appended to the left) in base-10, as follows. Assume the digits are stored in arrays A and B, with A[1] and B[1] being the rightmost digits and A[n] and B[n] being the leftmost digits. Use a for loop to go from right to left adding the digits and keeping track of the carry. Now, here&#39;s the real task:...
Given the following algorithm, matching each statement to the correct sequence for complexity analysis. procedure Alg3(A):...
Given the following algorithm, matching each statement to the correct sequence for complexity analysis. procedure Alg3(A): A is a list of n integers 1 for i = 1 to n-1 do 2   x=aix=ai 3 j = i − 1 4 while (j ≥≥ 0) do 5 if x≥ajx≥aj then 6 break 7 end if 8   aj+1=ajaj+1=aj 9 j = j − 1 a end while b   aj+1=xaj+1=x c end for d return A The complexity of this algorithm is O(n2)O(n2)...
Let A, B be n × n matrices. The following are two incorrect proofs that ABhas...
Let A, B be n × n matrices. The following are two incorrect proofs that ABhas the same non-zero eigenvalues as BA. For each, state two things wrong with the proof: (i) We will prove that AB and BA have the same characteristic equation. We have that det(AB − λI) = det(ABAA−1 − λAA−1) = det(A(BA − λI)A−1) = det(A) + det(BA − λI) − det(A) = det(BA − λI) Hence det(AB − λI) = det(BA − λI), and so...
How to measure the time complexity of an algorithm? Identify an important operation in the algorithm...
How to measure the time complexity of an algorithm? Identify an important operation in the algorithm that is executed most frequently. Express the number of times it is executed as a function of N. Convert this expression into the Big-O notation. A. For each of the three fragments of code, what is its worst-case time complexity, in the form "O(…)". (Use the given solution to the first problem as a model)                 //----------------- This is a sample problem – solved ------...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT