Kitonum

21440 Reputation

26 Badges

17 years, 34 days

MaplePrimes Activity


These are answers submitted by Kitonum

In older versions there are 2 ways. You can convert all constants to symbols 

`2`+`3`;

or use double quotes

``(2)+``(3) ;

In general case it is impossible. For a given matrix  C  there are infinitely many matrices A and B, such that C = AB . For example  C=I.C=(I/2).(2C)  and so on (here  I  is identity matrix). 

When all matrices have a size  2 times 2 and the matrix  C  is known, then to find the matrices and  B, such that C = AB, we must solve a nonlinear system of 4 equations with 8 unknowns. In general case, the set of solutions of the system is 4-dimensional manifold in the 8-dimensional space.

In one line:

map(t->t^2, [0,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]);

 

Of course, your problem is easily solved in the usual brute force method:

N:=0:

for n from 1 to 2013 do

if (irem(n, 3)=0 and irem(n+1, 4)=0) or (irem(n, 4)=0 and irem(n+1, 3)=0) then N:=N+1 fi;

od:

N;

                                                                     336

 

More interesting to get the number of such pairs in any  RealRange(a, b) .

Here is the formula solving this problem:

restart;

N:=(a,b)->floor((b-4)/12)+floor((b-9)/12)-ceil((a-3)/12)-ceil((a-8)/12)+2;

 

Examples:

N(1,2014),  N(1, 1000000),  N(1000, 10000);

                              336, 166667, 1500

 

LargestPrime:=proc(n::posint)

if n=1 then error "n should be greater than 1" fi;

ifactors(n);

op([-1,-1,1], %);

end proc:

 

Examples:

map(LargestPrime, [2, 33, 81, 50]); 

                     [2, 11, 3, 5]

You forgot to put the assumption that all the unknowns are real numbers. System is not very complicated and can be solved by  solve  command:

restart;

R1 := Matrix([[1, 0], [0, 1]]):

R2 := Matrix([[1/2, (1/2)*sqrt(3)], [-(1/2)*sqrt(3), 1/2]]):

R3 := Matrix([[-1/2, (1/2)*sqrt(3)], [-(1/2)*sqrt(3), -1/2]]):

R4 := Matrix([[-1, 0], [0, -1]]):

R5 := Matrix([[-1/2, -(1/2)*sqrt(3)], [(1/2)*sqrt(3), -1/2]]):

d1 := Vector([0, 5.4]):

d2 := Vector([6.4, 4.539]):

d3 := Vector([11, 4.078]):

d4 := Vector([15.5, 2.079]):

d5 := Vector([19, 1.039]):

a := Vector([ax, ay]):

A1 := R1.a+d1:

A2 := R2.a+d2:

A3 := R3.a+d3:

A4 := R4.a+d4:

A5 := R5.a+d5:

OO := Vector([Ox, Oy]):

assume(ax::realcons, ay::realcons, Ox::realcons, Oy::realcons):

DA1 := A2.A2-A1.A1-2*(A2-A1).OO:

DA2 := A3.A3-A1.A1-2*(A3-A1).OO:

DA3 := A4.A4-A1.A1-2*(A4-A1).OO:

DA4 := A5.A5-A1.A1-2*(A5-A1).OO:

sys := simplify({DA1, DA2, DA3, DA4});

RealDomain[solve](%);

If the procedure is defined using the if-condition, then  the plotting without quotes causes premature calculation.

Compare:

filter(x);

                Error, (in filter) cannot determine if this expression is true or false: x < 10

You can do without the quotes in 3 ways:

1) Using  `if` command:

filter:=x->`if`(x<10, 1-x/10, 0);
plot(filter(x), x=0..20); 

 

2) Using  piecewise  command:

filter:=x->piecewise(x<10, 1-x/10, 0);
plot(filter(x), x=0..20);

 

3) Plotting without  :

filter:=x->if x<10 then 1-x/10 else 0 fi;
plot(filter, 0..20);

 

 

Multiply both sides of the inequality by x + 1, considering the 2 cases:

solve({x+1<a, x+1>0}, x);

solve({x+1>a, x+1<0}, x);

 

 

So the answer is: 1) If  a < 0  then  a - 1 < x < -1 ;

                           2) If  a = 0  then  no solutions;

                           3) If  a > 0  then  -1 < x < a - 1 ;

 

Addition.  The same solutions we can get directly:

solve(a/(x+1) > 1, [a, x]);

           [[a < 0, x < -1, a-1 < x], [0 < a, x < a-1, -1 < x]]

A := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = -1, (2, 2) = 2});

B := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 0, (2, 1) = -2, (2, 2) = 3});

C := Matrix(2);

M:=4:

P:=Matrix([seq([C$k,A,B$M-1-k],k=0..M-1)]);

 

 

L := [sin(x), sin(x)-x+x^2, cos(x)-sin(x)]:

X := [seq(-Pi+(1/16)*Pi*k, k = 1 .. 31)]:

Y := map2(eval, L, map(t->x = t, X)):

P := [seq(zip(`[]`, X, [seq(Y[i, j], i = 1 .. 31)]), j = 1 .. 3)]:

A := plot(L, x = -Pi .. Pi, color = [red, blue, green], legend = L):

B := plot(P, x = -Pi .. Pi, color = [red, blue, green], style = point, symbol = solidcircle, symbolsize = 10):

plots[display](A, B, view = [-Pi .. Pi, -2 .. 4], scaling = constrained);

 

 

First you have to specify the values of the constants  _C1  and  _C2 .

Example:

y(t) = _C1*exp(-1.*t)*sin(.57736*t)+_C2*exp(-1.*t)*cos(.57736*t):

assign(%);

_C1, _C2 := 2, 1:

plot(y(t), t=Pi..2*Pi);

Equality of matrices and arrays is tested by the command  LinearAlgebra[Equal] :

c := Array([1, 2, 3]):

d := Array([1, 2, 3]):

LinearAlgebra[Equal](c, d);

                true

Such elements may be multiple.

Example:

L:=[1.2, 0.25, 5.6, 7.2, 0.5, -0.25, -4, 6]:

L1:=map(abs, L);

a:=min(L1);

ListTools[SearchAll](a, L1);

 

 

If  M  is the number of the rows, the last number in the first column   -1/(2*M*(M-2)  is not in accord with the first numbers in the odd-numbered rows. So I think that the number   in the denominator is superfluous. If this 2 removed, then we obtain the solution:

S:=proc(k::{symbol,realcons}, N::{odd,positive})

``(sqrt(2)/2^k)*``(Matrix(N, {seq((m,1)=`if`(m::even,0,-1/m/(m-2)), m=1..N)}));

end proc:

 

Example:

S(k, 7);

 

 

With Maple it will be  shorter to use  maximize  command:

restart:

h:= r-> 2*sqrt(100-r^2):

V:= r-> Pi*r^2*h(r):

maximize(V(r), r=0..10, location);

assign(op(%[2])[1]);

radius=r, height=h(r); 

 

 

First 227 228 229 230 231 232 233 Last Page 229 of 289