vv

13837 Reputation

20 Badges

9 years, 319 days

MaplePrimes Activity


These are answers submitted by vv

Find the group generated in GL(2,Q) by the matrices A, B:

restart;

A :=  Matrix(2, 2, [[2, 0], [0, 1]]) ;

B := Matrix(2, 2, [[1, 1], [0, 1]]) ;

Matrix(2, 2, {(1, 1) = 2, (1, 2) = 0, (2, 1) = 0, (2, 2) = 1})

 

Matrix(%id = 18446744074411464574)

(1)

pow:=LinearAlgebra:-MatrixPower:

pow(A,n);

Matrix(2, 2, {(1, 1) = 2^n, (1, 2) = 0, (2, 1) = 0, (2, 2) = 1})

(2)

pow(B,n);

Matrix(2, 2, {(1, 1) = 1, (1, 2) = n, (2, 1) = 0, (2, 2) = 1})

(3)

pow(A,m).pow(B,n).pow(A,p).pow(B,q);

Matrix(2, 2, {(1, 1) = 2^m*2^p, (1, 2) = 2^m*2^p*q+2^m*n, (2, 1) = 0, (2, 2) = 1})

(4)

It will be easy now to see that the group generated by A and B is  { X(a,b,c) : a,b,c in Z }, where

 

 

X(a,b,c) =  <2^a, 2^b*c; 0, 1>;

X(a, b, c) = (Matrix(2, 2, {(1, 1) = 2^a, (1, 2) = 2^b*c, (2, 1) = 0, (2, 2) = 1}))

(5)

In Maple permutations have posint entries. You must shift them by 1.

restart;
with(group):
a:=[[seq(i,i=1..6)],[seq(i,i=7..9)]];

              a := [[1, 2, 3, 4, 5, 6], [7, 8, 9]]
mulperms(a,a);
               [[1, 3, 5], [2, 4, 6], [7, 9, 8]]
b:=a:
for i to 6 do
  lprint('a'^i=b);
  b:=mulperms(b,a);
od:

a = [[1, 2, 3, 4, 5, 6], [7, 8, 9]]
a^2 = [[1, 3, 5], [2, 4, 6], [7, 9, 8]]
a^3 = [[1, 4], [2, 5], [3, 6]]
a^4 = [[1, 5, 3], [2, 6, 4], [7, 8, 9]]
a^5 = [[1, 6, 5, 4, 3, 2], [7, 9, 8]]
a^6 = []

 

 The behavior seems to be intentional (but not documented) being useful for boolean expressions containing variables.
Such expressions are simplified generically for boolean operators  but are left unsimplified for the corresponding procedures.

restart;
x := a=0:  y := b=0:

eval(`or`(x,y), [a=0]);   evalb(%);
                         0 = 0 or b = 0
                              true
eval(x or y, [a=0]);   # generically false, so the substitution is useless
                             false

 

A "sequential order" does not have much sense in Maple because e.g. a unique ordering of the operands in sum or product is not possible.
For the set of all functions use:

map2(op,0,indets(expr,function));

 

I had the impression that posting the complete Maple solution is not very interesting (the 13 regions were already listed).

The idea of the solution is simple: obtain the explicit values for the six floors (after some simplifications).

However it seems that there are interested users here, so here it is. I have inserted a minimum of comments

 

 

restart;

S0:=[4*x1+7*x2+6*x3 - 186, floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) - 18,
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) - 21];

[4*x1+7*x2+6*x3-186, floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3)-18, floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3)-21]

(1)

id:=t->t:

Suv:=eval(S0,floor=id)-[0,3*u,3*v];

[4*x1+7*x2+6*x3-186, -3*u+(1/2)*x1+(1/5)*x2+(1/3)*x3-18, -3*v+(1/5)*x1+(1/2)*x2+(1/4)*x3-21]

(2)

3u and 3v  are the sum of the fractional parts in the 2nd and 3rd equation;  0 <= u,v < 1

 

#Suv:=[4*x1+7*x2+6*x3-186, (1/2)*x1+(1/5)*x2+(1/3)*x3-18-3*u, (1/5)*x1+(1/2)*x2+(1/4)*x3-21-3*v]

xuv:=solve(Suv,[x1,x2,x3])[];

[x1 = 4920/77+(750/77)*u+(680/77)*v, x2 = -(120/77)*u+4110/77+(1000/77)*v, x3 = -(1620/77)*v-5688/77-(360/77)*u]

(3)

Suv:=eval(S0,xuv)[2..3];

