Carl Love

Carl Love

28115 Reputation

25 Badges

13 years, 157 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Alfred_F In the 1D input that Christian used, the spaces surrounding the catenation operator || do not make any difference. But these spaces cause confusion in your 2D-Input. So, change c || i to c||i in both instances.

@C_R You wrote: "I do not see a difference."

The difference that I see immediately is the spacing between letters. Note especially the excessive space after T and M in "This Maple...." There is also excessive space after lowercase w.

@Alfred_F You wrote:

  • I am currently interested in how polynomials map given paths in the complex plane to this plane.

This is quite easy to plot for any given polynomial p and complex path P. Here I show the image of the unit circle under the polynomial from the original question.

p:= z-> z^4 - 12*z - 12:
P:= exp(I*t):  R:= t= -Pi..Pi:
plot(
    [(Re,Im)(p(P)), R], 
    scaling= constrained, labels= [Re,Im], labelfont= [times,bold,14]
);

@C_R A list(list) is a list all of whose members are lists; it's literally a list of only lists. Your list has members `^` and 2, which are not lists.

@C_R In addition to its own help page ?`?[]` (as mentioned by @acer), there is decent documentation of `?[]` and similar overloadable builtin operators like `?()` at ?use. This is a bit counterintuitive since these operators can be used (and usually are used) without a use statement. See the last bullet point in the Semantics section of the help page. The library command index provides functionality similar to the builtin `?[]` but it is far more user friendly. However, if you want to overload the semantics of indexing (including indexed expressions on the left side of the assignment operator :=) then you need to use `?[]`. Likewise, the library command apply is far more user friendly than the builtin `?()`.

Something not clearly stated at ?use (it's only vaguely mentioned) is that the prefix form of a prefix elementwise operator usage such as f~(A,B) is `~`[f](A,B), and that of an infix usage such as A +~ B is `~`[`+`](A,B). Like almost all operators in Maple, these prefix forms of `~` are overloadable.

Also, you've used the type name listlist incorrectly in the title of this Question. A listlist is a type more specific than a list of lists (this latter type is formally list(list)). To be a listlist, the member lists must all have the same number of elements. Formally, type listlist is semantically equivalent to And(list(list), 1 &under (nops@nops~@{op})).

Please post your example. You can attach a worksheet by using the green uparrow on the toolbar of the MaplePrimes editor.

In defense of my contribution to this thread, I'd like to point out that I didn't say a single word about mixtures of random variables, nor did I claim to.

If you define via 

assume(w >= 0, w <= 1);
Z:= sqrt(w)*X + sqrt(1-w)*Y;

then you'll have Var(Z) = w*a^2 + (1-w)*b^2.

There were 3 other minor errors in your original code that I corrected without mention in my Answer above. Now I have time to explain them. All 3 were in your use of the parameters option to Explore:

  1. The option's keyword is spelled parameters, not parameter, even if there is only a single parameter.
  2. The option's value is a list (enclosed in [...]); you had a set (enclosed in {...}).
  3. If you want the parameter to range over floating-point values rather than strictly integers, then you should include decimal points in the range endpoints; hence, 0.0..1.0 rather than your 0..1. (The trailing 0s are only for reading clarity, but at least one of the two decimal points is required.)

@Carl Love Okay, I just realized that since this is a recursion error, it's unrecoverable, which is a bad thing, especially for the way that you use Maple (large batch processing). So, I revise my opinion: Your input should produce an error, but it should be a recoverable error. The mechanism that causes `evalf/RealRange` to go into an infinite recursion loop should definitely be considered a bug.

Also, vote up for finding this bug.

@nznz1987 Don't copy & paste the code. The worksheet attached to my 2nd Reply above--"Maple 2019 update and new Fisher's problem"--provides the code in a Code Edit Region. Download and open that worksheet. The code can be loaded by placing your cursor inside the Code Edit Region (the box with plaintext multi-colored code) and pressing Enter. This will not cause any visible result other than your cursor now being below the box.

Let me know (here) if you experience any further trouble. It's usually best to attach a worksheet showing errors or incorrect results.

@acer If a module named has ModuleApply as its only member (local or export), then what's the point of making it a module rather than just assigning to the exact same procedure as was assigned to ModuleApply?

What does it mean for a mathematical function to "terminate"?

@Alfred_F You wrote:

  • It's especially unusual for me to learn that commands with assigned variables can themselves be used as variables in "outer" commands 

That is an idiosyncratic feature of Maple (and perhaps some other languages) called "last name evaluation". See help page ?last_name_eval. It allows a name (such as exp) to both have an assigned value and to be used as "just" an unassigned name (such as being used as a keyword in @acer 's command). Last name evaluation is used when the assigned value is a procedure, module, or table. In this case, exp is a procedure.

@acer @nm

Votes up for Question and Answer,

Geez. Nearly all practical usage instances of type name should be changed to And(name, Not(constant)). Since that's a bit lengthy, a stock type should be made for it, perhaps NCname.

By using the LibraryTools package, it only takes seconds to flag all occurences of any symbol (such as 'name') in the main stock Maple library.

1 2 3 4 5 6 7 Last Page 1 of 710