7.4: Order of Operations in Expressions and Formulas
Learning Outcomes
- Use order of operations in statistics formulas.
We have already encountered the order of operations: Parentheses, Exponents, Multiplication and Division (from left to right), Addition and Subtraction (from left to right). In this section, we will give some additional examples where the order of operations must be used properly to evaluate statistics.
Example \(\PageIndex{1}\)
The formula for the sample standard deviation asks us to add up the squared deviations from the mean, take the square root and divide by one less than the sample size. For example, suppose that there are three data values: 3, 5, 10. The mean of these values is 6. Then the standard deviation is:
\[s=\sqrt{\dfrac{\left(3-6\right)^2+\left(5-6\right)^2+\left(10-6\right)^2}{3-1}}\nonumber\]
Evaluate this number rounded to the nearest hundredth.
Solution
The first thing in the order of operations is to do what is in the parentheses. We must subtract:
\[3-6=-3,\:\:\:5-6\:=\:-1,\:\:\:10-6=4 \nonumber\]
We can substitute the numbers in to get:
\[=\sqrt{\frac{\left(-3\right)^2+\left(-1\right)^2+\left(4\right)^2}{3-1}}\nonumber\]
Next, we exponentiate:
\[\left(-3\right)^2=9,\:\:\:\left(-1\right)^2=1,\:\:\:4^2=16 \nonumber\]
Substitute these in to get:
\[\sqrt{\dfrac{9+1+16}{3-1}} \nonumber\]
We can now perform the addition inside the square root to get:
\[\sqrt{\dfrac{26}{3-1}} \nonumber\]
Next, perform the subtraction of the denominator to get:
\[\sqrt{\dfrac{26}{2}} \nonumber\]
We can divide to get:
\[\sqrt{13} \nonumber\]
We don't want to do this by hand, so in a calculator or computer type in:
\[\sqrt{13} = 3.61 \nonumber\] (rounded to the nearest hundredth)
Example \(\PageIndex{2}\)
When calculating the probability that a value will be less than 4.6 if the value is taken randomly from a uniform distribution between 3 and 7, we have to calculate:
\[\left(4.6-3\right)\times\dfrac{1}{7-3} \nonumber\]
Find this probability.
Solution
We can use a calculator or computer, but we must be very careful about the order of operations. Notice that there are implied parentheses due to the fraction bar. The answer is:
\[\dfrac{(4.6 - 3) \times 1}{7-3} \nonumber\]
Using technology, we get:
\[(4.6 - 3)\times 1/(7 - 3) = 0.4\]
Try It
When finding the upper bound, \(U\), of a confidence interval given the lower bound, \(L\), and the margin of error, \(E\), we use the formula
\[U=\:L+2E \nonumber\]
Find the upper bound of the confidence interval for the proportion of babies that are born preterm if the lower bound is 0.085 and the margin of error is 0.03.
- Answer
-
Plug in \(L\) = 0.085 and \(E\) = 0.03:
\[U=\:L+2E = 0.085 + 2(0.03) = 0.085 + 0.06 = 0.145\nonumber\]
The upper bound of the confidence interval for the proportion of babies that are born preterm is 0.145 or 14.5%.
Additional video resources: