acer

32303 Reputation

29 Badges

19 years, 310 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Take any odd number X greater than 1 (ie. X is 3 or higher).

Subtract 2 from it. So,

   X = 2 + (X-2)

The result, X-2, is also odd. And 2 is even.

So X = 2 + (X-2) which is the sum of an even number and an odd number.

In programming, a common easy way to generate odd numbers is to add 1 to a multiple of 2. (Similarly, a common way to generate even numbers is to take multiples of 2.) For example,

seq( 2*n, n=1..5 );

          2, 4, 6, 8, 10

seq( 2*n + 1, n=1..5 );

          3, 5, 7, 9, 11

We can use that trick to generate the following output, using the print command to show them on separate lines. (Recall, 2*n+1 is the odd number...)

seq( print( 2*n+1 =
            InertForm:-Display( 2 %+ (2*n+1-2), 'inert'=false ) ),
     n=1..5 ):

0, "%1 is not a command in the %2 package", _Hold, Typesetting

0, "%1 is not a command in the %2 package", _Hold, Typesetting

0, "%1 is not a command in the %2 package", _Hold, Typesetting

0, "%1 is not a command in the %2 package", _Hold, Typesetting

0, "%1 is not a command in the %2 package", _Hold, Typesetting

Download odd_stuff.mw

Something I have done in the past is redefine userinfo.

I once redefined it so as to redirect its output to TextArea Embedded Components. But in your case perhaps it might suffice to alter it to always act as if called from the Command-Line Interface (CLI, tty), ie. plaintext output.

I may have overlooked some corner-case(s), in which case it might require a tweak or two.

restart;

 

unprotect(userinfo):
userinfo:=proc(lev::nonnegint,
               nms::{name,set(name)})
  local ee,L,snms;
  if nms::name then snms:={nms}
  else snms:=nms; end if;
  if nargs<3 then return NULL; end if;
  L:=[args[`if`(args[3]=':-NoName',4,3)..-1]];
  if nops(L)=0 then return NULL; end if;
  if ormap(nm->assigned(infolevel[nm])
               and infolevel[nm]>lev,
           snms) then
    if args[3]<>':-NoName' then
      printf("%s",sprintf("%s: ",
                          debugopts(':-callstack')[5]));
    end if;
    printf("%s",convert(L[1],string));
    for ee in L[2..] do
      printf(" %s",convert(ee,string));
    end do;
    printf("\n");
  end if;
  NULL:
end proc:
protect(userinfo):

 

infolevel[:-dsolve]:=5:

dsolve(diff(y(x),x)=sin(x),y(x));

Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
<- quadrature successful

y(x) = -cos(x)+_C1

writeto("output_of_dsolve.txt");  #send all output to file
sol:=dsolve(diff(y(x),x)=sin(x),y(x));
close("output_of_dsolve.txt"):
writeto(terminal); #to send output back to terminal

 

Download userinfo_redef.mw

You wrote, "Is it possible to recover that _R is in fact A, that _R0 is in fact B and so on?".

But question includes the assertion that "_R is in fact A", which may not be true. If you had also executed,
   P := A;
at the top level then both P and A would be assigned with value _R. So why would _R "in fact" be A, as opposed to being P? The claim, as stated, would not be true.

Having said that, you can cobble together (dodgy) schemes to find out what assigned names might evaluated to _R.

restart:

with(Statistics):

A := RandomVariable(Uniform(0, 1));

_R

B := RandomVariable(Uniform(0, 2));

_R0

C := RandomVariable(Uniform(1, 2));

_R1

F := (A+2*B)/C;

(_R+2*_R0)/_R1

recover := proc(ee::algebraic) local S;
  S := {anames(user)};
  subsindets(ee, name,
             proc(nm) local c;
               c := select(v->eval(v)=nm,S);
               if nops(c)=0 then nm; else c[1]; end if;
            end proc);
end proc:

 

recover(F);

(A+2*B)/C

Download ooph.mw

I am not a fan of this kind of thing, which seems quite backwards to me. I think it's far more sensible to utilize lists of equations and then evaluate formulas using such equations. (Ie, don't make assignments that get in your way.) For example,

restart:

with(Statistics):

a := RandomVariable(Uniform(0, 1)):

b := RandomVariable(Uniform(0, 2)):

c := RandomVariable(Uniform(1, 2)):

F := (A+2*B)/C;

(A+2*B)/C

