Mathc initiation/a499
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ---------------------------------- */
/* save as c00a.c */
/* ---------------------------------- */
#include "x_afile.h"
#include "fa.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 / n
a_(n+1) : n-> 1 / (n+1)
c_n : n-> a_(n+1)/a_n
c_1 = +0.500 || c_10 = +0.909 || c_10000 = +0.999900
c_2 = +0.667 || c_20 = +0.952 || c_20000 = +0.999950
c_3 = +0.750 || c_30 = +0.968 || c_30000 = +0.999967
c_4 = +0.800 || c_40 = +0.976 || c_40000 = +0.999975
c_5 = +0.833 || c_50 = +0.980 || c_50000 = +0.999980
c_6 = +0.857 || c_60 = +0.984 || c_60000 = +0.999983
c_7 = +0.875 || c_70 = +0.986 || c_70000 = +0.999986
c_8 = +0.889 || c_80 = +0.988 || c_80000 = +0.999988
c_9 = +0.900 || 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 = +1.000 || a_10 = +0.100 || a_10000 = +0.000100
a_2 = +0.500 || a_20 = +0.050 || a_20000 = +0.000050
a_3 = +0.333 || a_30 = +0.033 || a_30000 = +0.000033
a_4 = +0.250 || a_40 = +0.025 || a_40000 = +0.000025
a_5 = +0.200 || a_50 = +0.020 || a_50000 = +0.000020
a_6 = +0.167 || a_60 = +0.017 || a_60000 = +0.000017
a_7 = +0.143 || a_70 = +0.014 || a_70000 = +0.000014
a_8 = +0.125 || a_80 = +0.013 || a_80000 = +0.000013
a_9 = +0.111 || a_90 = +0.011 || a_90000 = +0.000011
The series converge
Press return to continue.