#hw3.txt #Sunday, Feb 2 20014 #Ha Luu 2)read "C:/Users/Ha/Desktop/Experimental Math/C3.txt"; Digits:=10: evalf(det(Hil(50))),det(evalf(Hil(50))); -1466 -455 1.392615569 10 , -5.096100083 10 Digits:=20: evalf(det(Hil(50))),det(evalf(Hil(50))); -1466 -784 1.3926155689351399681 10 , 3.9671871974393549731 10 Digits:=30: evalf(det(Hil(50))),det(evalf(Hil(50))); -1466 1.39261556893513996812723740903 10 , -1038 5.67192762637403569656679171521 10 Digits:=70: evalf(det(Hil(50))),det(evalf(Hil(50))); 1.39261556893513996812723740903442695607373829370969385193902295\ -1466 7826920 10 , -2.304665266774485556923318788680028690505108\ -1463 483311064493728155655640208 10 Digits:=80: evalf(det(Hil(50))),det(evalf(Hil(50))); 1.39261556893513996812723740903442695607373829370969385193902295\ -1466 78269197711269990 10 , 1.392615431993038208497180946103077\ -1466 0904407143969922847032457369046085405359836602 10 ###### You need at least 80 digits in the floating point so that there is a good agreement between the 2 evalf function. 3) ###Count number of inversion. inv1:=proc(p) local i,j,n,k: k:=0: n:=nops(p): for i from 1 to n do for j from i+1 to n do if p[i] > p[j] then k:= k+1: fi: od: od: k: end: ###generating function gf:=proc(n,q) local i,j,X,f,p: f:=0: X:=permute(n): for i from 1 to n! do p:=inv1(X[i]): f:=f+q^p: od: f: end: ##### factor(gf(1,q)); 1 factor(gf(2,q)); 1 + q factor(gf(3,q)); / 2 \ (1 + q) \q + q + 1/ factor(gf(4,q)); / 2 \ / 2 \ 2 \q + 1/ \q + q + 1/ (1 + q) factor(gf(5,q)); / 2 \ / 4 3 2 \ / 2 \ 2 \q + q + 1/ \q + q + q + q + 1/ \q + 1/ (1 + q) factor(gf(6,q)); 2 / 2 \ / 4 3 2 \ / 2 \ / 2 \ \q - q + 1/ \q + q + q + q + 1/ \q + 1/ \q + q + 1/ 3 (1 + q) factor(gf(7,q)); / 2 \ / 4 3 2 \ / 6 5 4 3 2 \q - q + 1/ \q + q + q + q + 1/ \q + q + q + q + q + q 2 \ / 2 \ / 2 \ 3 + 1/ \q + 1/ \q + q + 1/ (1 + q) factor(gf(8,q)); / 2 \ / 4 3 2 \ / 4 \ / 6 5 4 3 \q - q + 1/ \q + q + q + q + 1/ \q + 1/ \q + q + q + q 2 2 2 \ / 2 \ / 2 \ 4 + q + q + 1/ \q + 1/ \q + q + 1/ (1 + q) #### For each component, their exponent increase after a specific number of increasing in n : For example, everytime n increases by 2, exponent of (q+1) increases by 1 Everytime n increases by 3, exponent of (q^2+q+1) increases by one. And so on, however, I have difficulty predicting which completely new elements will be introduce to the equation as n in creases. 1) Maple Mannual 30-60 f:='f': y:=f(x); f(x) dy:=diff(y,x); d --- f(x) dx ddy:=diff(y,x,x); d / d \ --- |--- f(x)| dx \ dx / dsolve(ddy+5*dy+6*y = sin(x)*exp(-3*x),y); f(x) = exp(-3 x) _C2 + exp(-2 x) _C1 1 - - (sin(x) - cos(x)) exp(-3 x) 2 g:='g': y:=f(x): z:=g(x): de1:= diff(y,x)+diff(z,x) =exp(x); / d \ / d \ |--- f(x)| + |--- g(x)| = exp(x) \ dx / \ dx / de2:= diff(y,x)-3*z =x; / d \ |--- f(x)| - 3 g(x) = x \ dx / dsolve({de1,de2,f(0)=8/9,g(0)=10/9},{y,z}); / 1 3 3 8 { f(x) = - x + - exp(x) - - exp(-3 x) + -, \ 3 4 4 9 1 1 1 3 \ g(x) = - - x + - + - exp(x) + - exp(-3 x) } 3 9 4 4 / z:='z': asympt(Psi(z),z,3); 1 1 /1 \ ln(z) - --- - ----- + O|--| 2 z 2 | 4| 12 z \z / plot(sin(x),x=-2*Pi..2*Pi); plot(sec(x),x=-Pi..2*Pi); plot(sec(x),x=-Pi..2*Pi,y=-5..5); Error, (in plot) unexpected option: f(x) = -5 .. 5 ?plot # note: in the new maple, range restriction does not work p1:= plot([sqrt(x),3*log(x)],x=0..400,title =`The Square Root and log functions`); #note: display is important function to show the graph. p2:=textplot([[360,16,`y=3log(x)`],[130,10,`y=sqrt(x)`]]): display(p1,p2); plotsestup(ps,plotoutput=`plot.ps`,plotoptions=`potrait,noborder`); plotsestup(ps, plotoutput = plot.ps, plotoptions = potrait,noborder) plot(sin(x),x=-2*Pi..2*Pi); nterface(plotdevice=inline); "inline" plot3d(exp(-(x^2+y^2-1)^2), x=-2..2, y=-2..2); Error, (in plot3d) bad range arguments: x = -2 .. 2, f(x) = -2 .. 2 plot3d(sin(x+y),x=-1..1, y=-1..1); Error, (in plot3d) bad range arguments: x = -1 .. 1, f(x) = -1 .. 1 # note: could not figure out what's wrong with the plot3d eventhough following ?plot3d example plot3d([sqrt(1+u^2)*cos(t),sqrt(1+u^2)*sin(t),u],u=-1..1,t=0..2*Pi); #note: do not have the helix graph? with(plots): contourplot(exp(-(x^2+y^2-1)^2),x=-(1.3)..(1.3),y=-(1.3)..(1.3),filled=true, coloring=[blue,red]); Error, (in plot/iplot2d/expression) bad range arguments x = -1.3 .. 1.3, f(x) = -1.3 .. 1.3 #note: keep having trouble with the bad range argument? with(plots): implicitplot3d(y^2-x^2 = z,x=-2..2,y=-2..2,z=-4..4); Error, (in plots:-implicitplot3d) invalid input: `plots/iplot3d` expects its 3rd argument, r2, to be of type {range, name = range}, but received f(x) = -2 .. 2 with(plots): animate3d([r*cos(t+a),r*sin(t+a),r^2*cos(2*t)],r=0..1,t=0..2*Pi, a=0..3, frames=10,style=patch,title=`The Rotating Saddle`); v:=vector([1,2,3]); A:=matrix(2,3,[a,b,c,d,e,f]); v; v A; A print(v); v print(A); A op(A); eval(A); B:=matrix(2,2); entermatrix(B); #note: with new verson of Maple, it's pop-up window, so no semicolon needed after entering the number. f:=(i,j)->x^(i*j); (i j) (i, j) -> x A:=matrix(4,4,f); factor(det(A)); 20 / 2 \ 2 6 x \x + x + 1/ (x + 1) (x - 1) A:=matrix(2,2,[1,2,3,4]): B:=matrix(2,2,[-2,3,-5,1]); A+B; A + B evalm(%); A&*B; A &* B evalm(%);