SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




          Pi to a trillion digits: How and why

                                       V N Krishnachandran




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Outline

        1 What is pi?

        2 How to calculate the value of π?

        3 Computing π in C

        4 Why a trillion digits?



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




       1.                 What is pi?



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




What is pi?




          ‘pi ’ is the sixteenth letter of the Greek alphabet!



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




What is π?



                  π denotes a very special number in
                  mathematics.




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Definition of π


       Definition
       The ratio of the circumference of a circle to its
       diameter is denoted by π. (The symbol π was first
       proposed by the Welsh mathematician William
       Jones in 1706.)




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?         Computing π in C   Why a trillion digits?




Definition of π


                       C


                              d                               Circumference of a circle (C )
                                  et e
                                       r          π=
                        dia
                              m
                                                               Diameter of the circle (d)




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




On the value of π

       Which of the following is true?

                  π    = 22/7
                  π    = 3.14
                         √
                  π    = 10
                  π    = 335/113

       None!!


V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




On the value of π



       The numbers 22/7, 3.14, ... are only
       approximate values of π.




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




On the value of π


                  π is not an integer.
                  π is not a rational number, that is, not the
                  ratio of one integer to another integer.
                  π is not an algebraic number, that is, not a
                  solution of a polynomial equation with integer
                  coefficients.



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




On the value of π



                  The decimal representation of π has infinite
                  number of digits appearing apparently without
                  any pattern.




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?       Computing π in C    Why a trillion digits?




On the value of π

       First 200 digits in the value of π:
       3.
       1415926535                      8979323846             2643383279        5028841971
       6939937510                      5820974944             5923078164        0628620899
       8628034825                      3421170679             8214808651        3282306647
       0938446095                      5058223172             5359408128        4811174502
       8410270193                      8521105559             6446229489        5493038196
       Fine! How can one obtain all these digits?

V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




       2.                 How to calculate pi?



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Geometrical procedure to find π


                  Draw a circle.
                  Measure the circumference of the circle.
                  Measure the diameter of the circle.
                  Divide the circumference by the diameter.
                  The number obtained is the value of π.



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Geometrical procedure to find π


                  The geometrical procedure will not give the
                  exact value of π.
                  This is because of the limitations of the
                  drawing instruments.
                  For example, we cannot draw a line with
                  thickness 0.0000000001 mm.



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Geometrical procedure to find π



                  Pi cannot be calculated by measuring
                  circumferences and radii of circles!
                  We need mathematical machinery!!




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Mathematical machinery to find π

       Pieces of the machinery required:
                  Radian measure of angle
                  Arctangent function
                  Gregory series
                  Machin formula
       Or
                  Ramanujan’s formula

V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Radian measure of angle




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Radian measure of angle


                  180 degrees = π radians
                  1 degree = π/180 radians
                  D degrees = (π/180) D radians

                  Special case:
                  45 degrees = π/4 radians



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Arctangent function




                                                        a
                                       arctan             = Angle A.
                                                        b
V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Arctangent function


       Definition
       arctan(x) is an angle in radian measure whose
       trigonometric tangent is x.




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Arctangent function


       A formula for π

                                              arctan(1) = π/4




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




James Gregory (1638 - 1675)




       James Gregory, a Scottish mathematician,
       developed a series expansion for arctan(x).
V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Gregory series


       Gregory series

                                        x3 x5 x7
                        arctan(x) = x −   +   −   + ···
                                        3   5   7




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




John Machin (1686 - 1751)




       Machin, English astronomer, discovered a formula
       for faster computation of π.
V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Machin’s formula


       Machin’s formula


                                       1                       1
                 4 arctan                      − arctan                = arctan(1)
                                       5                      239




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?            Computing π in C       Why a trillion digits?




Numerical expression for π

       Numerical expression for π using Machin’s formula

                                             1          1     1            1     1
                        π = 16               5     −    3     53   +       5    55    + ···
                                        1         1      1             1        1
                       −4              239   −    3     2393       +   5       2395   + ···




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Srinivasa Ramanujan (1887 1920)




       A formula due to Srinivasa Ramanujan, Indian
       mathematical genius, is also used to compute π.

