Kitonum

20084 Reputation

26 Badges

17 years, 22 days

MaplePrimes Activity


These are answers submitted by Kitonum

You don't need the combinat package for this. You can just use a nested loop for this (triple loop for your example since k = 3):

restart;
L:=[1,2,3,4,a]: n:=nops(L):
for i1 from 1 to n-2 do
for i2 from i1+1 to n-1 do
for i3 from i2+1 to n do
print([L[i1],L[i2],L[i3]]);
od: od: od:

                           [1, 2, 3]
                           [1, 2, 4]
                           [1, 2, a]
                           [1, 3, 4]
                           [1, 3, a]
                           [1, 4, a]
                           [2, 3, 4]
                           [2, 3, a]
                           [2, 4, a]
                           [3, 4, a]
 

Try the following. In Maple 2018, both methods lead to the same result:

restart;
f := x*y:
JH := int(Heaviside(f-1/2), [x=0..1, y=0..1]); 
JP := int(piecewise(x*y>1/2, 1, 0), [x=0..1, y=0..1]);

                          

 

 

restart;
y1:=2*x-4: y2:=-2*x+4:
A:=plot([y1,y2], x=0..4, -2..2, color=blue, thickness=2, labels=[``,``]):
B:=plottools:-sector([2, 0], 0.5, arctan(2) .. Pi-arctan(2), color = pink):
T:=plots:-textplot([[4.3,-0.2,x],[-0.2,2.3,y]], font=[times,16]):
plots:-display(A,B,T, view=[-0.2..4.3,-2..2.3], scaling=constrained);

                  

 

 

Or

min(op(xLp_tmp));

 

restart;
simplify(-0.27059805007310 * sin(0.12 + epsilon) +0.27059805007310 * sqrt(1.-cos(0.12 + epsilon) ^ 2)) assuming sin(0.12 + epsilon)>=0;

                                                           0.

or

expr:=-0.27059805007310 * sin(0.12 + epsilon) +0.27059805007310 * sqrt(1.-cos(0.12 + epsilon)^2);
subs(0.12 + epsilon=t, expr);
simplify(%) assuming t>=0 and t<=Pi;

           

restart;
G:=GraphTheory:-RandomGraphs:-RandomGraph([seq(v[i],i=1..8)], 10, connected);
GraphTheory:-DrawGraph(G);

               

 

Edited.

 

Using nested loops, we find 1170 solutions. Your example is on the 578th place:

restart;
f:=x->(a*x^2 + b*x + c)/(d*x^2 + e*x + m):
g:=x->d*x^2 + e*x + m:
k:=0:
for a from 1 to 10 do
for b from 1 to 10 do
for c from 1 to 10 do
for d from 1 to 10 do
for e from 1 to 10 do
for m from 1 to 10 do
N:=numer(diff(f(x),x)):
A:=coeff(N,x^2); B:=coeff(N,x); C:=coeff(N,x,0);
disc:=B^2-4*A*C:
if A<>0 and disc>0 and type(sqrt(disc),integer) then x1:=(-B+sqrt(disc))/2/A: x2:=(-B-sqrt(disc))/2/A;
if type(x1,integer) and type(x2,integer) and g(x1)<>0 and g(x2)<>0 then if type(f(x1),integer) and type(f(x2),integer)   then
k:=k+1; L[k]:=[a,b,c,d,e,m] fi; fi; fi;
od: od: od: od: od: od:
L:=convert(L, list):
nops(L);
ListTools:-Search([5,8,2,2,6,5],L);  
                            

                                                                        1170
                                                                         578

restart;
z1:=x1+I*y1: z2:=x2+I*y2: z3:=x3+I*y3:
simplify(evalc(abs(z1+z2+z3)), evalc(map(t->t^2,{abs(z1)=1,abs(z2)=2,abs(z3)=3,abs(9*z1*z2+4*z1*z3+z2*z3)=12}))):
simplify(%);

                                                               2

 

These 2 files are not loaded. See below my program that solves the problem in a couple of seconds:

restart;
p:=2: k:=0:
while k<10000 do
if isprime(p+36) then k:=k+1; L[k]:=p fi;
p:=nextprime(p);
od:
L:=convert(L,list):

nops(L);
L[-1];

 

"Warning" is not a bug, but a warning. Your real mistake is that it should be  L[k*n]  and  L[n]  instead of  L__k*n  and  L__n. This is not visible in 2d math and I had to convert your code to 1d math to find and fix this error of yours.

