Question
1. An ascending polynomial may be represented as a list of its coefficients. a) Write a Miranda function 'polAdd p q' to add two ascending
1. An ascending polynomial may be represented as a list of its coefficients.
a) Write a Miranda function 'polAdd p q' to add two ascending polynomials. Note that the polynomials need not be of the same degree.
b) Write a Miranda function 'polSub p q' to subtract two descending polynomials.
c) Write a Miranda function 'polEval p x' to evaluate a polynomial p at the value x.
d) Physicist's Hermite polynomials are defined by the recurrence
H_(n+1)(x) = 2xH_n (x) - 2nH_(n-1) (x), n >= 1 H_0 (x) = 1 H_1 (x) = 2x
Write a Miranda function to generate Hermite polynomials. Note that multiplication of an ascending polynomial by x only requires a 0 to be prepended to the list representation.
The first eleven polynomials are available on Wikipedia.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started