Kitonum

21445 Reputation

26 Badges

17 years, 46 days

MaplePrimes Activity


These are answers submitted by Kitonum

L:=[.358700275060090779, [p[0] = .192413186080606, p[1] = 0.906594292940704e-1, p[2] = 0.677108912885780e-1, p[3] = 0.609551830556988e-1, p[4] = 0.589744573790909e-1, p[5] = 0.585737058072817e-1, p[6] = 0.589744573787748e-1, p[7] = 0.609551830550955e-1, p[8] = 0.677108912877626e-1, p[9] = 0.906594292931833e-1, p[10] = .192413186079858]]:
Data:=map(rhs, L[2]);
Statistics:-LineChart(Data);

 

It is better to solve your problems by writing mu and sigma down as procedures:

mu:=proc()
local k;
add(args[k],k=1..nargs)/nargs;
end proc:

sigma:=proc()
local k;
sqrt(add((args[k]-mu(args))^2, k=1..nargs)/(nargs-1));
end proc:


Examples of use:

mu($1..20);
sigma($1..20);


Codes of these procedures can be written more compactly if we use arrow notation and element-wise operator ~ :

mu:=()->`+`(args)/nargs:

sigma:=()->sqrt(add(([args]-~mu(args))^~2)/(nargs-1)):


Edit.

I think for a beginner the following code will be clearer. It does the same thing as  CartProd1  (of course for 3 lists only):

A:= [1,5,7]:
B:= [23,56,12]:
C:= [1,3]:
[seq(seq(seq([a,b,c],a=A),b=B),c=C)];

 

A:={20,15,10,30,46,78}; 
S:=0:
for i from 1 to nops(A) do
S:=S+A[i];
if S>=50 then break fi;
od:
B:=A[1..i-1];

Maple automatically sorts the elements of a set in ascending order, so for Maple your set will be  A={10, 15, 20, 30, 46, 78}

Example:

DocumentTools:-Tabulate(Matrix(2, [seq(plot(x^k, x=-1..1, size=[300,300]),k=1..4)]), interior = none, exterior = none);

See help for details.

To see this matrix run the  interface(rtablesize=infinity):   command first.

If you do not have Maple on your work computer, then you cannot rotate your 3D plot with the mouse.

Two possible options:
1. You can simply save the plot in any graphic format and display it as a static image.
2. You can make a simple animation in Maple, for example, rotating your plot around a spatial axis, then save this animation as a GIF file. Such files can be played in many browsers and in Power Point.

The problem is easily solved by application of the formula inclusions and exclusions:

for n from 6 do
if sum(binomial(6,k)*(6^n-(6-k)^n)*(-1)^(k-1), k=1..6)/6^n>=1/2 then break fi;
od;
n;
                                       
          13

restart; 
b:=unapply(rsolve({b(n)+b(n-1)+b(n-2)=0, b(0)=1, b(1)=-1, b(2)=0}, b(n)), n);

seq(expand(b(n)), n=1..20);
                           
-1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0

 

You can do this as follows (in the example, 4 ellipses are plotted):

restart;
F1,F2:=[-1,0],[1,0]:
Eq:=sqrt((x-F1[1])^2+(y-F1[2])^2)+sqrt((x-F2[1])^2+(y-F2[2])^2) = C;
plots:-implicitplot([seq(eval(Eq,C=c),c=[2.2,3,4,5])], x=-4..4, y=-4..4, color=[red,yellow,blue,green], scaling=constrained, gridrefine=3);

 

You forgot to call the  plots  package. So replace  display  with  plots:-display . To create  filled circles, use  the  disk  command instead of  circle  command. 

I did not find the color option for  title . As a workaround you can use  plots:-textplot  command:

A := plot(f(x), x = 0 .. 10, thickness = 3, gridlines = true): 
B := textplot([4.8, .22, "Fonction densité de χ^2\navec 3. d.d.l"], font = [ARIAL, bold, 14], color = red): 
display(A, B, size = [500, 500]);

 

To improve visibility, I reduced the ranges along the axes and used the size option:

with(DEtools)

diff(y(x), x) = x-y(x)

diff(y(x), x) = x-y(x)

(1)

A := DEplot(diff(y(x), x) = x-y(x), y(x), x = -3.5 .. 3.5, y = -3.5 .. 3.5, [y(0) = -1, y(1) = -1, y(2) = -1]); B := plot([-1, [0, t, t = -1 .. 0], [1, t, t = -1 .. 0], [2, t, t = -1 .. 0]], x = -3.5 .. 3.5, linestyle = [1, `$`(3, 3)], color = blue); plots:-display(A, B, size = [900, 500])

 

NULL


Addition.
You can also easily find the equations of these yellow curves by

Eq := diff(y(x), x) = x-y(x); 
Ic := [y(0) = -1, y(1) = -1, y(2) = -1]; 
seq(combine(dsolve({Ic[i], Eq})), i = 1 .. 3);

    

 

Download Differential_Equation_slope_field_new.mw

It works:

with(plottools): with(plots): 
display(seq(seq(display(polygon([[i,j],[i,j+1],[i+1,j+1],[i+1,j]], color=`if`(j::odd,"Magenta", yellow)), textplot([i+.5,j+.5,sprintf("%d",i*j)], font=[times,roman,14])),i=1..10), j=1..10),axes=none);

      

restart;
a:=[3,3,1,5,7,8,5,4,4,4,4,3,9]:
for i from 1 to nops(a) do
if a[i]=4 then a:=subsop(i=NULL,a); break fi;
od;
a;

Or
 

restart;
a:=[3,3,1,5,7,8,5,4,4,4,4,3,9]:
a:=subsop(ListTools:-Search(4,a)=NULL,a);

 

First 93 94 95 96 97 98 99 Last Page 95 of 289