vv

11691 Reputation

19 Badges

7 years, 125 days

MaplePrimes Activity


These are answers submitted by vv

plot(1/x, x=0.1..0.9, tickmarks=[[seq(i/10=i/`10`,i=1..9)], default]);

It is very simple to generate all the algebras (but only for a very small set).
Note that the number of algebras on a set with n elements is combinat:-bell(n)

restart

ALG := proc (X::set, C::(set(set)))
  local A, S, T, ok; A := C union {{}}; 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:

with(combinat):

X:={1,2,3}:

ALGS:={seq}(ALG(X,A), A in (powerset@@2)(X)):

nops(ALGS) = combinat:-bell(nops(X));

5 = 5

(1)

ALGS

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

(2)

 

DS:=proc(X::set, C::set(set)) # Dynkin system
local D:=C union {X}, 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 D do for T in D do
    if S subset T and not (T minus S) in D then D:= D union {T minus S}; ok:=false fi;
  od od
od;
D
end proc:

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

                                8

DS({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

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

                               6

restart

Q := 4*x^2 - 4*x*y + y^2 + 10*x - 6*y + 6

4*x^2-4*x*y+y^2+10*x-6*y+6

(1)

with(geometry):

_EnvHorizontalName := 'x': _EnvVerticalName := 'y':

conic(co,Q,[x,y]):

#detail(co);

coordinates(vertex(co));

[-71/50, -6/25]

(2)

coordinates(focus(co));

[-7/5, -1/5]

(3)

Equation( line(axisP, [focus(co), vertex(co)]) );  # axis

13/250+(1/25)*x-(1/50)*y = 0

(4)

draw([co, axisP, focus(co)], color=[red, blue, black])

 

 


Download geometry-parab.mw

You probably want non-collinear vectors.

restart;
P:=(p,q,r) -> [p^2-q^2-r^2 ,2*p*q, 2*p*r]:
n:=13:
pyt:=[seq](seq(seq(P(p,q,r), p=floor(sqrt(q^2+r^2))+1..n), q=1..n),r=1..n):
pyt:=select( u -> evalb(igcd(u[])=1), pyt):
for i to nops(pyt) do for j from i+1 to nops(pyt) do
 A:=pyt[i]; B:=pyt[j];
 N2:=(A[2]*B[3]-A[3]*B[2])^2+(A[1]*B[3]-A[3]*B[1])^2+(A[1]*B[2]-A[2]*B[1])^2;
 if issqr(N2) then lprint(A,B) fi
od od:

[31, 24, 12], [3, 24, 16]
[19, 48, 12], [3, 16, 24]
[19, 48, 12], [3, 96, 80]
[27, 96, 16], [13, 144, 36]
[63, 120, 20], [115, 120, 48]
[63, 120, 20], [7, 24, 60]
[107, 144, 24], [3, 16, 24]
[31, 12, 24], [3, 16, 24]
[3, 24, 16], [19, 12, 48]
[3, 24, 16], [107, 24, 144]
[131, 72, 48], [7, 24, 60]
[61, 72, 36], [83, 120, 144]
[7, 60, 24], [9, 84, 28]
[7, 60, 24], [131, 48, 72]
[7, 60, 24], [103, 96, 120]
[7, 60, 24], [63, 20, 120]
[47, 140, 40], [5, 260, 208]
[13, 144, 36], [3, 80, 96]
[11, 48, 36], [39, 64, 48]
[11, 48, 36], [119, 96, 72]
[11, 48, 36], [21, 176, 132]
[11, 48, 36], [69, 208, 156]
[39, 64, 48], [119, 96, 72]
[39, 64, 48], [21, 176, 132]
[39, 64, 48], [69, 208, 156]
[119, 96, 72], [21, 176, 132]
[119, 96, 72], [69, 208, 156]
[27, 160, 60], [3, 96, 80]
[19, 12, 48], [3, 80, 96]
[61, 36, 72], [83, 144, 120]
[11, 36, 48], [39, 48, 64]
[11, 36, 48], [119, 72, 96]
[11, 36, 48], [21, 132, 176]
[11, 36, 48], [69, 156, 208]
[39, 48, 64], [119, 72, 96]
[39, 48, 64], [21, 132, 176]
[39, 48, 64], [69, 156, 208]
[119, 72, 96], [21, 132, 176]
[119, 72, 96], [69, 156, 208]
[49, 72, 72], [83, 144, 120]
[49, 72, 72], [83, 120, 144]
[103, 120, 96], [7, 24, 60]
[103, 120, 96], [3, 80, 96]
[69, 132, 88], [33, 260, 156]
[7, 24, 60], [9, 28, 84]
[115, 48, 120], [63, 20, 120]
[103, 96, 120], [3, 96, 80]
[3, 96, 80], [13, 36, 144]
[27, 16, 96], [13, 36, 144]
[69, 88, 132], [33, 156, 260]
[3, 80, 96], [27, 60, 160]
[21, 176, 132], [69, 208, 156]
[47, 40, 140], [5, 208, 260]
[21, 132, 176], [69, 156, 208]
 

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)

 

 

5 6 7 8 9 10 11 Last Page 7 of 107