Update README.md
Browse files
README.md
CHANGED
@@ -106,26 +106,26 @@ print(output)
|
|
106 |
|
107 |
|
108 |
```
|
109 |
-
|
110 |
-
|
111 |
-
One popular method is the Gregory-Leibniz series:
|
112 |
|
113 |
-
|
114 |
|
115 |
-
|
116 |
|
117 |
-
|
118 |
|
119 |
-
π
|
120 |
|
121 |
-
|
122 |
|
123 |
-
π
|
124 |
|
125 |
</reasoning>
|
126 |
|
127 |
<answer>
|
128 |
-
3.
|
|
|
129 |
```
|
130 |
|
131 |
---
|
|
|
106 |
|
107 |
|
108 |
```
|
109 |
+
<reasoning>
|
110 |
+
Pi is an irrational number, which means it cannot be precisely calculated using finite decimal or fractional notation. It is typically represented by the Greek letter π and its approximate value is 3.14159. However, for a more precise calculation, we can use mathematical algorithms like the Leibniz formula for π or the Gregory-Leibniz series.
|
|
|
111 |
|
112 |
+
The Leibniz formula for π is:
|
113 |
|
114 |
+
π = 4 * (1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - 1/15 +...)
|
115 |
|
116 |
+
This series converges slowly, so many terms are needed for a good approximation. For instance, using 10 terms, the approximation would be:
|
117 |
|
118 |
+
π ≈ 4 * (1 - 0.3333333333333333 + 0.1111111111111111 - 0.0344827586206897 + 0.0090040875518672 - 0.0025958422650073 + 0.0006929403729561 - 0.0001866279043531 + 0.0000499753694946 - 0.0000133386323746 + 0.0000035303398593 - 0.0000009009433996)
|
119 |
|
120 |
+
π ≈ 3.141592653589793
|
121 |
|
122 |
+
This is a rough approximation of π using 10 terms. For a more precise value, you can use more terms or employ other algorithms.
|
123 |
|
124 |
</reasoning>
|
125 |
|
126 |
<answer>
|
127 |
+
π ≈ 3.141592653589793
|
128 |
+
</answer>
|
129 |
```
|
130 |
|
131 |
---
|