top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Checks if two matrices have identical values in all elements with minimum complexity?

0 votes
445 views
Checks if two matrices have identical values in all elements with minimum complexity?
posted Mar 2, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

suppose

A(n,m) = 
1 2 3         
4 5 6                            
7 8 9

and 

B(p, q) = 
1 1
1 1

What is best method to find min of square of difference of sub-matrices of A and B e.g.

sub-matrices of A =

1 2    |     2 3   |    4 5    |   5 6
3 4    |     5 6   |    7 8    |   8 9

Difference of first sub-matrix of A with B =

(1-1)  (2-1)    = |     0 1
(3-1)  (4-1)      |     2 3

sum of square of elements = 0*0 + 1*1 + 2*2 + 3*3 = 14

similar steps for other sub-matrices of A

Please suggest looking for an alternate method or algorithm which has time complexity less than O(n*m*p*q)

+1 vote

I'm trying to multiply two matrices that has different size.

import numpy as np

a = np.random.randn(4, 3)
b = np.random.randn(4, 1)

print a
print b

How should I multiply a and b so that the multipled matrix's size is 4*3?

I want to multiply matrix 'b' to each row of matrix 'a'.
So that if matrix a is
[[1, 2, 3],
[2, 3, 4]]
and b is
[[2],
[3]]
a*b is
[[2, 4, 6],
[4, 6 ,8]]

Plz help me, if possible, plz use numpy

0 votes

Given an unordered array A of size n and integer x. What is the best complexity to find two elements in A whose sum is x?
Share the algo, its complexity and if possible C code.

...