Question: NOTE: Code should be written in Haskell To compute a weighted average of several values, you assign each value upsilon_i a weight w_i. The weighted

 NOTE: Code should be written in Haskell To compute a weighted

NOTE: Code should be written in Haskell

To compute a weighted average of several values, you assign each value upsilon_i a weight w_i. The weighted average is the average, where each value is added in proportion to its weight: sigma w_i upsilon_i/sigma w_i. Write code for the function weightAvg. that takes in a list of weights and a list of values, and computes a weighted average of the values. You are welcome to write helper functions as needed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!