Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 359 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@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.

@vv I like the simplicity of your PS, but didn't you mean 24*n+k

@Math-dashti The only thing that you need to do is change 0 to 0.0 and 9 to 9.0 in your 3 seq commands.

By the way, it's refreshing to see such neatly formatted code for a change, Vote Up

I want to add a few details to @Kitonum 's Answer (which I voted Up), because this can be a very confusing issue for new users of 2D Input.

When using 2D Input, as you were, you can get implied multiplication of juxtaposed operands by placing a space between the operands. If no space (or other multiplication operator) is used, and the right-hand operand is in parentheses, then it'll be interpreted as a function argument of left-hand operand, even if the left operand seems to be something that shouldn't take arguments, such as a constant.

On the other hand, if the left operand is supposed to be a function name, then you must not use a space. For example, the sine function applied to x must be entered as sin(x), not as sin (x).

Both of the previous 2 paragraphs apply only to 2D Input. In 1D input, there is no implied multiplication and no significance to spaces between operands.

@janhardo No, @Alfred_F was not refering to the function exp(x)! This thread has nothing to do with the exponential function. Alfred simply used e = exp(1) as an example of an irrational number. He could've chosen any irrational number and his example would have had the same meaning.

@sand15 You asked:

  • By the way: in your Maple 2025 codes you write alpha::evaln in the parameter sequence. I had always thought in this sequence N::T refered to to expected type T of name N... but evaln is not a type, so "How can  alpha::evaln be authorized?"

Usually is required to be a type, but there are 6 exceptions. These are dcoumented on the help page ?parameter,modifiers. This is not anything new to Maple 2025. Most, if not all, of these exist in Maple 2015, Surely uneval and seq are even much older than that. Here are the 6 modifiers, where the ...'s indicate that additional arguments are required:

  • uneval
  • evaln or evaln(...)
  • seq(...)
  • expects(...)
  • depends(...)
  • coerce(...or ~...

In the cases where these keywords or symbols match other Maple commands---namely evalnseqdepends, and ---, the usage within a parameter declaration is not related to the other usage. 

@Kitonum Why not use align= [above, left] instead of align= left and thus avoid the need for the artificial constant 0.06?

The header for this Question shows that you checked the Maple Flow box. How could you check it if it weren't there? It's the 2nd-to-last Product shown.

@michele If a matrix A has n columns, then they can be reversed by

A[.., -[$n]]

If it has n rows, then they can be reversed by

A[-[$n]]

@michele Pkease use the Reply button, not the Answer button, to Reply to a Comment.

How can a circle lying in the plane z=0 contain the point [5,1,4]?

@Andiguys There's no solution: If all the variables are positive, then how could the quadratic expression in X3 be nonpositive?

This is the same as my last column graph but with a logarithmic color scale for the probabilities. With this, you can see the many orders of magnitude of variation among the vast "field" of values  (in front of the "mountain") that originally just appeared to be close to 0.

p1:= 1/5:  p2:= 1/2:  p3:= 1-p1-p2:  n:= 20:
Multinom:= table([seq](seq(
    (i,j)= n!/i!/j!/(n-i-j)!*p1^i*p2^j*p3^(n-i-j), i= 0..n-j), j= 0..n)
):
E:= [evalf({entries}(Multinom, nolist))[]]:
(m,M):= [min,max](ln~(E))[]:
plots:-display(
    seq(seq(
        plottools:-cuboid(
            [i-2/5, j-2/5, 0], [i+2/5, j+2/5, (p:= Multinom[i,j])], 
            style= surface, 
            color= COLOR(HSV, 0.85*((ln(p)-m)/(M-m)), 1, 1)
        ),
        i= 0..n-j), j= 0..n
    ),
    plot3d(
        0, (i,j)=~ -1/2..n+1/2, grid= [(n+2)$2],
        style= wireframe, color= black, thickness= 0.6
    ),
    labels= ["Cat. 1", "Cat. 2", "Prob."], labelfont= [times, bold, 12],
    axis[1,2]= [tickmarks= [seq](x= `if`(x::odd,``,x), x= 0..n)],
    axes= frame, glossiness= 1, 
    projection= 0.8, orientation= [-125, 65], lightmodel= light1,
    view= [(-1/2..n+1/2)$2, default]
);

#Color legend:
plots:-display(
    seq(
        plot([[p,0],[p,1]], color= COLOR(HSV, 0.85*((ln(p)-m)/(M-m)), 1, 1)),
        p= E
    ),
    axis[1]= [mode= log], axis[2]= [tickmarks= []], size= 100*[7,2], 
    thickness= 3, title= "Logarithmic Color Scale:\n", 
    titlefont= [times, bold, 12],
    labels= [`probabilities by color\n`, ``], labelfont= [times,10]
);

@sand15 You are not using the view option that I included:

view= [min(X)-W..max(X)+W, 0.1..max(Y)]

The purpose of its component is to avoid losing a bar on the left or right. I believe that that will work in all cases. The purpose of its component is to avoid seeing any "0 height" bars between the true bars.

And how does this have any significant effect on the length of the plot structure?

Here is another way to make a column graph similar to the matrixplot from raw components. I like this better than the matrixplot because like the trianglar-base plots shown, it avoids the area i+j > n (i.e., the part outside the support of the distributuion).

p1:= 1/5:  p2:= 1/2:  p3:= 1-p1-p2:  n:= 20:
Multinom:= (i,j)-> n!/i!/j!/(n-i-j)!*p1^i*p2^j*p3^(n-i-j):
plots:-display(
    seq(seq(
        plottools:-cuboid(
            [i-2/5, j-2/5, 0], [i+2/5, j+2/5, Multinom(i,j)], 
            style= surface, transparency= 0.15
        ),
        i= 0..n-j), j= 0..n
    ),
    plot3d(
        0, (i,j)=~ -1/2..n+1/2, grid= [(n+2)$2],
        style= wireframe, color= black, thickness= 0.6
    ),
    labels= ["Cat. 1", "Cat. 2", "Prob."], labelfont= [times, bold, 12],
    axis[1,2]= [tickmarks= [seq](x= `if`(x::odd,``,x), x= 0..n)],
    axes= frame, glossiness= 1, 
    projection= .8, orientation= [-125, 65], lightmodel= light1,
    view= [(-1/2..n+1/2)$2, default]
);


 

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