[floor(73/77+(375/77)*u+(340/77)*v)-2+floor(-(24/77)*u+52/77+(200/77)*v)+floor(-(540/77)*v+29/77-(120/77)*u), floor(60/77+(150/77)*u+(136/77)*v)-2+floor(-(60/77)*u+53/77+(500/77)*v)+floor(-(405/77)*v+41/77-(90/77)*u)]

(4)

Suv  is the new system in the unknowns u,v.  The relations with the initial system is below (uvx).

uvx:=solve(xuv[1..2],{u,v});

{u = -(17/270)*x2-23/9+(5/54)*x1, v = (1/90)*x1-53/12+(5/72)*x2}

(5)

Now Suv can be solved easily because the floors may take only a few values.

A:=eval(indets(Suv[1])minus{u,v},floor=id)[];
B:=eval(indets(Suv[2])minus{u,v},floor=id)[];

73/77+(375/77)*u+(340/77)*v, -(24/77)*u+52/77+(200/77)*v, -(540/77)*v+29/77-(120/77)*u

 

60/77+(150/77)*u+(136/77)*v, -(60/77)*u+53/77+(500/77)*v, -(405/77)*v+41/77-(90/77)*u

(6)

Min:=f -> min(eval(f,[u=0,v=0]), eval(f,[u=0,v=1]), eval(f,[u=1,v=0]), eval(f,[u=1,v=1]));
Max:=f -> max(eval(f,[u=0,v=0]), eval(f,[u=0,v=1]), eval(f,[u=1,v=0]), eval(f,[u=1,v=1]));

proc (f) options operator, arrow; min(eval(f, [u = 0, v = 0]), eval(f, [u = 0, v = 1]), eval(f, [u = 1, v = 0]), eval(f, [u = 1, v = 1])) end proc

 

proc (f) options operator, arrow; max(eval(f, [u = 0, v = 0]), eval(f, [u = 0, v = 1]), eval(f, [u = 1, v = 0]), eval(f, [u = 1, v = 1])) end proc

(7)

SA, SB  will contain the possible floors

SA:=NULL:
for i from floor(Min(A[1])) to  floor(Max(A[1])) do
for j from floor(Min(A[2])) to  floor(Max(A[2])) do
for k from floor(Min(A[3])) to  floor(Max(A[3])) do
if i+j+k=2 then SA:=SA,[i,j,k] fi
od od od:
nops([SA]);

38

(8)

SB:=NULL:
for i from floor(Min(B[1])) to  floor(Max(B[1])) do
for j from floor(Min(B[2])) to  floor(Max(B[2])) do
for k from floor(Min(B[3])) to  floor(Max(B[3])) do
if i+j+k=2 then SB:=SB,[i,j,k] fi
od od od:
nops([SB]);

33

(9)

NR:=0:
for sa in [SA] do for sb in [SB] do
sa[1]<=A[1],A[1]<sa[1]+1, sa[2]<=A[2],A[2]<sa[2]+1, sa[3]<=A[3],A[3]<sa[3]+1,
sb[1]<=B[1],B[1]<sb[1]+1, sb[2]<=B[2],B[2]<sb[2]+1, sb[3]<=B[3],B[3]<sb[3]+1;
ss:=solve(eval({%},uvx));    # nu e nevoie sa includem  0<=u<1, 0<=v<1  caci le-am folosit deja in Min.Max
if [ss]<>[] then NR:=NR+1;R[NR]:=ss; fi
od od:  NR;

13

(10)

We have ontained the NR=13 regions.  Here is the first one

R[1];

{x2 = 56, 68 <= x1, x1 <= 137/2}, {x1 = 68, x2 <= 394/7, 56 < x2}, {56 < x2, 68 < x1, x1 < 333/2-(7/4)*x2, x2 < 394/7}, {x1 = 333/2-(7/4)*x2, 56 < x2, x2 < 394/7}

(11)

Now  plots:-inequal is able to plot the regions (projected on the (x1,x2) plane).

proj:=plots:-display( seq(  plots:-inequal({R[r]},x1=67..81,x2=53..65), r=1..NR), size=[800,800] );

 

#proj:=plots:-display( seq(  plots:-inequal({R[r]},x1=67..81,x2=53..65,
#optionsclosed=[color=red,thickness=4], optionsopen=[color=white,thickness=0]), r=1..NR), size=[800,800] );

 

# List all 13 regions
for r to NR do lprint(Region||r=[R[r]]) od:

Region1 = [{x2 = 56, 68 <= x1, x1 <= 137/2}, {x1 = 68, x2 <= 394/7, 56 < x2}, {56 < x2, 68 < x1, x1 < 333/2-(7/4)*x2, x2 < 394/7}, {x1 = 333/2-(7/4)*x2, 56 < x2, x2 < 394/7}]