eval(F, [A=a, B=b, C=c]);

(_R+2*_R0)/_R1

F;

(A+2*B)/C

Download form_forwards.mw

NULL

restart

expr := (((1/2)*z+1/2)*Ts+Cf*Rz*(z-1)*Ts^2*(z+1)^2)/((4*(z-1))*((1/4)*(z+1)^2*(Lg+L)*Ts^2+(1/2)*Cf*Rf*(z-1)*(z+1)*(Lg+L)*Ts+Lg*Cf*L*(z-1)^2))

(1/4)*(((1/2)*z+1/2)*Ts+Cf*Rz*(z-1)*Ts^2*(z+1)^2)/((z-1)*((1/4)*(z+1)^2*(Lg+L)*Ts^2+(1/2)*Cf*Rf*(z-1)*(z+1)*(Lg+L)*Ts+Lg*Cf*L*(z-1)^2))

``

res := collect(numer(expr), z, simplify)/collect(denom(expr), z, simplify)

(2*Ts^2*Cf*Rz*z^3+2*Ts^2*Cf*Rz*z^2-2*(Cf*Rz*Ts-1/2)*Ts*z-2*(Cf*Rz*Ts-1/2)*Ts)/(((2*L+2*Lg)*Ts^2+4*Cf*Rf*(Lg+L)*Ts+8*Lg*Cf*L)*z^3+((2*L+2*Lg)*Ts^2-4*Cf*Rf*(Lg+L)*Ts-24*Lg*Cf*L)*z^2+((-2*L-2*Lg)*Ts^2-4*Cf*Rf*(Lg+L)*Ts+24*Lg*Cf*L)*z+(-2*L-2*Lg)*Ts^2+4*Cf*Rf*(Lg+L)*Ts-8*Lg*Cf*L)

``

Download collect_examp.mw

You wrote, "how can i complete this answer in the final form with using common factors of Ts,Cf,Rf,Lg & L." but the meaning of that is not clear. How you do want to use common factors of Ts,Cf,Rf,Lg and L, if the numerator and denominator have already been collected with repected to powers of z?

What so you mean, precisely, by "simplify the formula"?

Do you mean that you want to eliminate instances of certain terms (and if so, which, precisely)? Or do you mean that you want a reformulation with fewer mathematical operations (+,*,-, etc). Or something else?

restart;

ee := 4*x1*x2^2*x3 - 4*x1*x2*x3*x4 + 4*x1*x3*y2^2 - 4*x1*x3*y2*y4
      - 4*x2^2*x3^2 - 4*x2^2*y2^2 + 4*x2^2*y2*y4 + 4*x2*x3^2*x4
      + 4*x2*x4*y2^2 - 4*x2*x4*y2*y4 - 4*x3^2*y2^2 + 4*x3^2*y2*y4
      - 4*y2^4 + 8*y2^3*y4 - 4*y2^2*y4^2;

4*x1*x2^2*x3-4*x1*x2*x3*x4+4*x1*x3*y2^2-4*x1*x3*y2*y4-4*x2^2*x3^2-4*x2^2*y2^2+4*x2^2*y2*y4+4*x2*x3^2*x4+4*x2*x4*y2^2-4*x2*x4*y2*y4-4*x3^2*y2^2+4*x3^2*y2*y4-4*y2^4+8*y2^3*y4-4*y2^2*y4^2

s := [x1^2+y1^2=r^2, x2^2+y2^2=r^2,x3^2+y3^2=r^2,x4^2+y4^2=r^2];

[x1^2+y1^2 = r^2, x2^2+y2^2 = r^2, x3^2+y3^2 = r^2, x4^2+y4^2 = r^2]

simplify(algsubs(s[2],ee));

4*(r^2-x2*x4-y2*y4)*(-y2^2+y2*y4+x3*(x1-x3))

simplify(algsubs(s[3],algsubs(s[2],ee)));

-4*(r^2-x2*x4-y2*y4)*(r^2-x1*x3+y2^2-y2*y4-y3^2)

some_simp_examp.mw

Your attempt used x^k, so I will too.

restart;

H := x^k+x^(2*k):

degree(expand(H),x^k);

             2

There,

expand(H);

                          2
                  k   / k\ 
                 x  + \x / 

That kind of interactive layout of DrawGraph is using functionality provided by the DocumentTools:-InsertContent command to embed an interactive Plot Component into a Task Region of the worksheet.

