Kitonum

20139 Reputation

26 Badges

15 years, 287 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
T:=table([1 = NULL, 2 = NULL, 3 = NULL, 4 = NULL, 5 = NULL, 6 = NULL, 7 = 5, 9 = NULL, 8 = NULL, 11 = 4, 10 = NULL, 13 = NULL, 12 = NULL, 15 = 9, 14 = NULL, 18 = NULL, 19 = 8, 16 = 9, 17 = NULL, 22 = 9, 23 = NULL, 20 = NULL, 21 = 8, 27 = NULL, 26 = 8, 25 = 4, 24 = NULL, 31 = NULL, 30 = 9, 29 = NULL, 28 = 9, 36 = NULL, 37 = 9, 38 = 9, 39 = NULL, 32 = 5, 33 = NULL, 34 = NULL, 35 = NULL, 45 = NULL, 44 = NULL, 47 = NULL, 46 = NULL, 41 = 8, 40 = NULL, 43 = NULL, 42 = NULL, 54 = NULL, 55 = NULL, 52 = NULL, 53 = NULL, 50 = NULL, 51 = NULL, 48 = 5, 49 = 9, 60 = 8, 59 = NULL, 58 = 7, 57 = 7, 56 = NULL]):
T1:=table(select(t->rhs(t)<>NULL, op(op(T))));
op~([indices(T1)]);
restart;
irem(expand((2 + sqrt(3))^15 + (2 - sqrt(3))^15), 2017);

                                                    685


This number  (2 + sqrt(3))^15 + (2 - sqrt(3))^15  is actually an integer. If you expand the brackets (raise to the 15th power), then all the square roots will disappear.

restart;
V1:=Vector[row]([a*z+b*(x+I*y), -b*z+a*(x+I*y)]);
V2:=Vector([a*z+b*(x-I*y), -b*z+a*(x-I*y)]);
factor(evalc(V1.V2));
simplify(%, {a^2+b^2=1});

The  evalc  command allows you to operate on complex numbers, assuming all parameters (a, b, x, y, z) are real numbers. The signs of these parameters do not matter for this example.

You missed 2 parentheses  draw( [ ... ] )

restart:
S:= {"a", "b", "c", "d", "e", "f"}:
combinat:-setpartition(S, 3);

{{{"a", "b", "c"}, {"d", "e", "f"}}, {{"a", "b", "d"}, {"c", "e", "f"}}, {{"a", "b", "e"}, {"c", "d", "f"}}, {{"a", "b", "f"}, {"c", "d", "e"}}, {{"a", "c", "d"}, {"b", "e", "f"}}, {{"a", "c", "e"}, {"b", "d", "f"}}, {{"a", "c", "f"}, {"b", "d", "e"}}, {{"a", "d", "e"}, {"b", "c", "f"}}, {{"a", "d", "f"}, {"b", "c", "e"}}, {{"a", "e", "f"}, {"b", "c", "d"}}}

Specify the polynomial as a function. Here is an example:

restart;
P:=(a,b,c)->a^3-a^2*b+b*c;
P(b,a,c);

                                      

 

Use the  lightmodel  option. Compare 2 examples:

plot3d(x^2-y^2, x=-1..1, y=-1..1, lightmodel=light1);
plot3d(x^2-y^2, x=-1..1, y=-1..1, lightmodel=light2);

 

When solving equations or inequalities in the real domain, it is better to immediately include conditions on the domains of functions present in this system into the system:

restart;
  eqn:= log[2](x^2 - 6*x) = 3 + log[2](1 - x);
  ans:=solve({eqn, x^2 - 6*x>0, 1-x>0}, x);

                             

Use the  fsolve command for this.  The function  f(n) = 10^n /n!  is decreasing for  n>10 :


 

restart;
epsilon:=0.001;
f:=n->10^n /n!:
N:=fsolve(f(n)= epsilon, n=1..infinity);
plot([f(n),epsilon], n=25..N+2, 0..0.005, color=[red,blue]); # Visual check

0.1e-2

 

31.17012681

 

 

 


So should be  N>=32
 

Download ineq.mw

If you want to simplify an expression using Maple, then you must follow the Maple syntax. In Maple, function arguments must be enclosed in parentheses:

G[ti] := -(v[r]*cos(theta)*cos(phi)+v[r]*cos(theta)*sin(phi)+v[r]*sin(theta)*rho)*(-c^2+(1-A)*(v[phi]^2+v[r]^2+v[theta]^2-(v[r]*cos(theta)*cos(phi))^2-(v[r]*cos(theta)*sin(phi))^2-(v[r]*sin(theta))^2))/(A*c^3)

-(v[r]*cos(theta)*cos(phi)+v[r]*cos(theta)*sin(phi)+v[r]*sin(theta)*rho)*(-c^2+(1-A)*(v[r]^2+v[theta]^2+v[phi]^2-v[r]^2*cos(theta)^2*cos(phi)^2-v[r]^2*cos(theta)^2*sin(phi)^2-v[r]^2*sin(theta)^2))/(A*c^3)

(1)

simplify(G[ti])

v[r]*((v[phi]^2+v[theta]^2)*A+c^2-v[phi]^2-v[theta]^2)*((sin(phi)+cos(phi))*cos(theta)+sin(theta)*rho)/(A*c^3)

(2)

``

Download metriccalculaions_new.mw

NumberOfOccurrences:=proc(d::nonnegint,N::posint)
local L;
uses ListTools;
L:=convert(N,base,10);
Occurrences(d,L);
end proc:


Examples of use:

NumberOfOccurrences(3,1345013);
NumberOfOccurrences(9,1345013);

                                             2
                                             0

1. I did not understand why such a cumbersome construction using the  StringTools  package and loops. This can be made much shorter:

L:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]":
L1:=parse(L):
{seq({L1[i],L1[i+1]}, i=1..nops(L1)-1, 2)};


2.  Of course, you can iterate a function of several variables, but the dimension of the function's domain must match the dimension of the domain of this function. For example

f:=(x,y)->(x^2-y^2,x^2+y^2):
(f@@2)(x,y);

 

This can be done programmatically without using palettes in 1D input:

`&approx;`(a, b);

                                       

 

Perhaps for a beginner, the option using vectors will be more understandable:

restart;
A, B, C := <-3, 1, 2>, <-2, -1, 1>, <0, 3, -3>;
alpha:=[2,-1,1];
G:=(A*alpha[1]+B*alpha[2]+C*alpha[3])/add(alpha);

 

I don't see any equation in your question ( p  is a procedure not an equation). If by equation you mean  p(v)=0  (finding the zeros of  ) , then simply multiply both sides of the equation  p(v)=0  by a common denominator:

restart;
p:=v->R*T/(v-b)-a/v^2;
Eq:=p(v)=0;
Eq1:=expand(simplify(Eq*(v-b)*v^2));

                                 

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