restart; 
Eratosthenes := proc(N::posint) 
local L, primeslist, n, k; 
description "Calculate all primes less than or equal to N"; 
L := Array(2 .. N, i->true); 
for n from 2 to trunc(sqrt(N)) do 
if L[n] = true then 
for k from n while k*n <= N do 
L[k*n] := false od; fi; 
od; 
primeslist := NULL; 
for n from 2 to N do 
if L[n] = true then 
primeslist := primeslist, n fi; 
od; 
primeslist;
end proc:

Eratosthenes(32);

                             2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31

You have a system of 11 equations with 11 unknowns, but you are trying to solve it for only a part of the unknowns, obviously considering the rest of the unknowns as parameters. This way you end up with an overridden system that is usually inconsistent. If you use the  solve command to all 11 unknown, the program hangs. The  fsolve  command gives one solution:

restart;
Sys:={-mu*a[1]+2*c[2]*a[1]*a[2]^2-a[1]*k^2*c[1]+2*c[2]*a[1]*a[0]^2+5*c[4]*a[0]^4*a[1]+5*c[4]*a[1]*a[2]^4+3*c[3]*a[1]*a[2]^2+3*c[3]*a[0]^2*a[1]+a[1]*c[1]+30*c[4]*a[0]^2*a[1]*a[2]^2-20*c[4]*a[1]*a[2]*a[0]^3-4*c[2]*a[1]*a[0]*a[2]-8*c[2]*a[1]^3*A*B+24*c[1]*a[1]*A*B-6*c[3]*a[0]*a[1]*a[2]-20*c[4]*a[0]*a[1]*a[2]^3+48*c[2]*a[1]*a[0]^2*A*B+176*c[2]*a[1]*a[2]^2*A*B-224*c[2]*a[1]*A*B*a[0]*a[2] = 0, -16*c[2]*a[1]^3-6*mu*a[1]+156*c[2]*a[1]*a[2]^2-6*a[1]*k^2*c[1]-20*c[2]*a[1]*a[0]^2+30*c[4]*a[0]^4*a[1]-20*c[4]*a[1]^3*a[2]^2+30*c[4]*a[1]*a[2]^4-6*c[3]*a[1]*a[2]^2+18*c[3]*a[0]^2*a[1]+20*c[4]*a[0]^2*a[1]^3+c[4]*a[1]^5+2*a[1]^3*c[3]-10*a[1]*c[1]-60*c[4]*a[0]^2*a[1]*a[2]^2-24*c[2]*a[1]^3*A*B+8*c[1]*a[1]*A*B+16*c[2]*a[1]*a[0]^2*A*B+336*c[2]*a[1]*a[2]^2*A*B+352*c[2]*a[1]*A*B*a[0]*a[2] = 0, -32*c[2]*a[2]*a[0]^2*A*B-8*c[2]*a[1]^2*a[0]*A*B+64*c[2]*a[2]^2*a[0]*A*B+8*c[2]*a[1]^2*a[2]*A*B-5*c[4]*a[0]^4*a[2]+10*c[4]*a[0]^3*a[2]^2-10*c[4]*a[0]^2*a[2]^3+5*c[4]*a[0]*a[2]^4-a[0]*k^2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20*a[0]^3*a[1]*a[2]*c[4]+30*a[0]^2*a[1]*a[2]^2*c[4]+20*a[0]*a[1]*a[2]^3*c[4]+5*a[1]*a[2]^4*c[4]-k^2*a[1]*c[1]+2*a[0]^2*a[1]*c[2]+3*a[0]^2*a[1]*c[3]+4*a[0]*a[1]*a[2]*c[2]+6*a[0]*a[1]*a[2]*c[3]+2*a[1]*a[2]^2*c[2]+3*a[1]*a[2]^2*c[3]-mu*a[1]+a[1]*c[1] = 0, 5*a[0]^5*c[4]+15*a[0]^4*a[2]*c[4]+10*a[0]^3*a[1]^2*c[4]+10*a[0]^3*a[2]^2*c[4]+30*a[0]^2*a[1]^2*a[2]*c[4]-10*a[0]^2*a[2]^3*c[4]+30*a[0]*a[1]^2*a[2]^2*c[4]-15*a[0]*a[2]^4*c[4]+10*a[1]^2*a[2]^3*c[4]-5*a[2]^5*c[4]-5*k^2*a[0]*c[1]-3*k^2*a[2]*c[1]+5*a[0]^3*c[3]-16*a[0]^2*a[2]*c[2]+9*a[0]^2*a[2]*c[3]+6*a[0]*a[1]^2*c[2]+3*a[0]*a[1]^2*c[3]-32*a[0]*a[2]^2*c[2]+3*a[0]*a[2]^2*c[3]+6*a[1]^2*a[2]*c[2]+3*a[1]^2*a[2]*c[3]-16*a[2]^3*c[2]-a[2]^3*c[3]-5*mu*a[0]-3*mu*a[2]-8*a[2]*c[1] = 0}:
nops(Sys);
indets(Sys);
fsolve(Sys);

                                                     11
                     {A, B, k, mu, a[0], a[1], a[2], c[1], c[2], c[3], c[4]}
               {A = -1.372706307, B = 2.529830542, k = -1.759770235, mu = 0.,  a[0] = -2.269126642, a[1] = 0.,          a[2] = -6.833450316, c[1] = 0., c[2] = 0., c[3] = 0., c[4] = 0.}
 

