Joe Riel

9530 Reputation

23 Badges

20 years, 27 days

MaplePrimes Activity


These are answers submitted by Joe Riel

As acer says, there are many ways to do this.  Here's a simpler approach

ListTools:-Reverse(convert(12345678,base,1000));
                                              [12, 345, 678]

Hmm.  Has convert/base always failed with negative integers?

convert(-123456, base, 1000);
                                               [-456, -123]

Try

F2 := expand(F1) assuming k>4;
                       F2 := -1/2 ln(k - 4) + ln(s + 5)

invlaplace(F2,s,t);
                                                           1 - exp(-5 t)
       -1/2 ln(k - 4) Dirac(t) + invlaplace(ln(s), s, t) + -------------
                                                                 t

You need to initialize a value to zero and then increment it in the loop.

rsum := proc(L::list)
local sm, x;
   sm := 0;     # this will store the partial sums
   for x in L do
      sm := sm + 1/x;
   end do;
  return sm;
end proc:

 

The usual way to combine plots is with the plots[display] command:

with(plots):
display(pointplot(...), pointplot(...));

 

E := <M,<0,0,0,1>^%T>;

A for loop (a specialization of a do loop) is terminated with "end do".  Actually, the "do" following the "end" is not needed, and you could use the older form "od" instead of "end do".

Standard technique for a substitution cipher is to compare the relative frequencies in the message to that of the target language, English.  You can use StringTools:-CharacterFrequencies to do that.  Here I'll create a string that has the characters sorted in terms of their relative frequency (assume S is assigned the ciper):

with(StringTools):
relorder := cat(map(lhs,sort([CharacterFrequencies(S)], (a,b)->(rhs(a)>rhs(b))))[]);
                  " ABUWNMeXPrKaZSJyDC'zOL."wnlh,"

For English, not including punctuation, the expectation is "etaonisrh..."

For this short a message we don't expect a particularly good match, but, because Acer has already given us the key, we can see that the actual order of the translated characters in the plain text is

         " teahinrlosdvwpmTyc'Sgu."IJRB,"

Yes.  Do not use the separate seq call:

F3 := proc (n) local i;  ln(n)*mul(1-1/ithprime(i), i = 1 .. n) end proc:

You might be better off generating a vector of primes, copying it, then operating on it inplace:

N := 10\000:
P := Array(1..N,ithprime,'datatype=float[8]');
A := copy(P);
map['inplace'](x -> 1-1/x, A);
ln(N)*mul(x, x in A);

First, the results you are showing do not correspond to the input, so it isn't clear what your issue is. Regardless, once you introduce floats (floating-point values) into the mix, the concept of a common factor loses its meaning (more or less). You might try converting to rationals and then normalizing.  For example:
 

(23000.0*x+100.)/(23000.+1000.*y);
                               23000.0 x + 100.
                               ----------------
                               23000. + 1000. y

convert(%,rational);
                                23000 x + 100
                                --------------
                                23000 + 1000 y

normal(%);
                                   230 x + 1
                                  -----------
                                  10 (23 + y)


You might try ArrayTools[Alias].

The name `simplify\mysimplify` is equivalent to the name simplifymysimplify.  Try using a forward slash:
`simplify/mysimplify`. 

The total derivative of this vector valued function is the linear map from the tangent space of the domain to the tangent space of the codomain.  But that probably won't help you much.  The matrix of this map is given by the Jacobian matrix;  you can use VectorCalculus:-Jacobian to compute it. 

 VectorCalculus:-Jacobian([x^2 + y^2 - z^2, sin(x*y*z) + exp(x*z)],[x,y,z]);
    [2 x , 2 y , -2 z]
    [cos(x y z) y z + z exp(x z) , cos(x y z) x z ,  cos(x y z) x y + x exp(x z)]

Yes.

z := V( q1( pt1( p1, t1)) , q2( pt2( p2, t2))  ):
diff(z,t1);
                                                             / d             \
D[1](V)(q1(pt1(p1, t1)), q2(pt2(p2, t2))) D(q1)(pt1(p1, t1)) |--- pt1(p1, t1)|
                                                             \dt1            /

 

See the help page for D for an explanation of D[1].

The plots[dualaxisplot] procedure was introduced in Maple 12.

u := c*(exp(x-4*t) + exp(4*t-x))^(-2):
eq := diff(u,t) + u*diff(u,x) + diff(u,x$3) = 0:
sol := solve(eq,[c]);
simplify(sol);
             [[c = 0], [c = 48]]

First 88 89 90 91 92 93 94 Last Page 90 of 114