vv

12453 Reputation

19 Badges

9 years, 285 days

MaplePrimes Activity


These are replies submitted by vv

@nm 

Yes, I know that Mathematica knows better than the user what the user wants. But you must admit that a rule is necessary in order to choose correctly. I hope that the rule is other than "accept what mma does".

It don't see a simple and general solution here. Your line cannot be parsed in Maple due to embedded double quotes (without "\").
There is an inherent ambiguity, without "rules". For example, the line:

1,2,3,"x+y, algorithm=[",123,"]","OK",5

can be interpreted as having 6 or 8 fields.

For a solution (assuming the rules are made clear)  a dedicated parser must be programmed. Or, regular expressions.

If the user has an international keyboard, the foreign characters are obtained without problem (they use the UTF-8 encoding)  for symbols and strings.

In Windows, an easy way to obtain the missing characters is using Windows'  charmap.exe

But at least for Maple<2020, StringTools does not support non-Ascii.

 

The complex roots are the roots of the polynomyal in lambda

P:=(lambda,t) -> 1+1/3*lambda+1/18*lambda^2-1/324*lambda^3+1/1944*lambda^4 - exp(I*t)

for t in [0,2*Pi)
A sequence of 40 random roots are obtained with:

r:=rand(0..2.*Pi):
seq(fsolve(P(lambda,r()),complex), 1..10);

 

@Carl Love

Carl, it's not only about 1/4 versus 1/2 line. But I think that a beginner will be intimidated by the "1/2" - one.

I definitely like your coding style, but when the question comes from a beginner, an "elementary" version should be added (a fortiori if it's 1/4).

@Carl Love 

Isn't this overkill? Why not simply

`&||` := (x,y) -> 1/(1/x+1/y);

if we use it only as operator (not as function `&||`(a,b,...)).

@Carl Love 

M:= f(output((J:= Iterator:-Combination(6,4))), 0, [2,2]):
(in J do M+~1 od);

f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1, f(Vector[row](4, [0, 1, 2, 3]), 0, [2, 2]) + 1

@Carl Love 

Do you mean that in your code Alias is invoked only once? It creates a 2x2 Matrix.

(Actually I am a little afraid of what Alias does and try to avoid it).

@Carl Love 

That's interesting, but I find the resulting code unintuitive.
Probably most users would prefer:

J:=Iterator:-Combination(6,4):
seq(ArrayTools:-Alias(x[]+~1, [2,2]), x in J);

 

@emendes 

The denominator of R[n] is  4*2^(2^n).

Actually, using rsolve ==>  R[n] = -1/2*cos(arccos(3/4)*2^n)+1/2

Using this, R can of course be formed even for n >> 1000.

 

 

 

@JanBSDenmark 

If you want an explanation. In mathematics sqrt and arcsinh are multivalued functions (defined on C).
All CASes have problems in choosing the wanted branches for such functions.
E.g. with your notation, sol[2] is a solution for another branch:  - x*sqrt(4*x^2 + 1) + arcsinh(2*x) - 5 = 0.

@David Sycamore 

P calls PP (from my first answer), so, PP must be present and executed in order to use P.

Just execute (use the (!!!) icon) the attached:

PP.mw

 

@David Sycamore 

You do not have the procudure PP in the worksheet (and executed, of course).

@David Sycamore 

The procedure PP can be easily used for any such questions:

PPrime:=proc(p::prime,n::posint)  
evalb(nops([PP(n,p,[p],1)])=1)
end:

P := proc(n)
local p, P:=select(isprime, [seq(1..n)]);
select(PPrime, P, n)
end:

P(50)
     [2, 3, 5, 7, 11, 13, 19]

@David Sycamore 

Just replace

Sol[++nSol] := XXX

with

nSol:=nSol+1; Sol[nSol] := XXX

(in 2 places)

First 39 40 41 42 43 44 45 Last Page 41 of 166