A square wave of 10-V peak-to-peak amplitude and zero average is applied to a circuit employing a 100 ohm resistor and a diode (simple circuit).

What is the average output voltage (across the resistor)? The book gives a answer of 2.5 volts, which suggest that you simply take the peak voltage and divide by 2.

However in 3.14 They change the average voltage of the square wave to 2volts while keeping the peak-to-peak at 10volts. What is the average output voltage (across the resistor)?

Incidently how can you have a 10V p-p square wave that averages to 2 volts?

I also looked up root-mean-squared to see if it applied to this problem. But usually that is defined for sine-wave and its application to square waves is not that clear.

Please help me sort this out. Thanks