Editing 2295: Garbage Math
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | This comic | + | {{incomplete|Created by a ZILOG Z80. Please mention here why this explanation isn't complete. Do NOT delete this tag too soon.}} |
+ | This comic explains the "garbage in, garbage out" concept using arithmetical expressions. Just like the comic says, if you get garbage in any part of your workflow, you get garbage as a result. | ||
− | + | Some of these rules correspond to the rules of floating point arithmetic (https://en.wikipedia.org/wiki/Floating-point_arithmetic), while others may be inspired by the rules of propagation of uncertainty (https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae) where a "garbage" number would correspond to an estimate with a high degree of uncertainty, and the uncertainty of the result of arithmetic operations will tend to be dominated by the term with the highest uncertainty. The rule about N pieces of independent garbage reflects the central limit theorem (https://en.wikipedia.org/wiki/Central_limit_theorem) and how it predicts that the uncertainty (or standard error https://en.wikipedia.org/wiki/Standard_error) of an estimate will be reduced when independent estimates are averaged. | |
− | + | This comic is probably not COVID-19 related (though arguably it could be related to doing statistical analyses with the varying quality of data related to the disease), meaning that the 19 comic streak preceding this on topics relating to COVID-19 is probably broken. | |
+ | |||
+ | This comic is about the propagation of errors in numerical analysis and statistics, but described in much more colloquial terms. Numbers with low precision are termed as "garbage" and numbers with high precision are termed as "precise numbers". | ||
{| class="wikitable" | {| class="wikitable" | ||
− | !Formula | + | !Formula |
− | |||
!Explanation | !Explanation | ||
|- | |- | ||
|Precise number + Precise number = Slightly less precise number | |Precise number + Precise number = Slightly less precise number | ||
− | + | |If we know absolute error bars, then adding two precise numbers will at worst add the sizes of the two error bars. For example, if our precise numbers are 1 (±10<sup>-6</sup>) and 1 (±10<sup>-6</sup>), then our sum is 2 (±2·10<sup>-6</sup>). It is possible to lose a lot of relative precision, if the resultant sum is close to zero as a result of adding a number and then close to its inverse. This phenomenon is known as catastrophic cancellation. Therefore, it is likely that all numbers referred here are positive numbers, which does not exhibit this phenomenon. | |
− | |||
|- | |- | ||
|Precise number × Precise number = Slightly less precise number | |Precise number × Precise number = Slightly less precise number | ||
− | |||
|Here, instead of absolute error, relative error will be added. For example, if our precise numbers are 1 (±10<sup>-6</sup>) and 1 (±10<sup>-6</sup>), then our product is 1 (±2·10<sup>-6</sup>). | |Here, instead of absolute error, relative error will be added. For example, if our precise numbers are 1 (±10<sup>-6</sup>) and 1 (±10<sup>-6</sup>), then our product is 1 (±2·10<sup>-6</sup>). | ||
|- | |- | ||
|Precise number + Garbage = Garbage | |Precise number + Garbage = Garbage | ||
− | |||
|If one of the numbers has a high absolute error, and the numbers being added are of comparable size, then this error will be propagated to the sum. | |If one of the numbers has a high absolute error, and the numbers being added are of comparable size, then this error will be propagated to the sum. | ||
|- | |- | ||
|Precise number × Garbage = Garbage | |Precise number × Garbage = Garbage | ||
− | + | |Likewise, if one of the numbers has a high relative error, then this error will be propagated to the sum. Here, this is independent of the sizes of the numbers. | |
− | |Likewise, if one of the numbers has a high relative error, then this error will be propagated to the | ||
|- | |- | ||
− | + | |<math>\sqrt{\text{Garbage}} = \text{Less bad garbage}</math> | |
− | |<math> | + | | When a number is square rooted, its relative error will be halved. |
− | | When | ||
|- | |- | ||
|Garbage<sup>2</sup> = Worse garbage | |Garbage<sup>2</sup> = Worse garbage | ||
− | |||
|Likewise, when a number is squared, its relative error will be doubled. This is a corollary to multiplication adding relative errors. | |Likewise, when a number is squared, its relative error will be doubled. This is a corollary to multiplication adding relative errors. | ||
|- | |- | ||
− | |<math>\frac{1}{N}\sum( | + | |<math>\frac{1}{N}\sum(\text{N pieces of statistically independent garbage}) = \text{Better garbage}</math> |
− | + | |By aggregating many pieces of statistically independent observations (for instance, surveying many individuals), it is possible to reduce relative error. This is the basis of statistical sampling. | |
− | |By aggregating many pieces of statistically independent observations (for instance, surveying many individuals), it is possible to reduce relative error | ||
|- | |- | ||
|Precise number<sup>Garbage</sup> = Much worse garbage | |Precise number<sup>Garbage</sup> = Much worse garbage | ||
− | |||
|The exponent is very sensitive to changes, which may also magnify the effect based on the magnitude of the precise number. | |The exponent is very sensitive to changes, which may also magnify the effect based on the magnitude of the precise number. | ||
|- | |- | ||
− | |Garbage | + | |Garbage - Garbage = Much worse garbage |
− | |||
|This line involves catastrophic cancellation. If both pieces of garbage are about the same (e.g. if their error bars overlap), then it is possible that the answer is positive, zero, or negative. | |This line involves catastrophic cancellation. If both pieces of garbage are about the same (e.g. if their error bars overlap), then it is possible that the answer is positive, zero, or negative. | ||
|- | |- | ||
− | |<math>\frac{\text{Precise number}}{\text{Garbage}-\text{Garbage}}</math> = Much worse garbage, possible division by zero | + | |<math>\frac{\text{Precise number}}{\text{Garbage}-\text{Garbage}}</math>=Much worse garbage, possible division by zero |
− | |||
|Indeed, as with above, if error bars overlap then we might end up dividing by zero. | |Indeed, as with above, if error bars overlap then we might end up dividing by zero. | ||
|- | |- | ||
|Garbage × 0 = Precise number | |Garbage × 0 = Precise number | ||
− | |||
|Multiplying anything by 0 results in 0, an extremely precise number in the sense that it has no error whatsoever since we supply the 0 ourselves. This is equivalent to discarding garbage data from a statistical analysis. | |Multiplying anything by 0 results in 0, an extremely precise number in the sense that it has no error whatsoever since we supply the 0 ourselves. This is equivalent to discarding garbage data from a statistical analysis. | ||
|} | |} | ||
− | The | + | The titletext refers to the computer science maxim of Garbage in, garbage out, which states that even if some code accurately does what it is supposed to do, supplying incorrect data will result in incorrect results. As we can see above, however, when plugging data into mathematical formulas, this can possibly magnify the error of our input data, though there are ways to reduce this error (such as aggregating data). Therefore, the quantity of garbage is not necessarily conserved. |
==Transcript== | ==Transcript== | ||
+ | {{incomplete transcript|Do NOT delete this tag too soon.}} | ||
+ | |||
+ | |||
[A series of mathematical equations are written from top to bottom] | [A series of mathematical equations are written from top to bottom] | ||
− | + | PRECISE NUMBER + PRECISE NUMBER = SLIGHTLY LESS PRECISE NUMBER | |
+ | |||
+ | PRECISE NUMBER x PRECISE NUMBER = SLIGHTLY LESS PRECISE NUMBER | ||
+ | |||
+ | PRECISE NUMBER + GARBAGE = GARBAGE | ||
− | + | PRECISE NUMBER x GARBAGE = GARBAGE | |
− | + | GARBAGE [inside square root symbol] = LESS BAD GARBAGE | |
− | + | (GARBAGE)2 [superscript '2' as exponentiation] = WORSE GARBAGE | |
− | + | 1/N [Greek letter Sigma] (N PIECES OF STATISTICALLY INDEPENDENT GARBAGE) = BETTER GARBAGE | |
− | + | (PRECISE NUMBER)GARBAGE [superscript 'GARBAGE' as exponentiation] = MUCH WORSE GARBAGE | |
− | + | GARBAGE - GARBAGE = MUCH WORSE GARBAGE | |
− | + | PRECISE NUMBER | |
− | + | _________________ = MUCH WORSE GARBAGE, POSSIBLE DIVISION BY ZERO | |
− | + | GARBAGE - GARBAGE | |
− | + | GARBAGE x 0 = PRECISE NUMBER | |
{{comic discussion}} | {{comic discussion}} | ||
− |