Mathc initiation/a501
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ---------------------------------- */
/* save as c00c.c */
/* ---------------------------------- */
#include "x_afile.h"
#include "fc.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=2; 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-> ( n +4) / ( n* ( n -1))
a_(n+1) : n-> ((n+1)+4) / ((n+1)*((n+1)-1))
c_n : n-> a_(n+1)/a_n
c_1 = +0.000 || c_10 = +0.877 || c_10000 = +0.999900
c_2 = +0.389 || c_20 = +0.942 || c_20000 = +0.999950
c_3 = +0.571 || c_30 = +0.963 || c_30000 = +0.999967
c_4 = +0.675 || c_40 = +0.973 || c_40000 = +0.999975
c_5 = +0.741 || c_50 = +0.979 || c_50000 = +0.999980
c_6 = +0.786 || c_60 = +0.982 || c_60000 = +0.999983
c_7 = +0.818 || c_70 = +0.985 || c_70000 = +0.999986
c_8 = +0.843 || c_80 = +0.987 || c_80000 = +0.999987
c_9 = +0.862 || c_90 = +0.988 || 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_2 = +3.000 || a_20 = +0.063 || a_20000 = +0.000050
a_3 = +1.167 || a_30 = +0.039 || a_30000 = +0.000033
a_4 = +0.667 || a_40 = +0.028 || a_40000 = +0.000025
a_5 = +0.450 || a_50 = +0.022 || a_50000 = +0.000020
a_6 = +0.333 || a_60 = +0.018 || a_60000 = +0.000017
a_7 = +0.262 || a_70 = +0.015 || a_70000 = +0.000014
a_8 = +0.214 || a_80 = +0.013 || a_80000 = +0.000013
a_9 = +0.181 || a_90 = +0.012 || a_90000 = +0.000011
The series converge
Press return to continue.