Power Mean Calculator
Compute the generalized mean for any chosen power parameter.
What it does
The power mean, also called the generalized mean or Holder mean, is a family of averages controlled by one parameter. Changing that parameter shifts the result smoothly between familiar means.
This tool raises each value to the chosen power, averages the results, and takes the matching root. It also prints the arithmetic and geometric means so you can see where the chosen value sits.
At p equals one the answer is the ordinary average. At p equals zero the limit is the geometric mean, and at p equals minus one it is the harmonic mean. The quadratic mean at p equals two is the root mean square used in physics.
Because the mean rises with p, it offers a way to tune how much large values count. A bigger p emphasises the largest observations, while a smaller p leans toward the smallest. Zero values cannot be used with a negative power.
How to use
- Enter non-negative values separated by commas or spaces.
- Set the power parameter.
- Read the power mean in the main result.
- Compare it with the arithmetic and geometric means.
- Try p = 1 and p = 0 to confirm the special cases.
- Increase p to see how large values gain influence.
Formula
- p
- Real power parameter controlling the mean.
- x(i)
- The ith non-negative value.
- n
- Number of values.
The case p = 0 is defined by a limit and equals the geometric mean, so the tool computes it directly rather than dividing by zero. For negative powers every value must be positive. Very large positive powers of large values can overflow, so the tool rejects those cases with a message instead of printing an invalid number.
Worked example
Example: power 2 on 1, 2 and 4
Values 1, 2, 4 with power parameter p = 2.
- Raise each value to the power 2: 1, 4, 16.
- Average them: (1 + 4 + 16) / 3 = 7.
- Take the square root: sqrt(7) = 2.645751.
- Arithmetic mean at p = 1 is 7 / 3 = 2.333333.
- Geometric mean at p = 0 is the cube root of 8, which is 2.
- Tool shows 2.645751 with both comparisons.
Reference table
| Power p | Mean | Name |
|---|---|---|
| -1 | 1.714286 | Harmonic mean |
| 0 | 2 | Geometric mean |
| 1 | 2.333333 | Arithmetic mean |
| 2 | 2.645751 | Quadratic mean |
| 3 | 2.897792 | Cubic order |
Limits
- Negative powers require all values to be positive.
- Very large powers can exceed floating point range.
- The result assumes every value uses the same scale.
- The mean alone says nothing about the spread.
Common mistakes
- Using p = 0 literally instead of the geometric limit.
- Entering zero with a negative power.
- Averaging the values before raising them to the power.
- Forgetting the final root after averaging.
- Assuming a larger p always makes the answer smaller.
Try it yourself
Quick checks. Answers sit tucked under each question.
Power mean of 1, 2, 4 at p = 2?
sqrt(7) = 2.645751.
Which power gives the harmonic mean?
p = -1.
What is the mean at p = 0 called?
The geometric mean.
Questions
What is the power mean?
A family of averages parameterised by a power p.
Which value gives the arithmetic mean?
p = 1.
Which gives the geometric mean?
p = 0, defined as a limit.
Which gives the quadratic mean?
p = 2.
Can p be negative?
Yes, but then no value may be zero.
How does p change the result?
The mean increases as p increases.
Sources
- University of California Berkeley: Notes on the Generalized Mean
- University of Northern Iowa: Pythagorean means and generalized means