V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Ramanujan’s formula


       Ramanujan’s formula
                            √                  ∞
                       1      8                       (4n)! 26390n + 1103
                         =                                  ×
                       π   9801               n=0
                                                      (n!)4     3964n




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Some other methods



                  Chudnovsky formula: The fastest converging
                  series to compute π
                  Iteration scheme due to Borwein and Borwein




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




       3.                 Computing π in C



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Basic idea

                  Consider the first 20 digits in the decimal
                  representation of the proper fraction 4 :
                                                        7

                                       4
                                       7   = .57142857142857142857

                  We split this into blocks of two digits each:

                    57 14 28 57 14 28 57 14 28 57


V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C    Why a trillion digits?




Basic idea

       These blocks, treated as integers, are assigned to
       the cells in a one-dimensional array:
         x[0] = 57                       x[1] = 14            x[2] = 28          x[3] = 57

         x[4] = 14                       x[5] = 28            x[6] = 57          x[7] = 14

         x[8] = 28                       x[9] = 57


V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program concepts: Notations


                  a, b positive proper fractions
                  k positive integer
                  a+b <1
                  a−b >0
                  ka < 1



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program concepts: Notations

                                  Digits of                       Stored in
                                  a                               x[i]
                                  b                               y[i]
                                  a+b                             s[i]
                                  a−b                             d[i]
                                  a/k                             q[i]




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program concepts: Computation of x[i]
       Let a = N/D (N and D positive integers).

                  Initialize:
                            R = N;

                  Repeat the following for i=0 to 20:
                            x[i] = floor( ( R * 100 ) / D ) ;
                            R = R - x[i] * D ;


       Computation of y[i] is similar.

V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program concepts: Computation of q[i]

                  Initialize:
                            R = 0;
                            T = R * 100 + x[0] ;
                            q[0] = floor (T/k) ;

                  Repeat the following for i=1 to 20:
                            R = x[i] - q[i] * k ;
                            T = q[i] * 100 + x[i] ;
                            q[i+1] = floor(T/k) ;


V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program concepts: Computation of s[i]

                  Initialize:
                            carry = 0 ;

                  Repeat the following for i=20 to 0:
                            t = x[i] + y[i] + carry ;
                            if( t < 100 ) s[i] = t ;
                            else { s [i] = x[i] + y[i] - 100;
                            carry = 1 ; }



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?    Computing π in C   Why a trillion digits?




Program concepts: Computation of d[i]

                  Initialize:
                            borrow = 0 ;

                  Repeat the following for i=20 to 0:
                            x[i] = x[i]                - borrow ;
                            if( x[i] >=                y[i] ) d[i] = x[i] - y[i] ;
                            else { d[i]                = 100 + x[i] - y[i];
                            borrow =1 ;                }



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Program to compute π



       Put the pieces together to construct a program to
       compute π!




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Another program to compute π
       The following programme due to Dik T. Winter of
       Netherland, computes pi to 800 digits:
       long int a=10000,b,c=2800,d,e,f[2801],g;
       main(){ for(;b-c;)f[b++]=a/5;
       for(;d=0,g=c*2;c-=14,
       printf("%.4d",e+d/a),e=d%a)
       for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
       }
       Check the claim!
V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




       4.                 Why a trillion digits?



V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Why a trillion digits of π?


                  To test hardware reliability
                  To help develop efficient algorithms
                  To help generate random digits




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




Known record




       T2K Open Supercomputer, at University of
       Tsukuba, Japan, calculated
       2, 576, 980, 370, 000 decimal digits
       in the value of π (news dated 17 August 2009).
V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




       The hunt for the digits of π continues ...




V N Krishnachandran
Pi to a trillion digits: How and why
What is pi?                How to calculate the value of π?   Computing π in C   Why a trillion digits?




                            Department of Computer Applications
                          Vidya Academy of Science and Technology
                                  Thrissur - 680501, Kerala

                                                  (October 2009)




V N Krishnachandran
Pi to a trillion digits: How and why

Contenu connexe

Plus de PlusOrMinusZero

Deep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsDeep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsPlusOrMinusZero
 
The Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusThe Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusPlusOrMinusZero
 
World environment day 2019 celebration
World environment day 2019 celebrationWorld environment day 2019 celebration
World environment day 2019 celebrationPlusOrMinusZero
 
Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)PlusOrMinusZero
 
An introduction to TeX and LaTeX
An introduction to TeX and LaTeXAn introduction to TeX and LaTeX
An introduction to TeX and LaTeXPlusOrMinusZero
 