There can only be a single Task Region for each Execution Group or Document Block. In consequence those repeated calls to InsertContent (from the same input statement) successively overwrite the same Task Region, clobbering its prior content.

This functionality restriction is shared by other commands which use InsertContent, eg,
  DocumentTools:-Tabulate
  Explore
  ImageTools:-Embed

Some such commands allow you (optionally) to force the XML content to be returned rather than embedded, in which case with a little extra effort the multiple instances of that can be stitched together and embedded together. But the DrawGraph and GraphTheory:-InteractiveLayout commands don't seem to offer that.

In the attachment below is code that modifies GraphTheory:-InteractiveLayout so that it (and DrawGraph) can optionally return (early) just the XML of the generated individual Plot Component for a single graph. That doesn't happen unless _EnvDGIReturnXML is set to true., and otherwise DrawGraph should behave as usual.

The AltDGI procedure takes a list of graphs and assembles the corresponding Plot Components into a GUI Table, which it embeds.

I used Maple 2021.2, and it's possible that matters because I'm altering some part of a stock procedure body (by position/inert-form-operand).

If this behaves like you want then let me know if you'd like a revision that handles a Matrix of graphs instead of just a list of graphs.

restart;

kernelopts(opaquemodules=false):
unprotect(GraphTheory:-InteractiveLayout:-ModuleApply):
__GTIM:=ToInert(eval(GraphTheory:-InteractiveLayout:-ModuleApply)):
GraphTheory:-InteractiveLayout:-ModuleApply:=
  FromInert(subsop([5,20]=[_Inert_IF(_Inert_CONDPAIR(
                             _Inert_EQUATION(
                               _Inert_NAME("_EnvDGIReturnXML"),
                               _Inert_NAME("true", _Inert_ATTRIBUTE(
                                 _Inert_NAME("protected",
                                             _Inert_ATTRIBUTE(
                                               _Inert_NAME("protected")))))),
                             _Inert_STATSEQ(_Inert_RETURN(_Inert_LOCAL(5))))),
                           op([5,20],__GTIM)][],__GTIM)):
protect(GraphTheory:-InteractiveLayout:-ModuleApply):
kernelopts(opaquemodules=true):

 

AltDGI:=proc(L::list, {width::posint:=400})
  local i;
  uses DocumentTools,DocumentTools:-Layout,
       DocumentTools:-Components, GraphTheory;
  _EnvDGIReturnXML:=true;
  InsertContent(
    Worksheet(
      Table(':-widthmode'=':-pixels',':-width'=width,
            ':-alignment'=':-center',
            seq(Row(Cell(DrawGraph(L[i],
                                   ':-layout'=':-interactive',
                                   _rest))),
                i=1..nops(L)))));
  return NULL;
end proc:

 

with(GraphTheory):

g:=[seq(CompleteGraph(i),i=2..6)]:

 

AltDGI(g, layoutoptions = [neutral_color = "pink", initial = spring],
       width=300);

 

 

 

 

graph_interactive_table_ac.mw

It sounds as if you might be looking for the functionality provided by subsindets (or evalindets). Those allow you to act on all subexpressions of a particular type.

Notice the similarity between commands indets and subsindets. You could see their respective help-pages.

Here are two made-up examples, since you didn't provide one explicitly. I may have guessed wrong as you your specific goals. It'd be better if you provided actual examples.

There are often several ways to target a flavour of subexpression. (I might have used divide instead of all that member action, in the latter example. The choice between them could depend on whether you want to match exactly `a`  as a multiplicand in the exponent, or `a` as a factor.)

The first example involves exp calls, and the second involves calls to `^`.

restart;

expr := Int(a*b*exp(a*c)*Int(exp(a*b*s)+exp(s+t+b),b),a);

Int(a*b*exp(a*c)*(Int(exp(a*b*s)+exp(s+t+b), b)), a)

# pick off terms like exp(someproduct)
# where someproduct is a product with `a`
# as a factor.

indets(expr, specfunc(And(`*`,satisfies(u->divide(u,a))),exp));

{exp(a*c), exp(a*b*s)}

# The same, but both `a` and `b` must be factors
# in the exponent.

indets(expr, specfunc(And(`*`,satisfies(u->divide(u,a*b))),exp));

{exp(a*b*s)}

# A similar command, but now applying `F` to the term.

subsindets(expr, specfunc(And(`*`,satisfies(u->divide(u,a*b))),exp),
           F);

