Dr. Geo, be a geometer! - Tag - MathematicsBe a geometer2017-07-19T07:56:27+02:00Hilaire Fernandesurn:md5:38626DotclearMathematics seriesurn:md5:0c657851046cdd9a5dabf39c7020c2c92017-01-03T14:41:00+01:00OFSETMathematicsPharoprogrammingSmalltalk<p>My son came to me with a mathematics series, he need to find its
convergence. After the mathematics work is done, we want to confirm by calculus
the found limit. Dr. Geo can be of some help here.</p> <p>The series is S = Sum 1 / (k * (k + 1) * (k + 2)). Once cut in three parts
it is established it converges toward 1/4.</p>
<p>Then we fired up Dr. Geo to compute a few ten of thousand terms and its
sum.</p>
<p>In a Workspace we wrote this tiny script:</p>
<pre>
| u s |
u := [ :k| 1 / (k * (k + 1) * (k + 2) ) ].
s := 0.
1 to: 100000 do: [ :k | s := s + (u value: k) ].
Transcript show: s; tab; show: s asFloat; cr
</pre>
<p>...and we got the confirmation of our finding:</p>
<pre>
(1250037500/5000150001) 0.2499999999500015
</pre>
<p>What is interesting is the exact result Pharo gave us as a fraction number.
That's why we also asked for a float version of the sum to more easily realize
how close we were to 1/4.</p>