maple exo2

                                                            exercice : loi binomial
restart;
with(plots):
pc := COLOR(RGB, .95,.3,.45):
bc := COLOR(RGB, .45,.3,.95):
BinomialPlot := proc(n )
local f,k,c,n2,d;
n2 := floor((n+1)/2); if((n mod 2) = 0) then d:= .5; else d:= 0; fi;
f := k -> binomial(n,k)/2^n;
#for k from -n2 to n2 do print( f(k)); od;
c := COLOR(RGB, .4, .6, .3 );
plot( f(floor(x+n2+d)), x =(-n2-d)..(n2+d), filled = true, color = c );
end proc:
StandardPlot := proc()
local c;
c := COLOR(RGB, .5,.3,.95);
plot( exp(-(x^2)/2)/sqrt(2*Pi), x = -3..3, filled = true, color = bc);
end proc:
> fade := proc( a1,a2,a3,k,n)
local c;
c := COLOR(RGB, a1*k/n, a2*k/n, a3*k/n);
return c;
end:
> StandFPlot := proc()
local n;
n := 10;
display( [seq(
plot( k*(exp(-(x^2)/2)/sqrt(2*Pi))/n, x = -3..3, filled = true,
color = fade(.45,.3,1,k,n)), k = 1..n )
] );
end proc:
> StandDevsPlot := proc()
local A, c,d, k, f, area;
f := x -> exp(-(x^2)/2)/sqrt(2*Pi);
for k from 1 to 6 do
d := k*.1;
c := COLOR(RGB, .2 +d,.0 + d,.9);
A||k := plot( f(x), x = (k-4)..(k-3),
filled = true, color = c);
area := evalf(100*int( f(x), x = (k-4)..(k-3)),3);
T||k := textplot([k-3.5,.3,
convert(area, string)]);
od;
for k from 0 to 6 do
B||k := plot([[k-3,0],[k-3,.6]], color = yellow); od;
display( [seq(A||k, k =1..6), seq(B||k, k =0..6),seq(T||k, k=1..6) ] );
end proc:
> z_plot := proc(z)
local xvalue, f, p, delta, index, n, area, Left, Right,A,B;
f := x -> exp(-(x^2)/2)/sqrt(2*Pi);
A := plot( f(t), t = -3..z, color = bc, filled = true);
B := plot( f(t), t = z..3, color = pc, filled = true);
plots[display](A,B);
end:
> ec:= COLOR(RGB, .70, .65,.50):
rc := COLOR(RGB, .38, .31,.28 ):
> x_plot := proc(x, mean, sd)
local xvalue, f, p, delta, index, n, area, Left, Right,A,B;
f:= u -> exp( -((u-mean)^2)/ (2*sd^2) )/(sd*sqrt(2*Pi));
Right := fsolve( f(mean)/100 = f(xvalue), xvalue, mean..((1+mean)*4));
Left := mean - (Right-mean);
Print(Left, Right);
A := plot( f(t), t = Left..x, color = ec, filled = true);
B := plot( f(t), t = x..Right, color = rc, filled = true);
#area := int( f(u), u = x..infinity);
plots[display](A,B);
end:
> BinomialPlot(5);
> BinomialPlot(8);
> BinomialPlot(20);
> BinomialPlot(50);
> BinomialPlot(100);
> N := 10;
s:= sqrt(N/4):
display( [plot( exp(-(x/s)^2)/(s*sqrt(2*Pi)), x = (-N/2)..(N/2), color = black), BinomialPlot(N)]);
> N := 25;
s:= sqrt(N/4):
display( [plot( exp(-(x/s)^2)/(s*sqrt(2*Pi)), x = (-N/2)..(N/2), color = black), BinomialPlot(N)]);
N := 60;
s:= sqrt(N/4):
display( [plot( exp(-(x/s)^2)/(s*sqrt(2*Pi)), x = (-N/2)..(N/2), color = black), BinomialPlot(N)]);
> StandardPlot();
> StandFPlot();
> StandDevsPlot();
> z = (x-mu)/sigma;
> z = evalf( (720-600)/80, 3);
> z = evalf( (8.2-11.1)/2.36, 3);
> x = mu +z*sigma;
> x = 600 + 2.50*80;
> x = 11.1 + (-.19)*(2.36);
> x_plot( 12, 10, 1.7);
> z = evalf( (12 -10)/1.7,5);
> z_plot(1.1765);
> display(z_plot(1.1765),x_plot( 12, 10, 1.7));
> x_plot( 12, 10, 0.7);
> z = evalf( (12 -10)/1.7,5);
> z_plot(1.1765);
> display(z_plot(1.1765),x_plot( 12, 10, 1.7));
> display( [x_plot( 7, 5, 1.5 ), x_plot( 15, 13, 1.5 ) ]);
> display( [ plot( exp( -((x-10)^2)/ (2*1.5^2))/(1.5*sqrt(2*Pi)),
x =3..17,color= black),
plot( exp( -((x-10)^2)/ (2*3.5^2) )/(3.5*sqrt(2*Pi)),
x =3..17,color= black),
x_plot( 13, 10, 1.5 ), x_plot( 17, 10, 3.5 ) ] );
> display( [x_plot( 7.88, 5, 1.6 ), x_plot( 21.76, 16, 3.2 ) ]);
> z = evalf( (7.88-5)/ 1.6, 5);
z = evalf( (21.76-16)/3.2, 5);
> z_plot(1.8);
> display( [z_plot(1.8), x_plot( 7.88, 5, 1.6 ), x_plot( 21.76, 16, 3.2 ) ]);

MOBILISONS NOUS POUR LE DEVELOPPEMENT DE SARGHINE EN AIDANT L'ASSOCIATION AMSIRAR.

Créer un site gratuit avec e-monsite - Signaler un contenu illicite sur ce site