## 12490 Reputation

8 years, 204 days

## CartesianProduct...

```C:=Iterator:-CartesianProduct([p,q]\$3):
[seq]([seq(v[])], v = C);
```

[[p, p, p], [q, p, p], [q, q, p], [p, q, p], [p, q, q], [q, q, q], [q, p, q], [p, p, q]]

## plot extra elements...

You could plot some extra elements.

 > restart;
 > f := (x,y) -> piecewise(x=0, 0, x <> 0, x*y^2/(x^2+y^4)):
 > Digits:=15:
 > p1:=plot3d(f,-1..1,-1..1, numpoints=10000, color=green):
 > f(y^2,y): # 1/2
 > p2:=plots:-tubeplot([y^2,y,1/2], y=-1..1,radius=0.01, color=red, style=surface):
 > r:=0.02: p3:=plots:-tubeplot([r*cos(t), r*sin(t), f(r*cos(t), r*sin(t))],     t=0..2*Pi, radius=0.01, color=blue,lightmodel=none, numpoints=4000,style=surface):
 > plots:-display(p1, p2, p3);
 >

## Contagion...

In general, when you need approximations, use evalf  because the floating-point "contagion" does not apply to non-numeric constants.

 > f:=x -> sqrt(2) + 1.5 + ln(x);
 (1)
 > f(4)
 (2)
 > f(2.)
 (3)
 > evalf(f(2));
 (4)

## Both are correct...

Both solutions are correct.

 > restart;
 > ode:=x*diff(y(x),x\$2)-3*diff(y(x),x)+x*y(x);
 (1)
 > Order:=16; rhs( dsolve(ode,y(x),'series') ); maple:=convert(%, polynom);
 (2)
 > simplify(eval(ode, y(x)=maple)); # Check OK
 (3)
 > # Now the solution obtained with MMA, also for Order=16:
 > mma:=(x^4 - x^6/12 + x^8/384 - x^10/23040 + x^12/2211840 - x^14/309657600 + x^16/59454259200 - x^18/14982473318400)* C2 + C1*((1040449536000 + 260112384000*x^2 + 16257024000*x^4 - 4967424000*x^6 + 218736000*x^8 - 4398240*x^10 + 51940*x^12 - 407*x^14)/     1040449536000 + (x^4*(-309657600 + 25804800*x^2 - 806400*x^4 + 13440*x^6 - 140*x^8 + x^10)*ln(x))/4954521600);
 (4)
 > simplify( eval(ode, y(x)=mma) ); # Check OK
 (5)

## arctrig(cotrig())...

Probably because f-1(f(x)) is mathematically simpler than g-1(f(x)). This is used for all trig/arctrig pairs.
(Of course, here, f-1 is the inverse only for a subdomain).

 > restart;
 > poly := x^6 - 3*x + 3
 (1)
 > firstroot := [solve](poly, x)[1];
 (2)
 > alias(alpha=firstroot);
 (3)
 > G := GroupTheory:-GaloisGroup(poly, x);
 (4)
 > GroupOrder(G);
 (5)
 > quo(poly,x-alpha,x);
 (6)
 > S:=simplify([solve(%)]):
 > alpha[0]=alpha; for i to 5 do print(alpha[i]=S[i]) od:
 (7)

## Solution...

The answer is x_1 = ... = x_n = 1/n  (n=2014) [actually easy to guess].
The problem is designed for a math competition, not for a CAS, but here is a solution.

The function f : [-1,1] -> R, f(x) = (1+x)^(1/2) is continuous, strictly increasing and strictly concave (f''(x)<0 for |x|<1).
For x_1, ..., x_n in [-1,1], Jensen's inequality implies
f(x_1) + ...+ f(x_n) <= n f((x_1 + ... +x_n)/n).
Denoting x* = (x_1 + ... +x_n)/n, from the 1st equation it results
f(1/n) <= f(x*).

Using the 2nd equation:
f(-1/n) <= f(-x*).

f being strictly increasing, 1/n <= x*, -1/n <= -x*, so, x*=1/n.
It results from the first equation that we have "=" in Jensen's inequqlity.
f being strictly concave, we must have x_1 = ...= x_n = 1/n.
Q.E.D.

## hypergeom...

Hypergeometric0F1Regularized[a, z]  corresponds to  hypergeom([], [a], z) / GAMMA(a)  in Maple.

But your ^(1,0)  is nonsense.

## Digits...

To work correctly, MatrixPower needs a much higher precision, e.g. take Digits=40 in your example.

BTW, a matrix C has a square root if det(C) <>0.  <0,1; 0,0> has not a square root.

## Logical equivalence...

The equivalence is logical equivalence indeed. For the simple expression q := (x[1] &or x[2]) &and x[3],  the only nonidentical permutation is f defined by f(x1)=x2, f(x2)=x1, f(x3)=x3 [so, f(not x1) = not x2 etc].

As the help file (and  Christian Wolinski) says, the expression must be in CNF form. It is strange that Normalize (recommended in the help) does not work and we must use Canonicalize:

```with(Logic);
q := (x[1] &or x[2]) &and x[3];
qn := Normalize(q, form=CNF);                       # wrong!
qn := Canonicalize(q, {x[1],x[2],x[3]}, form=CNF);  # ok
G, L := SymmetryGroup(qn, output = [group, expressions]);
#g1, g2 := Generators(G)[];
GroupOrder(G);  # 2,  ok```

## O...

Here `O` is simply a local variable lost from some procedure and landed at top level, due to a bug.

## Invariance of domain...

According to a well known theorem, the Invariance of domain, an interval such as (380,780) cannot be homeomorphic to  (0,1)^3, so, a correspondence between WaveLength and (r,g,b) will be always problematic.

## eliminate...

 > Pn := [ (5*X + 12*Y)*(-384 + 48*X + 55*Y)/(225*X^2 + 225*Y^2 - 1800*X - 602*Y),          2*(12*X - 5*Y)*(-384 + 48*X + 55*Y)/(225*X^2 + 225*Y^2 - 1800*X - 602*Y)]:
 > (x,y) =~ Pn[]
 (1)
 > eliminate( {%, Y= 2+3*X}, {X,Y})
 (2)
 > conic:=%[-1][];
 (3)
 > plots:-implicitplot(conic, x=-30..30,y=-30..30);
 >

## By hand...

 > B:=<0,-2,1;-1,0,0;-2,0,0>; A:=B+1;
 (1)
 > # By hand:
 > B^2,B^3
 (2)
 > 1 + n*B + binomial(n,2)*B^2:  'A'^n = expand~(%)
 (3)
 > # By Maple:
 > LinearAlgebra:-MatrixPower(A, n);
 (4)

 > S:=Sum(Sum( a^2*b^2/sinh(Pi*(a+b))*(-1)^(a+b),  a=1..infinity), b=1..infinity); # The double series converges very fast!
 (1)
 > evalf[30](S);
 (2)
 > S=identify(%);
 (3)
 > # The equality holds but the proof is to be found!

 3 4 5 6 7 8 9 Last Page 5 of 111
﻿