Int(a*b*exp(a*c)*(Int(F(exp(a*b*s))+exp(s+t+b), b)), a)

# Now applying `G` to the exponent of the term.

subsindets(expr, specfunc(And(`*`,satisfies(u->divide(u,a*b))),exp),
           u->exp(G(op(u))));

Int(a*b*exp(a*c)*(Int(exp(G(a*b*s))+exp(s+t+b), b)), a)

# Now applying a specific substitution to the
# exponent, replacing a*b with AB.

subsindets(expr, specfunc(And(`*`,satisfies(u->divide(u,a*b))),exp),
           u->exp(algsubs(a*b=AB,op(u))));

Int(a*b*exp(a*c)*(Int(exp(s*AB)+exp(s+t+b), b)), a)

Download subsindets_example2.mw

 

restart;

expr := Int(a*b*p^(a*c)*Int(w^(a*b*s)+w^(s*t*b),b),a);

Int(a*b*p^(a*c)*(Int(w^(a*b*s)+w^(s*t*b), b)), a)

# pick off terms like w^someproduct
# where someproduct is a product with `a`
# as a multiplicand.

indets(expr, identical(w)^And(`*`,satisfies(u->member(a,[op(u)]))));

{w^(a*b*s)}

# pick off terms like anything^someproduct
# where someproduct is a product with `a`
# as a multiplicand.

indets(expr, And(`^`,satisfies(u->member(a,[op([2,..],u)]))));

{p^(a*c), w^(a*b*s)}

# The same, but both `a` and `b` must be multiplicands
# in the exponent.

indets(expr, And(`^`,satisfies(u->member(a,[op([2,..],u)])
                                  and member(b,[op([2,..],u)]))));

{w^(a*b*s)}

# A similar command, but now applying `F` to the term.

subsindets(expr, And(`^`,satisfies(u->member(a,[op([2,..],u)])
                                      and member(b,[op([2,..],u)]))),
           F);

Int(a*b*p^(a*c)*(Int(F(w^(a*b*s))+w^(s*t*b), b)), a)

# Now applying `G` to the exponent of the term.

subsindets(expr, And(`^`,satisfies(u->member(a,[op([2,..],u)])
                                      and member(b,[op([2,..],u)]))),
           u->op(1,u)^G(op(2,u)));

Int(a*b*p^(a*c)*(Int(w^G(a*b*s)+w^(s*t*b), b)), a)

# Now applying a specific substitution to the
# exponent, replacing a*b with AB.

subsindets(expr, And(`^`,satisfies(u->member(a,[op([2,..],u)])
                                      and member(b,[op([2,..],u)]))),
           u->op(1,u)^algsubs(a*b=AB,op(2,u)));

Int(a*b*p^(a*c)*(Int(w^(s*AB)+w^(s*t*b), b)), a)

# There are many ways to do that same thing,
# and sometimes there will be a simpler variant.
# In this case `algsubs` acts only on the exponents
# with a*b as a compound multiplicand.

subsindets(expr, `^`, u->op(1,u)^algsubs(a*b=AB,op(2,u)));

Int(a*b*p^(a*c)*(Int(w^(s*AB)+w^(s*t*b), b)), a)

 

Download subsindets_example.mw

The evalb command is suitable for testing that two equations have the same structure (somewhat akin to being literally the same), but it is not intended for an check of mathematical/algebraic equivalence.

Many examples that arise in practice can be checked by this more suitable test,

   is( eqn1-eqn2 = 0 );

which is slightly more robust than,

   is( eqn1 = eqn2 );

Note also that you can put assumptions on that call, eg,

   is( eqn1-eqn2 = 0 ) assumming x>0, a::real, t::real;

or what have you.

There are a few very rare instance where the extra kick from,

   is( simplify(eqn1-eqn2) = 0 );

is necessary.

Is it the case that you only want assertion-checking on some of your own procedures? If so then you might temporarily turn it off during the key Library calls in your try..catch. For example,

restart;

interface(warnlevel=4):
kernelopts('assertlevel'=2):

try
   trial_solution_constants:=[A[1]];
   eq:=-A[1]-exp(x^2)*exp(-x^2) = 0;

   old:=kernelopts('assertlevel'=0);
   solve(identity(eq,x),trial_solution_constants);
catch:
   print("error happend ",lastexception);
finally
   kernelopts('assertlevel'=old):
end try;
print(" I am here");

[A[1]]

