Discussion Room : IDC101

How much to compute?

How much to compute?

by Kapil Paranjape -
Number of replies: 0

The question asked by Dr Amit is as example of this question.

The mathematical definition of something may imply that one has to compute a lot in order to get a certain value. However, there may be theorems that allows one to shorten the computation.

For example, consider the problem of finding the 100th decimal place of a number. Do we really need to calculate all the previous places of decimal? Before rushing to answer this consider the following:

  • When the number is of the form (integer)/10n this is easy to avoid.
  • When the number is a fraction, there is an easier way. Write a program to find the 100th decimal place of 11/13 without calculating all the previous places of decimal.
  • The problem becomes quite a bit more difficult for numbers like  \sqrt{2} . It can be done, but requires a bit more advanced mathematics to learn about and implement.
  • An even more difficult problem is for numbers like \pi and \log(2). The Bailey-Borwein-Plouffe Formula is available for such numbers.

There are numbers for which there is no shortcut. You may learn about this in the course "Theory of Computation" or in some later course.