Kitonum

21500 Reputation

26 Badges

17 years, 58 days

MaplePrimes Activity


These are answers submitted by Kitonum

The last line should be

dsolve({eq, bcs}, v(x));

Matrix([seq([seq(a[k], k = x+m .. y+m)], m = 0 .. 2)]);

a:=1:  c:=2:

fsolve(5*b^5+(60-5*a)*b^4+(125+50*c-80*a)*b^3+(594*c-445*a-775)*b^2+(2324*c-1005*a-3270)*b+3000*c-750*a-3000=0, b);

                                          -5.950891678, -4.378215842, -3.371729567

 

PS. We find the real roots. If also complex roots are needed, then

fsolve(5*b^5+(60-5*a)*b^4+(125+50*c-80*a)*b^3+(594*c-445*a-775)*b^2+(2324*c-1005*a-3270)*b+3000*c-750*a-3000=0, b, complex); 

                                          -5.950891678, -4.378215842, -3.371729567,
                              1.350418543 - 1.816274549 I, 1.350418543 + 1.816274549 I

Consider the function  f:=x->sqrt(a* x + b) +  sqrt(c*x + d) . If  a*c>=0  then  f   is a monotonic function. Therefore, the equation   sqrt(a* x + b) +  sqrt(c*x + d) = m  can not have two solutions. So the necessary condition is   a*c<0 . For definiteness, let  a>0 . From these conditions and from the conditions a*x+b>=0,  c*x+d>=0  we get  -b/a<=x<=-d/c . Therefore, in the limited ranges of parameters  a, b, c, d  all the solutions can be found by the usual brute force.

The following code finds all equations with integers  a=1 .. 10,  b=-10 .. 10,  c=-10 .. -1,  d=-10 .. 10, each of which has exactly two integer solutions:

L:=[]:

for a to 10 do

for b from -10 to 10 do

for c from -10 to -1 do

for d from -10 to 10 do

if -b/a<=-d/c then s:=floor(-b/a): t:=ceil(-d/c):

M:=[]:

for x from s to t do

u:=sqrt(a*x+b): v:=sqrt(c*x+d):

if type(u, integer) and type(v, integer) then M:=[op(M), [x, u+v]]: fi:

od:

if nops(M)=2 and M[1,2]=M[2,2] then L:=[op(L), [a,b,c,d,M[2,2],[M[1,1],M[2,1]]]]: fi: fi:

od: od: od: od:

nops(L);

L[1..50];

ListTools[Search]([1, 5, -1, 8, 5, [-1,4]], L); 

  

 

For example, the list  [1, -9, -1, 10, 1, [9, 10]]  corresponds to the equation  sqrt(x-9)+sqrt(-x+10)=1  with the roots 9 and 10. The list  L  contains all the solutions in the specified ranges. Received 319 solutions. Displayed first 50 solutions. The original equation is also in the list  L  at position 82.

Check your syntax! I have no problem:

 

It makes no sense to look for what does not exist, because no global minimum and global maximum. A point  (x,y,z)  lies on the sphere of radius  sqrt(5)  and the plane  x+y+z+1=0   intersects the sphere. Therefore, the denominator of the fraction  96/(x+y+z+1)  can be arbitrarily close to 0 and may be positive or negative.

This can be seen clearly in the plot:

phi:=Pi/4:
A:=subs(x=sqrt(5)*sin(theta)*cos(phi), y=sqrt(5)*sin(theta)*sin(phi), z=sqrt(5)*cos(theta), 1/2*x^2*y^2 + y^2*z^2 + z^2 *x^2 + 96/(x + y + z + 1)):
plot(A, theta=0..Pi, view=[0..Pi, -1000..1000], thickness=2, discont=true);

 

 

Should be

u:=(x,t)->exp(-Pi^2*t)*cos(Pi*x):

Your problem can be solved by the usual brute force. The program returns a list of all suitable  [a, b​​, c]  and the corresponding sequences  t[k], k=-1..20