Region2 = [{x2 = 54, 70 <= x1, x1 < 72}, {x1 = 70, 54 < x2, x2 < 55}, {54 < x2, 70 < x1, x1 < 333/2-(7/4)*x2, x2 < 55}, {x1 = 333/2-(7/4)*x2, 54 < x2, x2 < 55}]
Region3 = [{56 <= x2, x2 <= 402/7, 70 < x1, x1 < 72}, {x1 = 70, 56 < x2, x2 < 58}, {70 < x1, 402/7 < x2, x1 < 345/2-(7/4)*x2, x2 < 58}, {x1 = 345/2-(7/4)*x2, 402/7 < x2, x2 < 58}]
Region4 = [{58 <= x2, 72 <= x1, x2 <= 412/7, x1 < 74}, {x1 = 72, 412/7 < x2, x2 < 60}, {72 < x1, 412/7 < x2, x1 < 177-(7/4)*x2, x2 < 60}, {x1 = 177-(7/4)*x2, 412/7 < x2, x2 < 60}]
Region5 = [{x2 = 60, 147/2 < x1, x1 < 74}, {60 < x2, x1 < 74, x2 < 426/7, 357/2-(7/4)*x2 < x1}, {426/7 <= x2, x2 <= 430/7, 72 < x1, x1 < 74}, {x1 = 72, 426/7 < x2, x2 < 62}, {72 < x1, 430/7 < x2, x1 < 363/2-(7/4)*x2, x2 < 62}, {x1 = 363/2-(7/4)*x2, 430/7 < x2, x2 < 62}]
Region6 = [{408/7 < x2, x1 < 75, x2 < 412/7, 177-(7/4)*x2 < x1}, {412/7 <= x2, x2 <= 414/7, 74 < x1, x1 < 75}, {x1 = 74, x2 <= 418/7, 412/7 < x2}, {74 < x1, 414/7 < x2, x1 < 357/2-(7/4)*x2, x2 < 418/7}, {x1 = 357/2-(7/4)*x2, 414/7 < x2, x2 < 418/7}]
Region7 = [{404/7 < x2, x1 < 76, x2 < 58, 177-(7/4)*x2 < x1}]
Region8 = [{410/7 < x2, x1 < 76, x2 < 414/7, 357/2-(7/4)*x2 < x1}, {414/7 <= x2, 75 < x1, x1 < 76, x2 < 60}, {x1 = 75, 414/7 < x2, x2 < 60}]
Region9 = [{426/7 < x2, x1 < 75, x2 < 430/7, 363/2-(7/4)*x2 < x1}, {430/7 <= x2, 74 < x1, x1 < 75, x2 < 62}, {x1 = 74, 430/7 < x2, x2 < 62}]
Region10 = [{438/7 < x2, x1 < 75, x2 < 442/7, 369/2-(7/4)*x2 < x1}, {442/7 <= x2, x2 <= 444/7, 74 < x1, x1 < 75}, {x1 = 74, 442/7 < x2, x2 < 64}, {74 < x1, 444/7 < x2, x1 < 186-(7/4)*x2, x2 < 64}, {x1 = 186-(7/4)*x2, 444/7 < x2, x2 < 64}]
Region11 = [{414/7 < x2, x1 < 78, x2 < 60, 363/2-(7/4)*x2 < x1}]
Region12 = [{432/7 < x2, x1 < 78, x2 < 62, 186-(7/4)*x2 < x1}]
Region13 = [{442/7 < x2, x1 < 80, x2 < 64, 381/2-(7/4)*x2 < x1}]

 

Plotting the 3d regions is now easy.

f23 := plottools:-transform((x1,x2) -> [x1,x2,-2*x1*(1/3)-7*x2*(1/6)+31]):

plots:-display(f23(proj));

 

 


 

Download sysfloor-sent.mw

The integral is indeed 2*Pi for any complex a. This follows from the Residue theorem.

Maple finds the antiderivative Ei(1, exp(I*x))  and using Newton-Leibniz concludes that the integral is 0.
Unfortunately the antiderivative is discontinuous but Maple cannot check this (at least for a symbolic a).
Such situations are common and will not disappear soon (most of them).

The system can be reduced to 2 equations eliminating e.g. x3.
It is easy to obtain  60 < x1 < 85,  50 < x2 < 70.

S12:=[floor((1/2)*x1)+floor((1/5)*x2)+floor(-(2/9)*x1-(7/18)*x2+1/3)-8,
      floor((1/5)*x1)+floor((1/2)*x2)+floor(-(1/6)*x1-(7/24)*x2+3/4)-14]:
