vv

12453 Reputation

19 Badges

9 years, 279 days

MaplePrimes Activity


These are answers submitted by vv

ALG:=proc(X::set, C::set(set))
local A:=C union {{}}, S, T, ok:=false;
if not `union`(C[]) subset X then error "C must contain subsets of X" fi;
while not ok do
  ok:=true;
  for S in A do
    if not (X minus S) in A then A:= A union {X minus S}; ok:=false fi;
    for T in A do
      if not (S union T) in A then A:= A union {S union T}; ok:=false fi;
    od
  od
od;
A
end proc:
    

ALG({1,2,3}, {{1},{2}});nops(%);

{{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}

 

8

(1)

ALG({1,2,3,4,5}, {{1,4},{2,4}, {1}}); nops(%);

{{}, {1}, {2}, {4}, {1, 2}, {1, 4}, {2, 4}, {3, 5}, {1, 2, 4}, {1, 3, 5}, {2, 3, 5}, {3, 4, 5}, {1, 2, 3, 5}, {1, 3, 4, 5}, {2, 3, 4, 5}, {1, 2, 3, 4, 5}}

 

16

(2)

ALG({1,2,3,4,5}, {{2,4,5},{1,4,5}}); nops(%);

{{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {4, 5}, {1, 2, 3}, {1, 4, 5}, {2, 4, 5}, {3, 4, 5}, {1, 2, 4, 5}, {1, 3, 4, 5}, {2, 3, 4, 5}, {1, 2, 3, 4, 5}}

 

16

(3)

 


Download ALG.mw

@Zeineb Maple can help to compute it, but only if one uses the right theorem.
 

restart;
alpha := x->floor(x):
f:=x->x^2+1:
int(f(x)*diff(alpha(x),x), x=0..3);  # wrong
#                               0
f(3)*alpha(3)-f(0)*alpha(0) - int(alpha(x)*diff(f(x),x), x=0..3); # correct
#                               17

As I have mentioned, Int_[0..3] alpha d alpha   does not exisist.

If P[1], ..., P[4] are your points, consider a fifth point P[5] of unknown coordinates, say (a,b).
Then take the conic (via its quadratic equation) thru P[1], ..., P[5] and impose the condition to be a parabola.
In general there will two parabolas, but it is also possible to have 0 (!). E.g. a parabola cannot pass thru the vertices of a square.

 

restart

F:= (x,y)->a*x^2+b*x*y+c*y^2+d*x+e*y+f:

P:=['[rand(10)(),rand(10)()]'$4];

[[6, 9], [5, 1], [3, 5], [4, 0]]

(1)

P5:=[P[],[u,v]]:

S:=solve({seq(F(u[]), u in P5), a+b+c+d+e+f-1, b^2-4*a*c}, explicit):

par:={seq(eval(F(x,y), s), s=evalf(S))};

{-.2698883828*x^2+.4627530124*x*y-.1983601037*y^2+.9065772841*x-.5929867972*y+.6919049874, 0.9338441002e-1*x^2+0.14921636e-2*x*y+0.596069e-5*y^2-.8117986235*x-0.361278452e-1*y+1.753043935}

(2)

plots:-implicitplot(par, x=-10..10, y=-10..10);

 
 

 

 

restart;

x0,y0 := 0.504244923, 0.3781836925:
f := (x,y) -> 7*x^2 - 7*y^2 - 12.0*x + 9.0*y + 2.25 - 2*x*y:

f(x0,y0);

0.22e-8

(1)

T:=D[1](f)(x0,y0)*(x-x0)+D[2](f)(x0,y0)*(y-y0);

-5.696938463*x+1.852714152+2.696938459*y

(2)

plots:-implicitplot([f(x,y),T], x=x0-2..x0+2, y=y0-2..y0+2, color=[red,blue]);

 

 

Student:-Basics:-LongDivision(A,B,x, output=printf);

                4/3*x^2+80/3*x+1552/3
              -----------------------
3*x^2-60*x+36 ) 4*x^4
                4*x^4-80*x^3+48*x^2
                -------------------
                     80*x^3-48*x^2
                     80*x^3-1600*x^2+960*x
                     ---------------------
                           1552*x^2-960*x
                           1552*x^2-31040*x+18624
                           ----------------------
                                 30080*x-18624

 

You must export in a directory with write permission. By default the current directory is Maple's directory (without such permission).
So, you must change the directory, e.g. use "c:/temp/Test.jpg", (if you have such a directory),
or, execute first
currentdir(kernelopts(homedir));

Your second equation Y, equivalent to Y = 0,  reduces to a = 0, and does not depend on m. So, you have nothing to eliminate.

For higher-order functionals, use variables to represent derivatives. E.g.
L1:=eval(L, [diff(x(t),t,t)=diff(x1(t),t), diff(theta(t),t,t)=diff(theta1(t),t)]):
L2:=L1 + A*(diff(x(t),t) - x1(t))^2 + B*(diff(theta(t),t) - theta1(t))^2:
EulerLagrange(L2, t, [x(t), theta(t), x1(t), theta1(t)]);

 

 

z is on the tangent thru the origin to the circle abs(z-6*I) = 3.

So,  arg(z) equals

 

a := arccos(3/6);

(1/3)*Pi

(1)

z = 3*tan(a) * exp(I*a); evalc(%);

z = 3*3^(1/2)*(1/2+((1/2)*I)*3^(1/2))

 

z = (3/2)*3^(1/2)+(9/2)*I

(2)

 

Such an assignment is not possible due to the standard evaluation in any CAS: psi(t) would be evalaluated to psi(t)(t)(t)... (i.e. a nonsense).
It is possible to use macro (for input only)  or alias (for both input and output). You must be aware that in both cases psi(a) will be evaluated to psi(t)(a).

restart;

alias(psi=psi(t));

psi

(1)

diff(psi*t,t);

(diff(psi, t))*t+psi

(2)

psi(3);

psi(3)

(3)

restart;

macro(psi=psi(t));

psi

(4)

diff(psi*t,t);

(diff(psi(t), t))*t+psi(t)

(5)

psi(3);

(psi(t))(3)

(6)

 

 

# x,y,z = the unknowns, top to bottom
# h1,h2,h3  = halves of the heights 
# a,b,c,d,e = the bases of the triangles
restart
eq:=
[260=a*h2, 247=b*h2, 287=d*h3, 209=e*h3,
x=a*h1, y=c*h2, z=(b+c)*h3,
h1/(h1+h2)=a/(b+c), h1/(h1+h2+h3)=a/(d+e)]:
S:=eliminate(eq,{h1,h2,h3,a,b,c,d,e}):
elim:=S[1]:
XY:=S[-1]:
XY1:=[isolve(XY[1])]:
xy:=select( u -> (eval(x,u)::posint and eval(y,u)::posint), XY1):
for v in xy do
  zz:={solve( eval(XY[2],v) )};
  for z1 in zz do  if z1::posint then print(v[],'z'=z1, eval(elim,[v[],'z'=z1])) fi od;
od:

So, two solutions found.
I don't see any relation with the star (100). Maybe I miss something.

It often works.

restart;
r := x*(diff(theta(t), t))^2+y*(diff(varphi(t), t))^2+z*(diff(theta(t), t$2))+w*diff(varphi(t), t$2):
g := (4*(f+T))*(diff(theta(t), t))^2+u*(diff(varphi(t), t))^2+(f+9)*(diff(theta(t), t$2))+4*s*diff(varphi(t), t$2):

eval(r-g, [theta=(t->t^3), varphi=(t->t^7)]): # or similar
solve([coeffs(%, t)], [x,y,z,w]);
simplify(eval(r-g, %[1]));   #check
#          [[x = 4*f+4*T, y = u, z = f+9, w = 4*s]]
#                               0

 

 

A brute-force search shows that the problem has no solution with at a least one tuple (xi,yi,zi) from the set {-N,...,N}, N = 40.
It shoud not be too hard to prove this in general (mathematically).

It's only a display decision when interface(typesetting=extended) .
For interface(typesetting=standard)  ==>  a0.5

`@W`  is a name (symbol)  enclosed in back quotes. It could be used as a generic procedure, or maybe a procedure `@W` is defined somewhere. Such a name can be used in 2022 too!

First 10 11 12 13 14 15 16 Last Page 12 of 111