# Weighted Average

Pure mathematics is, in its way, the poetry of logical ideas, Albert Einstein.

# Recall

Antiderivatives are fundamental concepts in calculus. They are the inverse operation of derivatives.

Given a function f(x), an antiderivative, also known as indefinite integral, F, is the function that can be differentiated to obtain the original function, that is, F’ = f, e.g., 3x2 -1 is the antiderivative of x3 -x +7 because $\frac{d}{dx} (x^3-x+7) = 3x^2 -1$. Symbolically, we write F(x) = $\int f(x)dx$.

The process of finding antiderivatives is called integration.

The Fundamental Theorem of Calculus states roughly that the integral of a function f over an interval is equal to the change of any antiderivate F (F'(x) = f(x)) between the ends of the interval, i.e., $\int_{a}^{b} f(x)dx = F(b)-F(a)=F(x) \bigg|_{a}^{b}$

Definition. The average value of a continuous function f(x) over the interval [a, b] is AVG = $\frac{y_1+y_2+···+y_n}{n}$ where y1, y2, ···, yn represent the function values at specific points within the interval [a, b] and n is the total number of points where the function is evaluated within the interval [a, b].

Since integrals are essentially a sum of all of the possible f(x) values, AVG = $\frac{1}{b-a}\int_{a}^{b} f(x)dx$.

Said in a more mathematical way, $\lim_{n \to ∞}\frac{y_1+y_2+···+y_n}{n}$ = $\frac{1}{b-a}\int_{a}^{b} f(x)dx$ where $\int_{a}^{b} f(x)dx$ represents the signed area under the curve of f(x) between x = a and x = b, $\frac{1}{b-a}$ is a scaling factor.

Average Value Theorem. If f is a continuous function on [a, b], then its average or mean value on [a, b] is given by favg = $\frac{\int_{a}^{b} f(x)dx}{b-a}$

# Weighted Average

A weighted average is a method of computing an average where some elements contribute more than others. In other words, some elements or data points have different weights or importance assigned to them. The weights reflect the relative significance or contribution of each element to the overall average.

The weighted average gives more importance to certain values, elements, or data points in the dataset based on their assigned weights. This type of average is commonly used in various fields and situations where different elements contribute differently to the overall average.

Weighted averages are calculated by multiplying each value by its assigned weight, summing up these products, and then dividing by the sum of all the weights.

The weighted average of a list of elements x1, ···, xn with corresponding weights w1, ···, wn is $\frac{w_1x_1+w_2x_2 + ··· + w_nx_n}{w_1 + ··· + w_n}$. Note that if the weights are all just 1, that is, all elements or data points have the same importance, then the weighted average is just a plain average.

# Exercises

• In finance, a weighted average could be used to calculate the average price of your stock. Let’s suppose that you are interested in investing in a stock, and you bought it for 10, 20, and 25 dollars, and you bought w1, w2, and w3 shares respectively. How much did you spend? 10w1 + 20w2 + 25w3, and the average price is $\frac{10w_1 + 20w_2 + 25w_3}{w_1 + w_2 + w_3}$.

• A general purchases 20,000 units of ammo at 1 each in India, 15,000 at 1.15 each in the USA and 5,000 at 2 each in Germany. We use the price per unit as values and the weight as the total number of units being purchased in every country.

# Bibliography

1. NPTEL-NOC IITM, Introduction to Galois Theory.
2. Algebra, Second Edition, by Michael Artin.
3. LibreTexts, Calculus. Abstract and Geometric Algebra, Abstract Algebra: Theory and Applications (Judson).
4. Field and Galois Theory, by Patrick Morandi. Springer.
5. Michael Penn, and MathMajor.
6. Contemporary Abstract Algebra, Joseph, A. Gallian.
7. YouTube’s Andrew Misseldine: Calculus. College Algebra and Abstract Algebra.
8. MIT OpenCourseWare 18.01 Single Variable Calculus, Fall 2007 and 18.02 Multivariable Calculus, Fall 2007.
9. Calculus Early Transcendentals: Differential & Multi-Variable Calculus for Social Sciences.
10. Chau Tu.
Bitcoin donation