Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create three lists ( A , B , and C with random values in Python such that each list contains five real values. Calculate the

Create three lists (A,B, and C with random values in Python such that each list contains five real values.
Calculate the distances between the lists using the formulas below.
d(A,B)=i=15(Ai-Bi)22
d(A,B)=(Ai-Bi)T(Ai-Bi)2
cosinc(A,B)=A*B|A||B|
Here, ()T is transpose. (.) denotes dot product and I||| presents the magnitude of the vector. You MUST
implement these equations from seratch without using any Python library or routines.
Randomly generate two matrices (P and Q) with four rows and five columns. You can use numpy arrays in
Python. Write a program that obtains L(2,1)-norm of a matrix. First, take the L2 norm of each row of a matrix
as below.
Prnorm(i)=jnredPij22
This is actually sum of squared values in each row. Then, obtain the L1 norm of the L2 norm values Prnorm as
below.
P2,1=inro|P(i)|
Here, nrew and ncol represent the numbers of rows and columns, respectively.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mysql Examples Explanations Explain Examples

Authors: Harry Baker ,Ray Yao

1st Edition

B0CQK9RN2J, 979-8872176237

More Books

Students also viewed these Databases questions

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago

Question

Different types of Grading?

Answered: 1 week ago