Home / Expert Answers / Computer Science / solve-using-python-solve-using-python-solve-using-python-in-the-lec-pa260

(Solved): SOLVE USING PYTHON!!! SOLVE USING PYTHON!!! SOLVE USING PYTHON!!! In the lec ...



SOLVE USING PYTHON!!!

SOLVE USING PYTHON!!!

SOLVE USING PYTHON!!!???????In the lectures we focused on the \( L^{2} \)-norm. We also briefly mentioned the \( L^{1} \) and \( L^{\infty} \) norm. LetThe \( L^{\infty} \) norm is given by
\[
\|A\|_{\infty}=\max _{i} \sum_{j=1}^{n}\left|a_{i j}\right|
\]
i.e., it is the max o

In the lectures we focused on the \( L^{2} \)-norm. We also briefly mentioned the \( L^{1} \) and \( L^{\infty} \) norm. Let's look at calculating those as well for a general \( m \times n \) matrix. The \( L^{1} \) norm is given by \[ \|A\|_{1}=\max _{j} \sum_{i=1}^{m}\left|a_{i j}\right| \] i.e., it is the max of the sums of the absolute values of each column. Write a function that computes the \( L^{1} \)-norm using only loops. The function should use no special numpy functions except np.abs() ( np. shape, np.inf, etc are ok to use). In \( [42]: \mathbf{X} \) Check your result against NumPy's la. norm \( (A, 1) \) function for the following random matrix In [5]: \( \boldsymbol{X} \) The \( L^{\infty} \) norm is given by \[ \|A\|_{\infty}=\max _{i} \sum_{j=1}^{n}\left|a_{i j}\right| \] i.e., it is the max of the sums of the absolute values of each row. Write a function that computes the \( L^{\infty} \)-norm using only loops and no special numpy functions.


We have an Answer from Expert

View Expert Answer

Expert Answer


The function for L1 Norm- import numpy as np def l1norm(A): x= A.shape m = x[0] n = x[1] sm = []
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe