Summary: The purpose of this module is to explain the use of scientific notation and significant figures.
This module is part of a series of modules designed for teaching the physics component of GAME2302 Mathematical Applications for Game Development at Austin Community College in Austin, TX. (See GAME 2302-0100: Introduction for the first module in the course along with a description of the course, course resources, homework assignments, etc.)
The purpose of this module is to explain the use of scientific notation and significant figures.
I recommend that you open another copy of this document in a separate browser window and use the following links to easily find and view the Images and Listings while you are reading about them.
This section will contain a discussion of accuracy, precision, scientific notation, and significant figures.
Let's begin with a brief discussion of accuracy and precision. These two terms are often used interchangeably in everyday conversation, but they have very different meanings in the world of science and engineering.
Accuracy
In science and engineering, the accuracy of a measurement system is the degree of closeness of measurements of a quantity to its actual (true) value.
Precision
The precision of a measurement system (also called reproducibility or repeatability) is the degree to which repeated measurements under unchanged conditions show the same result.
Four possibilities
A measurement system can be:
A hypothetical experiment
Consider an experiment where a firearm is clamped into a fixture, very carefully aimed at a bulls eye on a downrange target, and fired six times. (Although you may never have seen or touched a firearm, you probably have a pretty good idea of how they behave.)
If the six holes produced by the bullets in the target fall in a tight cluster in the bulls eye, the system can be considered to be both accurate and precise.
If all of the holes fall in the general area of the bulls eye but the cluster is not very tight, the system can be considered to be accurate but not precise.
If all of the holes fall in a tight cluster but the cluster is some distance from the bulls eye, the system can be considered to be precise but not accurate.
If the holes are scattered across a wide area of the target, the system can be considered to be neither accurate nor precise.
Another use of the word precision
Another use of the word precision, which will be important in this module, is based on the concept that the precision of a measurement describes the units that you use to measure something.
How tall are you?
For example, if you tell someone that you are about five feet tall, that wouldn't be very precise. If you told someone that you are 62 inches tall, that would be more precise. If you told someone that you are 62.3 inches tall, that would be even more precise, and if you told someone that you are 62.37 inches tall, that would be very precise for a measurement of that nature.
The smaller the unit...
The smaller the unit you use to measure with, the more precise the measurement can be. For example, assume that you measure someone's height with a measuring stick that is longer than the person is tall. Assume also that the measuring stick is graduated only in feet. In that case, the best that you could hope for would be to get the measurement correct to the nearest foot and perhaps estimate a second digit to the nearest tenth of a foot.
One-inch graduations
On the other hand, if the measuring stick is graduated in inches and you are careful, you should be able to get the measurement correct to the nearest inch and perhaps estimate another digit to the nearest tenth of an inch. The second measurement using the one-inch graduations would be more precise than the first using the one-foot graduations.
Diminishing returns
If the measuring stick were graduated in tenth-inch units, however, that may or may not lead to a more precise measurement. That would be approaching the point of diminishing returns where your inability to take full advantage of the more precise graduations and the inability of the subject to always stand with the same degree of rigidity might come into play.
According to Wikipedia , scientific notation is a way of writing numbers that accommodates values too large or small to be conveniently written in standard decimal notation . The notation has a number of useful properties and is commonly used by scientists and engineers. A variation of scientific notation is also used internally by computers.
Scientific notation format
Numbers in scientific notation are written using the following format:
x * 10^y
which can be read as the value x multiplied by ten raised to the y power where y is an integer and x is any real number. (Constraints are placed on the value of x when using the normalized form of scientific notation which I will explain below.)
The values for x and y can be either positive or negative.
The term referred to as x is often called the significand or the mantissa .
The computer display version of scientific notation
Because of difficulties involved in displaying superscripts in the output of computer programs, a typical display of a number in scientific notation by a computer program might look something like the following example:
-3.141592653589793e+1
where
A power of ten is understood
In this format, it is understood that the number consists of the value to the left of the e (the mantissa) multiplied by ten raised to a power given by the value to the right of the e (the exponent).
For example, in JavaScript exponential format, the value -10*Math.PI is displayed as
-3.141592653589793e+1
The value Math.PI/10 is displayed as
3.141592653589793e-1
The value Math.PI is displayed as
3.141592653589793e+0
The value 0 is displayed as
0e+0
The normalized form of scientific notation
Using general scientific notation, the number -65700 could be written in several different ways including the following:
In normalized scientific notation, the exponent is chosen such that the absolute value of the mantissa is at least one but less than ten. For example, -65700 is written:
-6.57 * 10^4
In normalized notation the exponent is negative for a number with absolute value between 0 and 1. For example, the value 0.00657 would be written:
6.57 * 10^(-3)
The 10 and the exponent are usually omitted when the exponent is 0.
According to Wikipedia , The significant figures of a number are those digits that carry meaning contributing to its precision. This includes all digits except:
A popular physics textbook provides a more complete set of rules for identifying the significant figures in a number:
Ambiguity of the last digit in scientific notation
Again, according to Wikipedia , it is customary in scientific measurements to record all the significant digits from the measurements, and to guess one additional digit if there is any information at all available to the observer to make a guess. The resulting number is considered more valuable than it would be without that extra digit, and it is considered a significant digit because it contains some information leading to greater precision in measurements and in aggregations of measurements (adding them or multiplying them together).
Examples of significant digits
Referring back to the physics textbook mentioned earlier, Image 1 shows:
| Image 1: Examples of significant figures. |
|---|
|
Note that the default JavaScript exponential representation fails to display the significant trailing zeros for the numbers on row 2 and row 5. I will show you some ways that you may be able to deal with this issue later but you may not find them to be very straightforward.
Beyond knowing about scientific notation and significant figures from a formatting viewpoint, you need to know how to perform arithmetic while satisfying the rules for scientific notation and significant figures.
Performing arithmetic involves three main rules :
An exercise involving addition
Please copy the JavaScript code shown in Listing 1 into an html file and open the file in your browser.
| Listing 1: An exercise involving addition. |
|---|
|
Screen output
When you open the html file in your browser, the text shown in Image 2 should appear in your browser.
| Image 2: Screen output from Listing #1. |
|---|
|
The code in Listing 1 begins by declaring three variables named a , b , and c , adding them together, and displaying the sum in the JavaScript default format in the browser window.
Too many decimal digits
As you can see from the first line in Image 2 , the result is computed and displayed with eight decimal digits, five of which are to the right of the decimal point. We know, however, from rule #1 , that we should present the result rounded to a precision of two digits to the right of the decimal point in order to match the least precise of the numbers included in the sum. In this case, the value stored in the variable named a is the least precise.
Correct the problem
The code in Listing 1 calls a method named toFixed on the value stored in the variable sum passing a value of 2 as a parameter to the method. This method returns the value from sum rounded to two decimal digits. The returned value is stored in the variable named round . Then the script displays that value as the second line of text in Image 2 .
The output text that reads "The End"
There is a downside to using JavaScript (as opposed to other programming languages such as Java). By default, if there is a coding error in your script, there is no indication of the error in the output in the main browser window. Instead, the browser simply refuses to display some or all of the output that you are expecting to see.
Put a marker at the end
Writing the script in such a way that a known line of text, such as "The End" will appear following all of the other output won't solve coding errors. However, if it doesn't appear, you will know that there is a coding error and some or all of the output text may be missing.
JavaScript and error consoles
I explained how you can open a JavaScript console in the Google Chrome browser or an error console in the Firefox browser in an earlier module. While the diagnostic information provided in those consoles is limited, it will usually indicate the line number in the source code where the programming error was detected. Knowing the line number will help you examine the code and fix the error.
An exercise involving multiplication
Please copy the code shown in Listing 2 into an html file and open it in your browser.
| Listing 2: An exercise involving multiplication. |
|---|
|
The screen output
When you open your html file in your browser, the text shown in Image 3 should appear in your browser window.
| Image 3: Screen output from Listing #2. |
|---|
|
The code in Listing 2 begins by declaring three variables named a , b , and c , multiplying them together, and displaying the product in the browser window. Each of the factors in the product have a different number of significant figures, with the factor of value 169.01 having the least number (5) of significant figures. We know from rule #2 , therefore, that we need to present the result rounded to five significant figures.
The toPrecision method
Listing 2 calls a method named toPrecision on the variable named product , passing the desired number of significant figures (5) as a parameter. The method rounds the value stored in product to the desired number of digits and returns the result, which is stored in the variable named rounded . Then the contents of the variable named rounded are displayed, producing the second line of text in Image 3 .
What about other parameter values
Note that the method named toPrecision knows nothing about significant figures. It was up to me to figure out the desired number of significant figures in advance and to pass that value as a parameter to the method.
Although this has nothing to do with significant figures, it may be instructive to examine the behavior of the method named toPrecision for several different parameter values.
Image 4 shows the result of replacing the parameter value of 5 in the call to the toPrecision method with the values in the first column of Image 4 and displaying the value returned by the method.
| Image 4: Behavior of the toPrecision method. |
|---|
|
And the point is...
The point to this is to emphasize that the method named toPrecision is not a method that knows how to compute and display the required number of significant figures. Instead, according to the JavaScript documentation:
"The toPrecision() method formats a number to a specified length. A decimal point and nulls are added (if needed), to create the specified length."
It is up to you, the author of the script, to determine what that length should be and to provide that information as a parameter to the toPrecision method.
Combined operations
This is where things become a little hazy. I have been unable to find definitive information as to how to treat the precision and the number of significant figures when doing computations that combine addition and/or subtraction with multiplication and/or division.
Two contradictory procedures
I have found two procedures documented on the web that seem to be somewhat contradictory. Both sources seem to say that you should perform the addition and/or subtraction first and that you should apply rule #1 to the results. However, they differ with regard to how stringently you apply that rule before moving on to the multiplication and/or division.
The more stringent procedure
One source seems to suggest that you should round the results of the addition and/or subtraction according to rule #1 and replace the addition or subtraction expression in your overall expression with the rounded result. Using that approach, you simply create one the factors that will be used later in the multiplication and/or division. That factor has a well-defined number of significant figures.
Then you proceed with the multiplication and/or division and adjust the number of significant figures in the final result according to rule #2 .
The less stringent procedure
The other source seems to suggest that you mentally round the results of the addition and/or subtraction according to rule #1 and make a note of the number of significant figures that would result if you were to actually round the result. However, you should not actually round the result at that point in time. In other words, you should use the raw result of the addition and/or subtraction as a factor in the upcoming multiplication and/or division knowing that you may be carrying excess precision according to rule #1 .
Then you proceed with the multiplication and/or division and adjust the number of significant figures in the final result according to rule #2 . However, when you adjust the number of significant figures, you should include the number of significant figures from your note in the decision process. If that is the smallest number of significant figures of all the factors, you should use it as the number of significant figures for the final result.
An exercise involving combined operations
Evaluate the following expression and display the final result with the correct number of significant figures.
(169.01 + 3294.6372) * (0.00365 - 29.333)
Please copy the code from Listing 3 into an html file and open it in your browser.
| Listing 3: An exercise involving combined operations. |
|---|
|
When you open your html file in your browser, the text shown in Image 5 should appear in the browser window.
| Image 5: Screen output from Listing #3. |
|---|
|
The more stringent procedure
The code in Listing 3 implements the more stringent procedure , not because it is necessarily the correct one. Rather, it is simpler to implement in a script.
Do addition and subtraction first
Listing 3 begins by adding two numbers, adjusting the precision to the least precise of the two numbers, and saving the result in the variable named aSum .
Then Listing 3 subtracts one number from another number, adjusts the precision to the least precise of the two numbers, and saves the result in the variable named bDiff .
Display to get information on significant figures
Both results are displayed immediately after they are obtained. This is necessary for me to know which one has the least number of significant figures. I need to know that to be able to properly adjust the number of significant figures in the final product.
In other words, it was necessary for me to write and execute the addition/subtraction portion of the script in order to get the information required to write the remainder of the script.
Do the multiplication
Then Listing 3 multiplies the sum and difference values and displays the result in the default format with far too many significant figures as shown by the third line of text in Image 5 .
Finally Listing 3 adjusts the number of significant figures in the product based on the number of significant figures in bDiff and displays the final result with five significant figures in normalized scientific (exponential) notation.
I encourage you to run the scripts that I have presented in this lesson to confirm that you get the same results. Copy the code for each script into a text file with an extension of html. Then open that file in your browser. Experiment with the code, making changes, and observing the results of your changes. Make certain that you can explain why your changes behave as they do.
This section contains a variety of miscellaneous information.
Financial : Although the Connexions site makes it possible for you to download a PDF file for this module at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should be aware that some of the HTML elements in this module may not translate well into PDF.
I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.
In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing me as the author. I neither receive compensation for those sales nor do I know who does receive compensation. If you purchase such a book, please be aware that it is a copy of a module that is freely available on cnx.org and that it was made and published without my prior knowledge.
Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.
-end-