Fractional calculus and applications
Fractional calculus and applicationsFractional calculus and applications
Fractional calculus and applicationsPlusOrMinusZero
 
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...PlusOrMinusZero
 
Linear algebra behind Google search
Linear algebra behind Google searchLinear algebra behind Google search
Linear algebra behind Google searchPlusOrMinusZero
 
Technical writing: Some guidelines
Technical writing: Some guidelinesTechnical writing: Some guidelines
Technical writing: Some guidelinesPlusOrMinusZero
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google DrivePlusOrMinusZero
 
First Introduction to Fractals
First Introduction to FractalsFirst Introduction to Fractals
First Introduction to FractalsPlusOrMinusZero
 
Mobile Communications Sajay K R
Mobile Communications Sajay K RMobile Communications Sajay K R
Mobile Communications Sajay K RPlusOrMinusZero
 
Performance Tuning by Dijesh P
Performance Tuning by Dijesh PPerformance Tuning by Dijesh P
Performance Tuning by Dijesh PPlusOrMinusZero
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...PlusOrMinusZero
 
First introduction to wireless sensor networks
First introduction to wireless sensor networksFirst introduction to wireless sensor networks
First introduction to wireless sensor networksPlusOrMinusZero
 
World environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarWorld environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarPlusOrMinusZero
 
World environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarWorld environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarPlusOrMinusZero
 
An introduction to free software
An introduction to free softwareAn introduction to free software
An introduction to free softwarePlusOrMinusZero
 
Introduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsIntroduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsPlusOrMinusZero
 
A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...PlusOrMinusZero
 

Plus de PlusOrMinusZero (20)

Deep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsDeep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from Basics
 
The Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusThe Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of Claculus
 
World environment day 2019 celebration
World environment day 2019 celebrationWorld environment day 2019 celebration
World environment day 2019 celebration
 
Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)
 
An introduction to TeX and LaTeX
An introduction to TeX and LaTeXAn introduction to TeX and LaTeX
An introduction to TeX and LaTeX
 
Fractional calculus and applications
Fractional calculus and applicationsFractional calculus and applications
Fractional calculus and applications
 
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
 
Linear algebra behind Google search
Linear algebra behind Google searchLinear algebra behind Google search
Linear algebra behind Google search
 
Technical writing: Some guidelines
Technical writing: Some guidelinesTechnical writing: Some guidelines
Technical writing: Some guidelines
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google Drive
 
First Introduction to Fractals
First Introduction to FractalsFirst Introduction to Fractals
First Introduction to Fractals
 
Mobile Communications Sajay K R
Mobile Communications Sajay K RMobile Communications Sajay K R
Mobile Communications Sajay K R
 
Performance Tuning by Dijesh P
Performance Tuning by Dijesh PPerformance Tuning by Dijesh P
Performance Tuning by Dijesh P
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...
 
First introduction to wireless sensor networks
First introduction to wireless sensor networksFirst introduction to wireless sensor networks
First introduction to wireless sensor networks
 
World environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarWorld environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankar
 
World environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarWorld environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazar
 
An introduction to free software
An introduction to free softwareAn introduction to free software
An introduction to free software
 
Introduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsIntroduction to Computer Algebra Systems
Introduction to Computer Algebra Systems
 
A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...
 

