Mathc initiation/a500
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ---------------------------------- */
/* save as c00b.c */
/* ---------------------------------- */
#include "x_afile.h"
#include "fb.h"
/* ---------------------------------- */
int main(void)
{
double i;
clrscrn();
printf(" Alternating series \n\n"
" ---- ---- \n"
" \\ \\ \n"
" | (-1)**(n+1) * a_n | (-1)**n * a_n \n"
" / / \n"
" ---- ---- \n\n\n\n");
printf(" Alternating series test\n\n"
" a) If a_n >= a_(n+1) > 0 for every n,\n\n"
" and\n\n"
" b) If lim n->oo a_n = 0\n\n"
" The series converge\n\n\n");
stop();
clrscrn();
printf(" Alternating series test\n\n"
" a) If a_n >= a_(n+1) > 0 for every n,\n\n"
" Remark : \n\n"
" if a_n = f(n), you can use f'(x) < 0 to verify a)\n\n"
" or\n\n"
" a_n - a_(n+1) >= 0\n\n"
" or\n\n"
" a_(n+1) / a_n =< 1\n\n\n");
stop();
clrscrn();
printf(" a_n : n-> %s \n", a_neq);
printf(" a_(n+1) : n-> %s \n\n", a_npls1eq);
printf(" c_n : n-> a_(n+1)/a_n\n\n");
for(i=1; i<10; i++)
printf(" c_%.0f = %+5.3f || c_%.0f = %+5.3f || c_%.0f = %+5.6f\n",
i, a_npls1(i) /a_n(i),
i*10, a_npls1(i*10) /a_n(i*10),
i*10000,a_npls1(i*10000)/a_n(i*10000));
printf(" \n\n\n"
" c_n = a_(n+1)/a_n =< 1\n\n\n");
stop();
clrscrn();
printf(" lim n->oo a_n = 0 \n\n");
for(i=1; i<10; i++)
printf(" a_%.0f = %+5.3f || a_%.0f = %+5.3f || a_%.0f = %+5.6f\n",
i, a_n(i),
i*10, a_n(i*10),
i*10000,a_n(i*10000));
printf(" \n\n\n"
" The series converge\n\n");
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Exemple de sortie écran :
Alternating series
---- ----
\ \
| (-1)**(n+1) * a_n | (-1)**n * a_n
/ /
---- ----
Alternating series test
a) If a_n >= a_(n+1) > 0 for every n,
and
b) If lim n->oo a_n = 0
The series converge
Press return to continue.
Exemple de sortie écran :
Alternating series test
a) If a_n >= a_(n+1) > 0 for every n,
Remark :
if a_n = f(n), you can use f'(x) < 0 to verify a)
or
a_n - a_(n+1) >= 0
or
a_(n+1) / a_n =< 1
Press return to continue.
Exemple de sortie écran :
a_n : n-> 1 / (3* n -1)
a_(n+1) : n-> 1 / (3*(n+1)-1)
c_n : n-> a_(n+1)/a_n
c_1 = +0.400 || c_10 = +0.906 || c_10000 = +0.999900
c_2 = +0.625 || c_20 = +0.952 || c_20000 = +0.999950
c_3 = +0.727 || c_30 = +0.967 || c_30000 = +0.999967
c_4 = +0.786 || c_40 = +0.975 || c_40000 = +0.999975
c_5 = +0.824 || c_50 = +0.980 || c_50000 = +0.999980
c_6 = +0.850 || c_60 = +0.984 || c_60000 = +0.999983
c_7 = +0.870 || c_70 = +0.986 || c_70000 = +0.999986
c_8 = +0.885 || c_80 = +0.988 || c_80000 = +0.999988
c_9 = +0.897 || c_90 = +0.989 || c_90000 = +0.999989
c_n = a_(n+1)/a_n =< 1
Press return to continue.
Exemple de sortie écran :
lim n->oo a_n = 0
a_1 = +0.500 || a_10 = +0.034 || a_10000 = +0.000033
a_2 = +0.200 || a_20 = +0.017 || a_20000 = +0.000017
a_3 = +0.125 || a_30 = +0.011 || a_30000 = +0.000011
a_4 = +0.091 || a_40 = +0.008 || a_40000 = +0.000008
a_5 = +0.071 || a_50 = +0.007 || a_50000 = +0.000007
a_6 = +0.059 || a_60 = +0.006 || a_60000 = +0.000006
a_7 = +0.050 || a_70 = +0.005 || a_70000 = +0.000005
a_8 = +0.043 || a_80 = +0.004 || a_80000 = +0.000004
a_9 = +0.038 || a_90 = +0.004 || a_90000 = +0.000004
The series converge
Press return to continue.