-A[1]-exp(x^2)*exp(-x^2) = 0

2

"error happend ", unknown, "numeric exception: division by zero"

0

" I am here"

Download AL1.mw

Or perhaps it is the case that you want assertion-checking only for enforcing the local or return types of certain procedures (ie, not the ASSERT calls)? In that case perhaps you could temporarily disable just those. For example (and, you don't need to put it all inside the try..catch).

restart;

interface(warnlevel=4):
kernelopts('assertlevel'=2):

try
   unprotect('ASSERT'):ASSERT:=NULL:protect('ASSERT');
   trial_solution_constants:=[A[1]];
   eq:=-A[1]-exp(x^2)*exp(-x^2) = 0;
   solve(identity(eq,x),trial_solution_constants)
catch:
   print("error happend ",lastexception);
finally
   unprotect('ASSERT'):ASSERT:='ASSERT';protect('ASSERT');
end try;
print(" I am here");

"ASSERT := "

[A[1]]

-A[1]-exp(x^2)*exp(-x^2) = 0

"error happend ", unknown, "numeric exception: division by zero"

ASSERT

" I am here"

Download AL2.mw

If you have some more complicated scenerio or usage then you really ought to adequately describe it. Your brief statement, "But I need to use kernelopts('assertlevel'=2): in my program" doesn't explain how you need to use it.

As to why that behaviour happened, consider where the assertion-check fails in your example. It happens in line 82 of Maple 2021.2's routine, SolveTools:-Transformers:-Identity:-Apply. And if coeff(dz1,sol) is +-infinity then line 83 gets that raised exception. You write as if the former assertion-failure prevents the ensuing numeric exception is some very special way. But it only prevents it because it fails first.

showstat(((SolveTools::Transformers)::Identity)::Apply,82..83);

Apply := proc(syst::SubSystem)
local SS, news, af, repeat, sys, eqns, ineqs, vars, z, ind, inds, inds1, inds2, z1,
ineqs2, ip, z3, w, i, v, sol, nopush, r2, dz1, newsystem, savesystem, pts, 
  aeqns, beqns, t, onlylin, x, r3, di, e, subsys, recsols;
       ...
  82                   ASSERT(degree(dz1,sol) = 1);
  83                   dz1 := normal(-coeff(dz1,sol,0)/coeff(dz1,sol));
       ...
end proc

There are a few fancier variations on the following idea of temporarily substituting the target term with a dummy (using algsubs, or subs, etc, as appropriate).

restart;

Iso := proc(ee,t) local s;
       subs(s=t,isolate(algsubs(t=s,ee),s));
end proc:

 

eq:=P=A+(z+x/2/z);

P = A+z+(1/2)*x/z

Iso( eq, z+x/2/z );

z+(1/2)*x/z = P-A

Download isolate_alg.mw

The approaches in other Answers (shown so far) involve more ad hoc manipulations involving key subexpressions and their location, ie. more specific to the particular form of the given example. This makes them less general-purpose -- without problem-specific (manual) assistance.

The OP has alluded to a longer, as yet unseen, example. It would be much better to provide that up front, to alleviate hit-and-miss guessing as to technique.

I cannot tell whether you want the exact results better simplified (but still in terms of exact radicals) or as floating-point approximations.

restart;

f := 9*x^3 - 7*x^2*y + 8*x*y^2 - 6*y^3 + 3*x^2 - 3*x*y + 4*y^2 - 3*x + 9*y - 7:
fx:=diff(f,x):
fy:= diff(f,y):

ctpts:= simplify(evala([solve({fx=0,fy=0},{x,y},explicit)])):

length~(ctpts);
                    [3946, 3946, 3916, 3916]

sort(evalf(ctpts));
          [{x = -0.2777746987, y = -0.6265224303}, 

            {x = -0.1196978963, y = -0.5678259685}, {

            x = 0.04295586208 - 0.2689937611 I, 

            y = 0.9924517216 - 0.1221355627 I}, {

            x = 0.04295586208 + 0.2689937611 I, 

            y = 0.9924517216 + 0.1221355627 I}]

There is a Units:-Simple package, which rebinds several commands and allows this kind of comparison to resolve. (Most of Maple doesn't otherwise know much about units.)

restart

with(Units:-Simple)NULL``

NULL

Problem 1 ( If Statement with units)

 

The if statement could not evealuated with the logical operator < or > when a unit is attached to the value

 

tt := 80*Unit('knot'); if tt < 100*Unit('knot') then lprint(got*it) end if

got*it

NULL

Download Problem_IF_ac.mw

By the way, there is no command Restart with a capital "R". The command is restart, all lowercase.

Inside main's catch clause the callstack is no longer what it was when the original exception was thrown.

You can access the procedure name, using lastexception[1]. For example,

restart;

A := module()  
  local B:=module()
     export foo:=proc(n)
         1/n;
     end proc;
  end module;

  export main:=proc()
    try
       B:-foo(0);
    catch:
      print(sprintf("error happened in %a: %s",
            lastexception[1],
            StringTools:-FormatMessage(lastexception[2..-1])));
    end try;
  end proc;

end module:

A:-main()

"error happened in foo: numeric exception: division by zero"

Download try_loc.mw

If your procedures/modules are being accessed from a Library archive into which they were saved (and if the source exists so that line-number information can be used) then you may be able to access that source via lasterrorlocus and showsource. (See the Description of the Help page for topic error.)

For example, I have a file "foo.mpl" with the following plaintext Maple code in it:

A := module()  
  local B:=module()
     export foo:=proc(n)
         1/n;
     end proc;
  end module;
  export main:=proc()
    try
       B:-foo(0);
    catch:
      if lasterrorlocus<>'lasterrorlocus' then
         print(lasterrorlocus);
         showsource();
      end if; 
      print(sprintf("error happened in %a: %s",
            lastexception[1],
            StringTools:-FormatMessage(lastexception[2..-1])));
    end try;
  end proc;
end module:

I can then load that into a .mla Library archive file, and access the relevent souce upon catching an error. For example:

restart;

LB:=cat(currentdir(),"/nm.mla"):
read "foo.mpl";
if FileTools:-Exists(LB) then
  FileTools:-Remove(LB);
end if;
LibraryTools:-Create(LB);
LibraryTools:-Save(A,LB);

restart;

libname := libname,cat(currentdir(),"/nm.mla"):

A:-main()

["foo.mpl", 4, false]

"error happened in A:-main: numeric exception: division by zero"


--- foo.mpl -------------------------------------------------------------------
1  A := module()  
2    local B:=module()
3       export foo:=proc(n)
4!          1/n;
5       end proc;
6    end module;
7  
8    export main:=proc()
9      try

 

Download try_locb.mw

I'll note that the lastexception[1] shows as A:-main in that last example, while more usefully it shows foo in the first example. But the point of the second example is mostly about printing the source snippet with error location indicated.

If you want the result from calling komb to include indexed names then you could form then as such.

Your approach of concatenating produces names that pretty-print with subscripts but are not indexed names.

There are two kinds of name that pretty-print with subscripts:
1) indexed names like a[2,2] for which the subscripts pretty-print in upright Roman characters.
2) special names with double-underscore like say `a__2,2` for which the subscript pretty-prints in italic characters.
These two kinds of name might appear similar, except for the italic aspect and that is easy to overlook. But they are quite distinct from each other (ie. will not cancel upon subtraction).