Maple's complete solutions often look too long. You can ask Maple to show only 2 integrations by parts using the  IntegrationTools:-Parts  command. You must specify u-term every time:

restart;
A:=Int(t^2*exp(-11*t), t);
B:=IntegrationTools:-Parts(A, t^2);
IntegrationTools:-Parts(B, t);
value(%);
diff(%, t);  # Check

                     

 

The problem is easily solved by simply enumerating all the options. We get 4 solutions with a minimum distance of 20 :

restart;
pts:=[[0, 0], [1, 1], [2, 5], [4, 2], [5, 3]]:
local D:
A,B,C,D,E:=pts[]:
dist:=(X,Y)->abs(X[1]-Y[1])+abs(X[2]-Y[2]):
P:=combinat:-permute([B,C,D,E]):
k:=0:
for p in P do
k:=k+1; d:=dist(A,p[1])+dist(p[1],p[2])+dist(p[2],p[3])+dist(p[3],p[4])+
dist(p[4],A); L[k]:=[p,d];
od:
L:=sort(convert(L,list),key=(x->x[2])):
L[1..4][];

   L := [[[[1, 1], [2, 5], [5, 3], [4, 2]], 20], [[[1, 1], [4, 2], [5, 3], [2, 5]], 20], [[[2, 5], [5, 3], [4, 2], [1, 1]], 20], [[[4, 2], [5, 3], [2, 5], [1, 1]], 20], [[[1, 1], [2, 5], [4, 2], [5, 3]], 22], [[[1, 1], [5, 3], [4, 2], [2, 5]], 22], [[[2, 5], [4, 2], [5, 3], [1, 1]], 22], [[[5, 3], [4, 2], [2, 5], [1, 1]], 22], [[[1, 1], [4, 2], [2, 5], [5, 3]], 24], [[[1, 1], [5, 3], [2, 5], [4, 2]], 24], [[[4, 2], [2, 5], [5, 3], [1, 1]], 24], [[[5, 3], [2, 5], [4, 2], [1, 1]], 24], [[[2, 5], [1, 1], [4, 2], [5, 3]], 26], [[[2, 5], [1, 1], [5, 3], [4, 2]], 26], [[[4, 2], [5, 3], [1, 1], [2, 5]], 26], [[[5, 3], [4, 2], [1, 1], [2, 5]], 26], [[[2, 5], [5, 3], [1, 1], [4, 2]], 28], [[[4, 2], [1, 1], [2, 5], [5, 3]], 28], [[[4, 2], [1, 1], [5, 3], [2, 5]], 28], [[[5, 3], [2, 5], [1, 1], [4, 2]], 28], [[[2, 5], [4, 2], [1, 1], [5, 3]], 30], [[[4, 2], [2, 5], [1, 1], [5, 3]], 30], [[[5, 3], [1, 1], [2, 5], [4, 2]], 30], [[[5, 3], [1, 1], [4, 2], [2, 5]], 30]]

     [[[1, 1], [2, 5], [5, 3], [4, 2]], 20], [[[1, 1], [4, 2], [5, 3], [2, 5]], 20], [[[2, 5], [5, 3], [4, 2], [1, 1]], 20], [[[4, 2], [5, 3], [2, 5], [1, 1]], 20]

The code below works. 10 frames are allocated for each n :

restart;
WM := n -> plots:-matrixplot(P^n, heights=histogram):
P := Matrix(2$2, [0.8, 0.2, 0.4, 0.6]);
plots:-animate(WM, [n], n=[seq(i$10,i=1..10)]);

                   

 

restart;
with(LinearAlgebra):
with(GraphTheory):
ts:=time():
g:=Graph(Matrix([[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]]));

Eg := add(abs(Eigenvalues(AdjacencyMatrix(g)))):
evalf(%);

DEg := add(abs(Eigenvalues(AllPairsDistance(g)))):
evalf(%);

time()-ts;

 g := Graph 1: an undirected unweighted graph with 31 vertices  and 30 edge(s)
                          37.91134763
                          614.5329657
                             0.922
 

First 19 20 21 22 23 24 25 Last Page 21 of 280