Dernier

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Dernier (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

pi to a trillion digits : How and Why?

  • 1. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Pi to a trillion digits: How and why V N Krishnachandran V N Krishnachandran Pi to a trillion digits: How and why
  • 2. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Outline 1 What is pi? 2 How to calculate the value of π? 3 Computing π in C 4 Why a trillion digits? V N Krishnachandran Pi to a trillion digits: How and why
  • 3. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? 1. What is pi? V N Krishnachandran Pi to a trillion digits: How and why
  • 4. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? What is pi? ‘pi ’ is the sixteenth letter of the Greek alphabet! V N Krishnachandran Pi to a trillion digits: How and why
  • 5. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? What is π? π denotes a very special number in mathematics. V N Krishnachandran Pi to a trillion digits: How and why
  • 6. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Definition of π Definition The ratio of the circumference of a circle to its diameter is denoted by π. (The symbol π was first proposed by the Welsh mathematician William Jones in 1706.) V N Krishnachandran Pi to a trillion digits: How and why
  • 7. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Definition of π C d Circumference of a circle (C ) et e r π= dia m Diameter of the circle (d) V N Krishnachandran Pi to a trillion digits: How and why
  • 8. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? On the value of π Which of the following is true? π = 22/7 π = 3.14 √ π = 10 π = 335/113 None!! V N Krishnachandran Pi to a trillion digits: How and why
  • 9. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? On the value of π The numbers 22/7, 3.14, ... are only approximate values of π. V N Krishnachandran Pi to a trillion digits: How and why
  • 10. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? On the value of π π is not an integer. π is not a rational number, that is, not the ratio of one integer to another integer. π is not an algebraic number, that is, not a solution of a polynomial equation with integer coefficients. V N Krishnachandran Pi to a trillion digits: How and why
  • 11. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? On the value of π The decimal representation of π has infinite number of digits appearing apparently without any pattern. V N Krishnachandran Pi to a trillion digits: How and why
  • 12. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? On the value of π First 200 digits in the value of π: 3. 1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164 0628620899 8628034825 3421170679 8214808651 3282306647 0938446095 5058223172 5359408128 4811174502 8410270193 8521105559 6446229489 5493038196 Fine! How can one obtain all these digits? V N Krishnachandran Pi to a trillion digits: How and why
  • 13. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? 2. How to calculate pi? V N Krishnachandran Pi to a trillion digits: How and why
  • 14. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Geometrical procedure to find π Draw a circle. Measure the circumference of the circle. Measure the diameter of the circle. Divide the circumference by the diameter. The number obtained is the value of π. V N Krishnachandran Pi to a trillion digits: How and why
  • 15. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Geometrical procedure to find π The geometrical procedure will not give the exact value of π. This is because of the limitations of the drawing instruments. For example, we cannot draw a line with thickness 0.0000000001 mm. V N Krishnachandran Pi to a trillion digits: How and why
  • 16. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Geometrical procedure to find π Pi cannot be calculated by measuring circumferences and radii of circles! We need mathematical machinery!! V N Krishnachandran Pi to a trillion digits: How and why
  • 17. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Mathematical machinery to find π Pieces of the machinery required: Radian measure of angle Arctangent function Gregory series Machin formula Or Ramanujan’s formula V N Krishnachandran Pi to a trillion digits: How and why
  • 18. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Radian measure of angle V N Krishnachandran Pi to a trillion digits: How and why
  • 19. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Radian measure of angle 180 degrees = π radians 1 degree = π/180 radians D degrees = (π/180) D radians Special case: 45 degrees = π/4 radians V N Krishnachandran Pi to a trillion digits: How and why
  • 20. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Arctangent function a arctan = Angle A. b V N Krishnachandran Pi to a trillion digits: How and why
  • 21. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Arctangent function Definition arctan(x) is an angle in radian measure whose trigonometric tangent is x. V N Krishnachandran Pi to a trillion digits: How and why
  • 22. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Arctangent function A formula for π arctan(1) = π/4 V N Krishnachandran Pi to a trillion digits: How and why
  • 23. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? James Gregory (1638 - 1675) James Gregory, a Scottish mathematician, developed a series expansion for arctan(x). V N Krishnachandran Pi to a trillion digits: How and why
  • 24. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Gregory series Gregory series x3 x5 x7 arctan(x) = x − + − + ··· 3 5 7 V N Krishnachandran Pi to a trillion digits: How and why
  • 25. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? John Machin (1686 - 1751) Machin, English astronomer, discovered a formula for faster computation of π. V N Krishnachandran Pi to a trillion digits: How and why
  • 26. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Machin’s formula Machin’s formula 1 1 4 arctan − arctan = arctan(1) 5 239 V N Krishnachandran Pi to a trillion digits: How and why
  • 27. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Numerical expression for π Numerical expression for π using Machin’s formula 1 1 1 1 1 π = 16 5 − 3 53 + 5 55 + ··· 1 1 1 1 1 −4 239 − 3 2393 + 5 2395 + ··· V N Krishnachandran Pi to a trillion digits: How and why
  • 28. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Srinivasa Ramanujan (1887 1920) A formula due to Srinivasa Ramanujan, Indian mathematical genius, is also used to compute π. V N Krishnachandran Pi to a trillion digits: How and why
  • 29. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Ramanujan’s formula Ramanujan’s formula √ ∞ 1 8 (4n)! 26390n + 1103 = × π 9801 n=0 (n!)4 3964n V N Krishnachandran Pi to a trillion digits: How and why
  • 30. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Some other methods Chudnovsky formula: The fastest converging series to compute π Iteration scheme due to Borwein and Borwein V N Krishnachandran Pi to a trillion digits: How and why
  • 31. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? 3. Computing π in C V N Krishnachandran Pi to a trillion digits: How and why
  • 32. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Basic idea Consider the first 20 digits in the decimal representation of the proper fraction 4 : 7 4 7 = .57142857142857142857 We split this into blocks of two digits each: 57 14 28 57 14 28 57 14 28 57 V N Krishnachandran Pi to a trillion digits: How and why
  • 33. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Basic idea These blocks, treated as integers, are assigned to the cells in a one-dimensional array: x[0] = 57 x[1] = 14 x[2] = 28 x[3] = 57 x[4] = 14 x[5] = 28 x[6] = 57 x[7] = 14 x[8] = 28 x[9] = 57 V N Krishnachandran Pi to a trillion digits: How and why
  • 34. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Notations a, b positive proper fractions k positive integer a+b <1 a−b >0 ka < 1 V N Krishnachandran Pi to a trillion digits: How and why
  • 35. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Notations Digits of Stored in a x[i] b y[i] a+b s[i] a−b d[i] a/k q[i] V N Krishnachandran Pi to a trillion digits: How and why
  • 36. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Computation of x[i] Let a = N/D (N and D positive integers). Initialize: R = N; Repeat the following for i=0 to 20: x[i] = floor( ( R * 100 ) / D ) ; R = R - x[i] * D ; Computation of y[i] is similar. V N Krishnachandran Pi to a trillion digits: How and why
  • 37. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Computation of q[i] Initialize: R = 0; T = R * 100 + x[0] ; q[0] = floor (T/k) ; Repeat the following for i=1 to 20: R = x[i] - q[i] * k ; T = q[i] * 100 + x[i] ; q[i+1] = floor(T/k) ; V N Krishnachandran Pi to a trillion digits: How and why
  • 38. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Computation of s[i] Initialize: carry = 0 ; Repeat the following for i=20 to 0: t = x[i] + y[i] + carry ; if( t < 100 ) s[i] = t ; else { s [i] = x[i] + y[i] - 100; carry = 1 ; } V N Krishnachandran Pi to a trillion digits: How and why
  • 39. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program concepts: Computation of d[i] Initialize: borrow = 0 ; Repeat the following for i=20 to 0: x[i] = x[i] - borrow ; if( x[i] >= y[i] ) d[i] = x[i] - y[i] ; else { d[i] = 100 + x[i] - y[i]; borrow =1 ; } V N Krishnachandran Pi to a trillion digits: How and why
  • 40. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Program to compute π Put the pieces together to construct a program to compute π! V N Krishnachandran Pi to a trillion digits: How and why
  • 41. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Another program to compute π The following programme due to Dik T. Winter of Netherland, computes pi to 800 digits: long int a=10000,b,c=2800,d,e,f[2801],g; main(){ for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14, printf("%.4d",e+d/a),e=d%a) for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b); } Check the claim! V N Krishnachandran Pi to a trillion digits: How and why
  • 42. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? 4. Why a trillion digits? V N Krishnachandran Pi to a trillion digits: How and why
  • 43. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Why a trillion digits of π? To test hardware reliability To help develop efficient algorithms To help generate random digits V N Krishnachandran Pi to a trillion digits: How and why
  • 44. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Known record T2K Open Supercomputer, at University of Tsukuba, Japan, calculated 2, 576, 980, 370, 000 decimal digits in the value of π (news dated 17 August 2009). V N Krishnachandran Pi to a trillion digits: How and why
  • 45. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? The hunt for the digits of π continues ... V N Krishnachandran Pi to a trillion digits: How and why
  • 46. What is pi? How to calculate the value of π? Computing π in C Why a trillion digits? Department of Computer Applications Vidya Academy of Science and Technology Thrissur - 680501, Kerala (October 2009) V N Krishnachandran Pi to a trillion digits: How and why