That approach of concatenation will produce global names. If you want the result from komb to not have escaped local (indexed) names then you can pass in the base-symbol as an additional argument (instead of declaring that base-symbol as local). Below, I do this by having var be an additional parameter of the procedure komb, so that the base-symbol (eg. a) can be passed in. The effect is that the results from komb have the same kind of global name a as are in the Matrix A.

NULL

restart

komb := proc (n::integer, m::integer, var::symbol) local L, j; L := [seq(var[j, j], j = 1 .. n)]; add(mul(k), `in`(k, combinat:-choose(L, m))); return % end proc

komb(5, 5, a)

a[1, 1]*a[2, 2]*a[3, 3]*a[4, 4]*a[5, 5]

lprint(komb(5, 5, a))

a[1,1]*a[2,2]*a[3,3]*a[4,4]*a[5,5]

A := Matrix(5, 5, shape = diagonal, symbol = a)

Matrix(%id = 36893628247904552828)

abs(A)

a[1, 1]*a[2, 2]*a[3, 3]*a[4, 4]*a[5, 5]

lprint(abs(A))

a[1,1]*a[2,2]*a[3,3]*a[4,4]*a[5,5]

simplify(komb(5, 5, a)-abs(A))

0

NULL

Download indexed_ac.mw

First 72 73 74 75 76 77 78 Last Page 74 of 336