Matrix Multiplication
You are given a NxN matrix.Your task is to write a function to return the inverse of the matrix
Input Format
Constraints:
Output Format
Output N lines, the inverse of the matrix.
Sample Input
2
2
0.3 0.4
-1 1
You are given two matrices of any dimensions. Your task is to return the product of these matrices.
Input Format
The first line contains a positive integerM1 indicating number of rows of the first matrix.
The second line contains a positive integerN1 indicating number of columns of the first matrix.
Each of the next M1 lines contains N1 space separated numbers denoting a row of the first matrix.
The next line contains a positive integer M2 indicating number of rows of the second matrix.
The second next line contains a positive integer N2 indicating number of columns of the second matrix.
Each of the next M2 lines contains N2 space separated numbers denoting a row of the second matrix.
Round all the elements of the resultant matrix to the nearest integer.
Constraints:
M1,N1, M2, N2<=100
Usage of any external packages which are not already imported will lead to the invalidation of the solution provided.
Given two 1D arrays of same length(X = independent; Y-dependent), the ordinary least square (OLS) solution are a set of variables(alpha and beta) such that the squared error between Y and (alpha + beta*X) is minimized.
Using Matrix Multiplication and Matrix Inversion or otherwise, get the OLS solution of a given problem with input as 1D arrays of X and Y. 1
The OLS Solution has to be returned in the format of a 1D array containing alpha and beta in that order.
Input Format
Constraints: