Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

20 years, 307 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are answers submitted by Alec Mihailovs

ParametricPlot3D in Mathematica gives the plot rather close to the picture in the gallery linked in the original post.

Using the formulas from Robert Israel's post above,

z = r Exp[I t]; 
a = 1/(z^3 - z^(-3) + Sqrt[5]); 
V = {I (z^2 - z^(-2)), z^2 + z^(-2), 2 I/3 (z^3 + z^(-3))}; 
M = ComplexExpand[Re[a V]] + {0, 0, 1/2} ;
B = M/Norm[M]^2;
ParametricPlot3D[B, {r, 0.002, 1}, {t, 0, 2 Pi}, MaxRecursion -> 5, 
 BoxRatios -> {1, 1, 1}, Axes -> False, Boxed -> False, 
 ViewPoint -> Top]

135_boy.png

Alec

The number of elements of the cartesian product of sets is the product of the numbers of elements of the given sets,

14^4;

                                38416

Another way of calculating it is

st:=time():
ArrayNumElems(Array((1..14)$4));

                                38416

time()-st;

                                  0.

By the way, here is another way of doing that with listing the elements of the cartesian product (which, in general, is not necessary for that problem),

intp:=indices@Array:
sp:=time():
A:=[intp((1..14)$4)]:
nops(A);

                                38416

time()-sp;

                                0.031

Alec

No, the Application Data is usually just a simlink to Roaming, so it should already be there - no deleting or moving should be necessary.

It is in English Vista versions though. It may work differently in German.

Alec

It should be also accessible in C:\Users\<username>\AppData\Roaming

Alec

op([1,1,2,1],Initailfiber);

                             0.3956067185

or

eval(Re(x),Initailfiber[1]);

                             0.3956067185

Alec

The largest discrepancy is not in the element (2,2) - it is in the element (2,1), which is not equal to the element (1,2) in Matlab, making that matrix not symmetric. If the matrix should be symmetric, that would mean that the error is in Matlab calculations. Correcting it might give the eigenvalues close to those that Maple gives.

Alec

See sequence A003313 in the OEIS. In particular, it contains a link to my simple Python script.

The data for n≤231 is available at that link.

For the RSA encryption and decryption using addition chains may be not such a good idea (unless such a chain is known, and it is significantly shorter), because the usual powering methods, such as the binary one, for instance, are not necessarily optimal, but the difference is rather small - only one or 2 multiplications, or squaring. And keeping in mind that a squaring can be made much faster than a multiplication, the binary powering can be faster even in cases when it uses a longer addition chain.

Alec Mihailovs

Normally (in math, not in Maple), the minors are the coefficients of the k-th exterior (wedge) power of the matrix (considered as a linear transformation). Something like that, probably, could be done using current (very confusing) tensor packages, but I wouldn't go that way (in the current Maple state). I would go along the Robert Israel's suggestion above.

Alec

Well, I'm still awaiting an offer for the CEO and/or president position from the new owner.

Alec

If the boundaries are given as integer ranges min..max, the procedure can be written using Array indexing,

intp:=()->seq(i,i=Array(args,`[]`));

For example,

intp(-2..3,7..8);

  [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [-2, 8], [-1, 8],

        [0, 8], [1, 8], [2, 8], [3, 8]

intp((0..1)$4);

        [0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 0, 0], [1, 1, 0, 0],

        [0, 0, 1, 0], [1, 0, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0],

        [0, 0, 0, 1], [1, 0, 0, 1], [0, 1, 0, 1], [1, 1, 0, 1],

        [0, 0, 1, 1], [1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]

Alec

Another procedure can be constructed using sprintf and sscanf,

sparse:=proc(A)
    local r,m,n;
    r:=rtable_dims(A)[1];
    m:=rtable_scanblock(A,[r,1],'Maximum');
    n:=rtable_scanblock(A,[r,2],'Maximum');
    sscanf(
        sprintf("%{}a",A),
        sprintf("%%{%d,%d;e(%d)}am",m,n,op(2,r))
    )[]
end:

In the given example it works as

sparse(A);
                          [b    0    a    d]
                          [                ]
                          [0    0    0    0]
                          [                ]
                          [0    0    c    a]

Alec

The code is still not reproducible. If you post that much, why not to post something that would run in Maple after copying and pasting.

Alec

Use Classic Maple (or command line) for copying.

Before pasting it here, click Source (at the top left hand side in the editor), and type <pre>, then after pasting them, type </pre>.

Change all < to &lt; and all > to &gt;

If you use & in your code, change it to &amp;

Alec

I did some modifications,

isom := proc (A, B) 
    local C, c, e, i, j, k, l, n, p, r, s;
    uses ArrayTools, LinearAlgebra, Typesetting; 
    n := Size(A, 1); 
    if Size(B, 1) <> n then return 
        mtext("These two algebras have different dimensions.") fi; 
    C := Matrix(n, symbol = c); 
    s := remove(attributes, map(x -> setattribute(x, Determinant(x) = 0), 
        map2(eval, C, [solve({seq(seq(seq(add(A[i, j, k]*c[l, k], k = 1 .. n) = 
            add(add(c[p, i]*c[r, j]*B[p, r, l], r = 1 .. n), p = 1 .. n), 
            i = 1 .. n), j = 1 .. n), l = 1 .. n)}, 
            {seq(e, e in C)}, Explicit)]))); 
    if s <> [] then map(x -> mrow(Typeset(x), mtext("  with determinant "), 
        Typeset~(lhs(attributes(x)))), s)[] 
    else mtext("These two algebras are not isomorphic.") fi 
end:

It works as follows,

A16 := Array(1 .. 5, 1 .. 5, 1 .. 5, 
    {(1, 1, 1) = 1, (2, 2, 2) = 1, (2, 3, 3) = 1, (3, 1, 3) = 1, (4, 4, 4) = 1, 
    (4, 5, 5) = 1, (5, 1, 5) = 1}, datatype = integer[4], storage = sparse): 
A17 := Array(1 .. 5, 1 .. 5, 1 .. 5, 
    {(1, 1, 1) = 1, (1, 3, 3) = 1, (1, 5, 5) = 1, (2, 2, 2) = 1, (3, 2, 3) = 1, 
    (4, 4, 4) = 1, (5, 4, 5) = 1}, datatype = integer[4], storage = sparse):
isom(A16, A16);

[   1         0        0        0        0   ]                                
[                                            ]                                
[   0         0        0        1        0   ]                                
[                                            ]                                
[-c[3, 4]     0        0     c[3, 4]  c[3, 5]]  with determinant c[5, 3] c[3, 5],
[                                            ]                                
[   0         1        0        0        0   ]                                
[                                            ]                                
[-c[5, 2]  c[5, 2]  c[5, 3]     0        0   ]                                

[   1         0        0        0        0   ]                   
[                                            ]                   
[   0         1        0        0        0   ]                   
[                                            ]                   
[-c[3, 2]  c[3, 2]  c[3, 3]     0        0   ]  with determinant c[3, 3] c[5, 5]
[                                            ]                   
[   0         0        0        1        0   ]                   
[                                            ]                   
[-c[5, 4]     0        0     c[5, 4]  c[5, 5]]                   

isom(A16, A17);

                   These two algebras are not isomorphic.

A1 := Array(1 .. 2, 1 .. 2, 1 .. 2, 
    {(1, 1, 1) = 1, (1, 2, 2) = 1, (2, 1, 2) = 1, (2, 2, 1) = -1}, 
    datatype = integer[4], storage = sparse):
isom(A1, A1);

      [1  0]                      [1   0]                             
      [    ]  with determinant 1, [     ]  with determinant -1
      [0  1]                      [0  -1]

A2 := Array(1 .. 2, 1 .. 2, 1 .. 2, 
    {(1, 1, 1) = 1, (1, 2, 2) = 1, (2, 1, 2) = 1, (2, 2, 1) = a, (2, 2, 2) = b}):
isom(A2, A1);

    [          1          ]                                    
    [1         - b        ]                                    
    [          2          ]                                2  
    [                     ]                   sqrt(-4 a - b ) 
    [                (1/2)]  with determinant ---------------, 
    [   1 /        2\     ]                          2         
    [0  - \-4 a - b /     ]                                    
    [   2                 ]                                    


    [          1            ]                                    
    [1         - b          ]                                    
    [          2            ]                                  2  
    [                       ]                     sqrt(-4 a - b ) 
    [                  (1/2)]  with determinant - ---------------, 
    [     1 /        2\     ]                            2         
    [0  - - \-4 a - b /     ]                                    
    [     2                 ]                               
                             

It may be slow because the equations are quadratic and there are a lot of them. Perhaps, there is a better approach. I haven't done much of testing - perhaps, Determinant(x) should be replaced with simplify(Determinant(x)).

Alec

I'm not sure that I understand the question,

A := Matrix(1000, `+`);

                         [ 1000 x 1000 Matrix   ]
                    A := [ Data Type: anything  ]
                         [ Storage: rectangular ]
                         [ Order: Fortran_order ]

LinearAlgebra:-Dimensions(A);

                              1000, 1000

MatrixOptions(A);

  shape = [], datatype = anything, storage = rectangular,

        order = Fortran_order

Alec

First 26 27 28 29 30 31 32 Last Page 28 of 76