Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Two questions in PYTHON: 1. Use np.polymul and np.polyint to define the L2 inner product of u and v on the interval (-1, 1). Both

Two questions in PYTHON:

1. Use np.polymul and np.polyint to define the L2 inner product of u and v on the interval (-1, 1). Both u and v are polynomials expressed as arrays in the usual way.

2.Compute the norm of the polynomial p(x) induced by poly_inner_product().image text in transcribed

def poly inner_product (u, v): Use np.polymul and np.polyint to define the 12 inner product of u and v on the interval (-1, 1) Both u and v are polynomials expressed as arrays in the usual way # YOUR CODE HERE raise NotImplementedError def print_inner_product (u, v): display(Math( "\langle {}, .format (polystring(u), {} angle = {}" polystring(v), poly_inner product(u, v)))) print-inner-product([1], [1, oj) print-inner-product([1, 0, ], [1]) assert np.isclose(poly-inner-product([3,0,-1], [11), ) assert np.isclose(poly_inner_product ([3,0,-1], [5,0,-3,0]), ) assert np.isclose(poly_inner_product ([1,0], [5,0,-3,0]), e) assert np.isclose(poly_inner_product ([3,2,1], [4,0,3,1]), 11.2) def poly norm(p) Compute the norm of the polynomial p(x) induced by poly inner_product() # YOUR CODE HERE raise NotImplementedError() assert np.isclose(poly_norm([1]), np.sqrt(2)) assert np.isclose(poly_norm([1,0]), np.sqrt (2/3)) assert np.isclose(poly.nom( [3, ,-1]), .sqrt(8/5)) print('Tests pass def poly inner_product (u, v): Use np.polymul and np.polyint to define the 12 inner product of u and v on the interval (-1, 1) Both u and v are polynomials expressed as arrays in the usual way # YOUR CODE HERE raise NotImplementedError def print_inner_product (u, v): display(Math( "\langle {}, .format (polystring(u), {} angle = {}" polystring(v), poly_inner product(u, v)))) print-inner-product([1], [1, oj) print-inner-product([1, 0, ], [1]) assert np.isclose(poly-inner-product([3,0,-1], [11), ) assert np.isclose(poly_inner_product ([3,0,-1], [5,0,-3,0]), ) assert np.isclose(poly_inner_product ([1,0], [5,0,-3,0]), e) assert np.isclose(poly_inner_product ([3,2,1], [4,0,3,1]), 11.2) def poly norm(p) Compute the norm of the polynomial p(x) induced by poly inner_product() # YOUR CODE HERE raise NotImplementedError() assert np.isclose(poly_norm([1]), np.sqrt(2)) assert np.isclose(poly_norm([1,0]), np.sqrt (2/3)) assert np.isclose(poly.nom( [3, ,-1]), .sqrt(8/5)) print('Tests pass

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

(t + 5) Answered: 1 week ago

Answered: 1 week ago

Question

1. Define mass and mediated communication

Answered: 1 week ago