Mathematica: dealing with significant figures

In summary, The speaker is struggling with analyzing data of varying precision levels. They have attempted to use the Interval function and the StringLength function, but neither have provided a clean solution. They are looking for a way to specify a range based on significant figures rules for a single value. One suggestion is to use the NumberForm or ScientificForm functions to determine the precision and then feed that into the interval range function. However, this may slow down calculations.
  • #1
yourgoldteeth
10
0
Hi everyone.

Hopefully this is easy to solve.

I have large amounts of mined data that have differing levels of precision. I want to do analysis of:

1) number of decimal places present
2) significant figure error intervals based on the precision (for instance, 0.003 could have been rounded from 0.0025 to 0.0035)

I can't find a clean way to do it in Mathematica, as importing my data makes it all 'MachinePrecision' and it thinks everything has 15.9456 digits of precision.

I've tried back doors, such as doing a StringLength[ToString[x]] but even that doesn't work for very small decimals, as it introduces scientific notation which throws everything off.

Any ideas?
 
Physics news on Phys.org
  • #2
Have you looked at the Interval function?
 
  • #3
Hurkyl said:
Have you looked at the Interval function?

The interval function does not appear to be what I am looking for. I have a single value, and need to specify a range based on significant figures rules for that one value. The interval function requires a range as input.
 
  • #4
I would just force them all to be scientific notation, that way you know the precision. You can pluck out the precision pretty easy.

j = { .00000000000000000001,.00000000000000000000000001.,.0000000000000001}

NumberForm[j, NumberFormat->(#3&)]

Now you have a list of precisions. You can feed those into the interval range function, and just put your error ranges on in front of the exponent.

There is probably a better way, but this probably solves it.. that way you don't have to force variable precision, which will slow down your calculations.
 
  • #5
This one

ScientificForm[j, NumberFormat -> (#3 &)]
 

1. How does Mathematica handle significant figures in calculations?

Mathematica follows standard scientific notation and significant figure rules when performing calculations. The result will be rounded to the number of significant figures specified by the user or the default setting.

2. Can I change the significant figure settings in Mathematica?

Yes, you can change the significant figure settings by using the command SetPrecision[expression, n], where n is the number of significant figures you want to display in the result.

3. How can I display the exact number of significant figures in my results?

You can use the command InputForm[expression] to display the exact number of significant figures in your results. This will show all the digits in the calculation, even if they are not significant.

4. Does Mathematica take into account the uncertainties of measured values when calculating with significant figures?

Yes, Mathematica has built-in functions for handling uncertainties in measurements. You can use the command ErrorBar[measurement, uncertainty] to specify the uncertainty for a given measurement, and Mathematica will use these values in its calculations.

5. How does Mathematica handle rounding when dealing with significant figures?

Mathematica follows the standard rounding rules for significant figures. If the number to be rounded is followed by a 5 or higher number, it will round up, and if it is followed by a number less than 5, it will round down. If the number is exactly halfway between two possible values, it will round to the nearest even number.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Classical Physics
Replies
18
Views
1K
  • Other Physics Topics
Replies
32
Views
4K
  • Other Physics Topics
Replies
13
Views
3K
  • Biology and Chemistry Homework Help
Replies
7
Views
2K
Replies
10
Views
6K
  • Other Physics Topics
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
9
Views
1K
Back
Top