Calculating something correct upto ##m## significant figures

  • Context: Comp Sci 
  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
  • Tags Tags
    Significant figures
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
Messages
2,188
Reaction score
2,694
Homework Statement
The Zeta function is defined as $$\zeta(n) \ = \ \sum _{k=1} ^{\infty} \frac{1}{k^n}.$$ Given that ##\zeta(4) = \pi^4/90##, estimate a value of ##\pi## correct to three significant figures. How many terms are needed in the series for this?
Relevant Equations
Given in the question.
I have solved questions where I have been asked to find something correct to ##m## places of decimal using some series. See this thread. The logic was, the program would terminate at the ##k##th term if the ##k+1##th term is ##<10^{-m}##.

But how do I terminate the series here? Say I calculate ##S_{k+1}## and ##S_k##, and find a difference ##t_{k+1}## (actually the ##k+1##th term). Notwithstanding anything else, this term can be approximated to any number of significant terms. For example, if ##t_{k+1} \ = \ 0.0000000001,## I can still approximate that as ##0.0000000001000## and conclude that it has four significant figures. In fact, the trailing zeros can be anything depending on how precisely my computer can calculate. What should my condition of termination be in this case? More specifically, how do I check whether the current sum is correct up to certain significant figures?
 
on Phys.org
Wrichik Basu said:
More specifically, how do I check whether the current sum is correct up to certain significant figures?
Given that this is in the comp sci homework forum, is brute force an option ?
If I make a table of $$\sqrt[
\leftroot{-1}\uproot{16}\scriptstyle 4] { 90*\sum _{k=1} ^{N} \frac{1}{k^4} } \ \ $$ versus N I get:
Code:
 1    3.080070288 
 2    3.127107866
 3    3.136152380 
 4    3.138997889
 5    3.140161179
 6    3.140721718
 7    3.141024158
 8    3.141201402
 9    3.141312040
10    3.141384622
11    3.141434195
12    3.141469195
13    3.141494605
14    3.141513496
15    3.141527831
So with three terms you have three significant figures: 3.14

I don't understand your criterion
Wrichik Basu said:
find something correct to ##m## places of decimal using some series. The logic was, the program would terminate at the ##k##th term if the ##k+1##th term is ##<10^{−m}##
What if the next thousand terms are just below ##<10^{−m}## ? You'd be at m-3 signifcant digits !

Also 0.0000000001 has one significant digit. Things change when you sum: 0.1000000001 has ten !
 
BvU said:
What if the next thousand terms are just below ##<10^{−m}##?You'd be at m-3 signifcant digits !
That logic was for correct to decimal places, not significant figures. See the thread linked in the OP; I have written the logic there.
BvU said:
Given that this is in the comp sci homework forum, is brute force an option ?
If I make a table of $$\sqrt[
\leftroot{-1}\uproot{16}\scriptstyle 4] { 90*\sum _{k=1} ^{N} \frac{1}{k^4} } \ \ $$ versus N I get:
Code:
1    3.080070288
2    3.127107866
3    3.136152380
4    3.138997889
5    3.140161179
6    3.140721718
7    3.141024158
8    3.141201402
9    3.141312040
10    3.141384622
11    3.141434195
12    3.141469195
13    3.141494605
14    3.141513496
15    3.141527831
So with three terms you have three significant figures: 3.14
I couldn't understand one thing. My program doesn't know the value of pi beforehand. You calculated till ##N=15## and stopped because you were getting the value correct to three significant figures. How will the program know where to stop? If it stopped at ##N=500## rather than ##N=15##, you and I know that the value will remain 3.14, but the program doesn't know that, right?
 
Wrichik Basu said:
I couldn't understand one thing. My program doesn't know the value of pi beforehand. You calculated till ##N=15## and stopped because you were getting the value correct to three significant figures. How will the program know where to stop? If it stopped at ##N=500## rather than ##N=15##, you and I know that the value will remain 3.14, but the program doesn't know that, right?
The program can "know" by calculating the difference between successive approximations. In the values produced by @BvU, to get 3 sig. figures, or accuracy in 2 decimal places, we need to continue until the difference between successive values is less than 1/2 of a hundredth; i.e., less than .005. If we add or subtract numbers less than .005, it can't change the digit in the hundredths place. The first place in the table where the difference is less than .005 is at rows 3 and 4, with values of 3.136152380 and 3.138997889, respectively, with the difference being about .003. To the nearest hundredth, both number round to 3.14.
 
  • Like
Likes   Reactions: Wrichik Basu
BvU said:
Also 0.0000000001 has one significant digit. Things change when you sum: 0.1000000001 has ten !
The correct statement here would be
0.1000000000
0.0000000001
-------------------
0.1000000001

Your statement could be interpreted as meaning that
0.1
0.0000000001
-------------------
0.1000000001

which is not correct. To the proper number of significant digits, the latter would be 0.1
 
  • Like
Likes   Reactions: BvU