Adding sound powers together I am a developer working on a software application which incorporates some basic acoustic simulations. I am trying to assist another developer in implementing equations provided to us by the team's math and science expert (who is unfamiliar with the specific programming language we're using for the project and can't implement the formulas himself).
One area of confusion has been in calculating the total strength of a signal. We have a set of inputs such as this:
40hz  | 20
200hz | 32
500hz | 26

Where the first number is the frequency in hertz, and the second number is the power of that frequency. We can convert the power to decibels using the formula $ dB = 10 Log_{10}(power) $, and we can convert decibels back to powers using $ power = 10^{dB/10} $
The hangup right now: we have a data set of frequencies and powers, like above. We need to get the total signal strength in dB. The math expert originally told us to calculate the sum, in decibels, like this:

*

*$ dB = \frac{1}{n} \sum_{i=1}^n power[n]^2 $
After I sought clarification on several apparent issues with this formula, he changed the formula to this:


*$ dB = 10Log_{10} (\sum_{i=1}^n power[n]^2) $
In other places when we add two decibel levels together we do it like this:
$ a_{dB} + b_{dB} = 10Log_{10}( 10^\frac{a}{10} + 10^\frac{b}{10})  $
which is simply converting from dB to power, adding, then converting back to dB. If we extended that for more than two operands, it seems like the result would be this:


*$ dB = 10Log_{10} (\sum_{i=1}^n power[n]) $
He said that simply adding the powers isn't accurate for a large set of powers, and provided a link to this page. He did not clearly explain how the information on that page related to the work we're doing. Having that page thrown at me greatly confused me, as it introduced the subject of coherent vs. incoherent sounds which we hadn't previously discussed and initially appeared to suggest that formulas 2 and 3 are both correct. The math expert did confirm that our signals are incoherent.
After researching more on my own, the impression I've gotten is that we would square the summed values if they were pressures:


*$ dB = 10Log_{10} (\sum_{i=1}^n pressure[n]^2) $
but that equation 2 would be the appropriate equation when using powers. When I tried to seek clarity on this he kept talking instead about his thoughts on root-mean-square (which we currently aren't using) and said to stick with equation 2 for now.
What is the correct equation to use when summing a set of powers from incoherent sounds together and converting to decibels? #2, #3, or something else?
 A: Well, generally speaking, the right way to add power(s) is #3. As you already stated, the power is related to the square of the pressure, so #4 is pretty much identical to #3.
Now, the concept of coherent and incoherent sources is easier to grasp when dealing with pressure. So, when you are dealing with coherent sources, the total pressure you may experience ranges from double the pressure of your sources (in case they have the same pressure and are at the same phase) or zero (same pressure opposite phase). In this case, it is more convenient to add the pressure of the contributing sources.
When you are dealing with incoherent sources it is more convenient to add their powers. Since we consider power to be given by the square of pressure you can see that
$$P_{tot} = \left( p_{A} + p_{B} \right)^{2} = p_{A}^{2} + p_{B}^{2} + 2p_{A}p_{B}$$
Due to the fact that the sources are incoherent the last term of the equation vanishes (since you have a computer science background you could think of the two signals as one-dimensional vectors which are orthogonal to each other. This is what incoherent means in practice and this is why the last product vanishes). Thus, you end up with
$$P_{tot} = p_{A}^{2} + p_{B}^{2} \implies P_{tot} = P_{A} + P_{B}$$
wherein the above equations $p$ denotes pressure and $P$ denotes power.
In case you are given dB values, you would first have to convert back to linear values with the formula you already have ($P = 10^{\frac{dB}{10}}$), add the values and then convert back to dB with the deciBel formula. The final result is identical to #3. But, once more, if you consider how we reached the conclusion that $P_{tot} = p_{A}^{2} + p_{B}^{2}$, you will realise that if you add pressures you end up with #4, which as stated above is identical due to the fact that $p^{2} = P$.
A: It is something else, for the following reasons. 
When summing the contributions of simultaneous sound pressure levels in different frequency bands, that sum is almost always weighted in a manner which takes into account the varying sensitivity of the human ear to noise in each of those bands. 
There are several different weightings in common use in the acoustics field: A, B, C, and D weighting; these are defined elsewhere (wikipedia has a good article on this) and are used in the field for differing purposes. 
In light of this convention, the summation methods that your mathematician is coming up with would likely be considered not useful to an acoustics or audio engineer. You should consult with a specialist to ensure that your model conforms to the standards and conventions in common use. 
