m (III. Computer Programming)
m (III. Computer Programming)
Line 10: Line 10:
 
A computer would make a great job of checking this, in particular when convergence is slow. It will also allow us to deepen this important business of convergence.
 
A computer would make a great job of checking this, in particular when convergence is slow. It will also allow us to deepen this important business of convergence.
  
Let us compute \ref{eq:e1}: for $n=1$, this is $(1+(1/2))=3/2=1.5$.
+
Let us compute \ref{eq:e1}: for $n=1$, this is $(1+(1/1))=2$. For $n=2$, this is $(1+(1/2))^2=9/4=2.25$. For $n=3$, this is $(1+(1/3))^3=(4/3)^3=64/27=2.\bar{370}$
  
 
{{WLP6}}
 
{{WLP6}}

Revision as of 12:39, 8 February 2021

Crash Course in Scientific Computing

III. Computer Programming

Computers are good at computing! We have seen various definitions of Euler's number $e$, of which, in particular:

$$\tag{1}e=\lim_{n\rightarrow\infty}\left(1+{1\over n}\right)^n$$

$$\tag{2}e=\sum_{k=0}^\infty{1\over k !}$$

A computer would make a great job of checking this, in particular when convergence is slow. It will also allow us to deepen this important business of convergence.

Let us compute (1): for $n=1$, this is $(1+(1/1))=2$. For $n=2$, this is $(1+(1/2))^2=9/4=2.25$. For $n=3$, this is $(1+(1/3))^3=(4/3)^3=64/27=2.\bar{370}$