f:=(i,j) -> eval( S12,[x1=60+i/500*25,x2=50+j/500*20]): 
M:=Matrix(500, (i,j) -> `if`(f(i,j)=[0,0],1,0)):
plots:-sparsematrixplot(M, size=[500,500],
  labels=["",""],tickmarks=[[1=60,500=85], [1=50,500=70]]);

It is possible to write a code and obtain all these regions, but probably a motivation would be necessary
(without it the problem does not seem to be interesting enough).

Increasing Digits:=15 (which is always a good idea for numerics) is enough in this case.

(Note that the summation order is not necessarily the same in I1 and I2 and `+` is not associative for floats.)

See also here.

Such 5-fold integrals containing discontinuous/nondifferentiable functions  are hard.
You must know to help Maple for them.
For example, use the method from my previous comment ==>

restart;
dd:= u=w*y..1, v=w*x..1, x=0..1, y=0..1, w=0..1:
int(abs((w*y-u)*(w*x-v)-w^2*x*y), dd);
evalf(%);

       -91/1080+4*ln(2)*(1/15)
       0.1005799889

Now, a numerical check is mandatory.

int(abs((w*y-u)*(w*x-v)-w^2*x*y)*piecewise(0 < -w*x*y+u*x and -w*x*y+u*x < 1, 1)*
piecewise(0 < -w*x*y+v*y and -w*x*y+v*y < 1, 1),
 [u = 0 .. 1, v = 0 .. 1, w = 0 .. 1, x = 0 .. 1, y = 0 .. 1],
 numeric, method=_CubaDivonne, epsilon=1e-5);

        0.100580642789240

We may conclude that the symbolic computation is correct [ 99.9% say :-) ].

 

restart:
with(Statistics):
#N :=3;# ... Some integer value >= 2;  
X := RandomVariable(Binomial(N, 1/2)): 
F:=CDF(X, s):
N:=3:
plot(F, s=-1..N+1, gridlines=true, axis[1]=[gridlines=N+1], discont, thickness=3);

 

A symmetric real matrix has orthogonal eigenvectors but the eigenvectors found by Eigenvectors are not necessarily orthogonal unless the eigenvalues are distinct or the matrix contains floats.
To obtain the orthogonal ones, use GramSchmidt.
In your case:

 

A:=Matrix(3, 3, [[2/3, -1/4, -1/4], [-1/4, 2/3, -1/4], [-1/4, -1/4, 2/3]])

Matrix(3, 3, {(1, 1) = 2/3, (1, 2) = -1/4, (1, 3) = -1/4, (2, 1) = -1/4, (2, 2) = 2/3, (2, 3) = -1/4, (3, 1) = -1/4, (3, 2) = -1/4, (3, 3) = 2/3})

(1)

with(LinearAlgebra):

v,Q:=Eigenvectors(A);

v, Q := Vector(3, {(1) = 1/6, (2) = 11/12, (3) = 11/12}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = -1, (1, 3) = -1, (2, 1) = 1, (2, 2) = 1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 0, (3, 3) = 1})

(2)

U:=Matrix(GramSchmidt([seq(Q[..,i],i=1..RowDimension(Q))],normalized));

Matrix(3, 3, {(1, 1) = (1/3)*sqrt(3), (1, 2) = -(1/2)*sqrt(2), (1, 3) = -(1/6)*sqrt(6), (2, 1) = (1/3)*sqrt(3), (2, 2) = (1/2)*sqrt(2), (2, 3) = -(1/6)*sqrt(6), (3, 1) = (1/3)*sqrt(3), (3, 2) = 0, (3, 3) = (1/3)*sqrt(6)})

(3)

U.U^+;

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(4)

A = U . DiagonalMatrix(v) . U^+;

f := sin(x) / ( ( sin(a*x) )^a * ( sin((1-a)*x) )^(1-a) ):
MultiSeries:-limit(f, x=0,right) assuming a>0;

Same for a<0.

Maple is correct.

 

 

pde.mw

 

restart;

with(InertForm):

c:=a+b;

a+b

(1)

cc:=MakeInert(c):

a:=5;
b:=10;

5

 

10

(2)

cc=c;

`%+`(5, 10) = 15

(3)

################################

restart;

with(InertForm):

c:=MakeInert(a+b);

`%+`(a, b)

(4)

a:=5;
b:=10;

5

 

10

(5)

c = Value(c);

`%+`(5, 10) = 15

(6)

You have copied the expressions from the web page. Don't do this, because (unfortunately)  they are not designed to be copied.
Just open the help page (type ?Jacobian in Maple) and copy from there.
 

First 64 65 66 67 68 69 70 Last Page 66 of 120