t[-1]:=0: t[0]:=1: L:=[]: T:=[]:

for a to 20 do

for b to 20 do

for c to 20 do

for n from 0 to 19 do

t[n+1]:=((a*n^2+a*n+b)*t[n]+c*(n^2)*t[n-1])/(n+1)^2:

od:

if convert([seq(type(t[k], integer), k=1..20)], `and`) then L:=[op(L), [a,b,c]]:

T:=[op(T), [seq(t[k], k=-1..20)]] fi:

od: od: od:

L; T;

 

Two errors in your code. Instead of  (H[1]-x2)*(x2-x1) +(H[2]-y2)*(y2-y1)=0 and (x2-x1)*(y3-y1) +(x3-x1)*(y2-y1) <>0  should be  (H[1]-x3)*(x2-x1) +(H[2]-y3)*(y2-y1)=0 and (x2-x1)*(y3-y1) -(x3-x1)*(y2-y1) <>0 

Let the vertices of the triangle will be  [x1,y1], [x2,y2], [x3,y3] . Firstly we find the coordinates of orthocenter:

restart:

sol:=solve({(x3-x2)*(x-x1)+(y3-y2)*(y-y1)=0, (x2-x1)*(x-x3)+(y2-y1)*(y-y3)=0}, {x,y});

assign(sol):

 

Next, we find the solution of the original problem. Note that can confine ourselves 4-loops instead of 6-loops, if we use the formula for the centroid. So we can increase the range of  search. Also, instead of lists we use sets, so exclude the same triangles (which are obtained by permutations of the vertices):

L:={}:

k:=50:

for x1 from -k to k do

for x2 from -k to k do

for y1 from -k to k do

for y2 from -k to k do

x3:=3-x1-x2: y3:=3-y1-y2:

if x2*y3-x1*y3+x1*y2-y2*x3+y1*x3-y1*x2<>0 and x=3 and y=3 then

L:={op(L), {[x1,y1], [x2,y2], [x3,y3]}}: fi:

od: od: od: od:

nops(L); L;

If the centroid of a triangle coincides with the orthocenter, then the triangle is equilateral. It is easy to prove that in 2D coordinates of all the vertices of this triangle can not be integers.

int(rho*(rho+1)*sin(phi), [rho = 0 .. R, phi = 0 .. Pi, theta = 0 .. 2*Pi]);

 

 

Tridiag:=proc(Diag1, Diag, Diag2, n)

local m, A, i, j;

m:=nops(Diag);

A:=Matrix(m, n);

for i to m do

for j to n do

if i=j then A[i,j]:=Diag[i] else

if i=j+1 then A[i,j]:=Diag1[j] else

if j=i+1 then A[i,j]:=Diag2[i] else

A[i,j]:=0; fi; fi; fi;

od; od;

A;

end proc:

 

Example:

Tridiag([1,2,3,4,5], [2,3,4,5,6,7], [3,4,5,6,7,8], 8);

 

 

We assume that the cylinder of a revolver has 6 chambers. The procedure returns a structure of each trial and vector of   times the trigger was pulled.

RR:=proc(N)  # N is the number of trials

local roll, i, a, L, j, b, M, Q, A;

roll:=rand(1..6);

for i to N do

a:=roll(); L:=[[a]];  # a is the chamber number in which the bullet

for j do

b:=roll(); if b=a then L:=[op(L), b]; break else  L:=[op(L), b]; fi;

od;

M[i]:=L;

od;

Q:=[seq(M[i], i=1..N)];

A:=Vector([seq(nops(Q[i])-1, i=1..nops(Q))]);

print(op(Q));

print(A);

end proc:

 

Example:

RR(10);

SolvingSystem:=proc(system, n)
 if n=1 then method s1 fi;
 if n=2 then method s2 fi;
 if n=3 then metod s3 fi;
 result;
end proc:

add(add(int00[i,j], j=1..3), i=1..3);

                           0

First 266 267 268 269 270 271 272 Last Page 268 of 290