Carl Love

## 25324 Reputation

10 years, 240 days
Himself
Natick, Massachusetts, United States
My name was formerly Carl Devore.

## None are correct...

None of the choices are correct, but the 2nd one is correct to 8 digits.

-0.4370224799

## sort, seq...

Like this:

sort([seq](cos(k*0.1), k= 1..100))[65];

## combinat:-binomial = binomial...

It all seems consistent to me. Without using any quotes combinat:-binomial evaluates to top-level binomial. There's no need to ever use a module prefix for binomial, but for some reason (perhaps backwards compatibility) the package has been adjusted so that one can include the module prefix without it being an error. That adjustment could be made as simply as including the line

export binomial:= :-binomial;

in the module.

And there's no practical reason to use quotes for the first argument to indets, although the quotes do allow you to create the weird examples that you think are "inconsistencies".

## plots:-implicitplot...

If you have assigned numeric values to all the Fij coefficients and TWeq is the equation that you showed, then do

plots:-implicitplot(TWeq, x= -2..2, y= -2..2)

The -2..2 will likely need to be adjusted. If you don't get a clear plot, the command has a great number of options that can be adjusted. See help page ?implicitplot, and if you can't figure it out, ask here again with specific Fij values.

## RandomBipartiteTournament...

Here is the procedure RandomBipartiteTournament:

```RandomBipartiteTournament:= proc(n::posint, m::posint)
local i, j, r:= rand(0..1);
GraphTheory:-Graph({seq}(seq(`if`(r()=0, [i,j], [j,i]), i= 1..n), j= n+1..n+m))
end proc
:
G:= RandomBipartiteTournament(4,4);
G := Graph 6: a directed unweighted graph with 8 vertices and 16 arc(s)

GraphTheory:-DrawGraph(G);
```

Maple considers a graph like this to be "unweighted", so you should use AdjacencyMatrix rather than WeightMatrix.

I assume that GenerateBipartiteTournaments is a procedure that you wrote. The output that you show indicates that that procedure was not found. (Note a procedure not being found is not explicitly an error.) To diagnose further, I'd need to see where you think you defined that procedure.

Your problem with WeightMatrix is that you spelled it lowercased, weightmatrix. However, correcting that won't do any good until the first-paragraph problem is solved. At this point, G is not recognized as a graph.

If my guess about the definition of bipartite tournament is correct, then for the case at hand there'd be 2^(4*4) = 65,000+ of them. While Maple can easily loop through that number of graphs, surely you don't want all the output displayed in your worksheet. The time and memory required for the display would be far more than that for the computation.

## Integrand is clearly imaginary...

Your integrand contains three square roots. A simple plot shows that one of those square roots has a negative radicand:

plot(-4*E^2+r^2, r= abs(l-R)..l+R); #l is letter ell, as you used.

## nonunit...

The help page ?applyrule states that the rules for constructing rules are explained on help page ?patmatch. That help page explains extremely clearly what is happening and how to fix it. You need to include the keyword nonunit.

the_rule:= A::nonunit(anything) + B::nonunit(anything) = A*B;
applyrule(the_rule, a+b);

## Windows File Explorer...

You should be able to search through the whole folder with the standard Windows File Explorer.

## Operand-permuting operator constructor...

I could easily (oh, say, 3 lines of Maple code) write for you an operator constructor such that P(2,1) would be an operator that switches the 1st and 2nd operands of its argument, the X(...), which needn't be specified until time-of-use. You'd be able to replace (2,1) with any permutation on any finite number of symbols using any of the standard list-of-(lists-of)-distinct-small-positive-integers syntaxes that are commonly used for permutations. The easiest-for-me-to-program end-use syntaxes could be either

1. P(2,1, ...)(X(i, j, k, ...)), or
2. P(2,1, ...) &* X(i, j, k, ...),

where I've used ... to indicate that there'd be no limits on the number of arguments, and &* could be replaced with nearly any operator symbol, provided it begins with &. In either case, the P(2, 1, ...can be preconstructed (independently of X) and assigned to a variable.

It'd also be possible to use the standard multiplication operator *, but it's significantly more work (rough estimate: 40 lines of code) to overload existing operators, especially when they're commutative and associative and already have default meaning for the given expressions.

So, would something from the 1st paragraph be sufficient for your purpose?

## Yes, lprint more trustworthy...

There is some bug with your Maple 2015 GUI display such that the prettyprinted GUI display (only) of the 2nd set in your list is not shown in the order that the set is actually stored. That bug has since been corrected. Once you realize that the bug is in the way that the 2nd set is prettyprinted, everything else you show is consistent. And, as you realize, the way to "see around" such prettyprinting bugs is to use lprint.

Regarding the set order: For some strange reason, Maple's set order places the 2nd derivative of g before the 1st, yet the 1st derivative of Theta before the 2nd (in both Maple 2015 and 2022). By "set order", I mean the order in which the elements are actually stored, regardless of display. This order can't be controlled.

Once a set is stored in a Maple session, its order will never change. I think that Tom's Answer may give the impression that it may change, but that's absolutely false.

## evalf...

The basic command to get numeric values is evalf. In this case, you can replace solve with fsolve or with (evalf@[solve]). The fsolve will return both roots because the equation is polynomial. The other method will work more generally, but requires that the equation can be symbolically solved (which, of course, is true in this case).

## Direction angles are in degrees...

Unfortunately, the direction angles are measured in degrees.

## e:= exp(1)...

Use e:= exp(1) somewhere in your code, preferably early. Otherwise, e is just an unassigned variable.

## Iterator:-SetPartitionFixedSize...

The generalized problem can be solved like this:

```restart:
s:= {"a", "b", "c", "d", "e", "f"}:
B:= [3,3]: L:= ListTools:-PartialSums([0,B[]]): m:= nops(B):
{seq}(
{seq}(s[[seq](j[1+L[k]..L[k+1]])], k= 1..m),
j= Iterator:-SetPartitionFixedSize(B)
);
{{{"a", "b", "c"}, {"d", "e", "f"}},
{{"a", "b", "d"}, {"c", "e", "f"}},
{{"a", "b", "e"}, {"c", "d", "f"}},
{{"a", "b", "f"}, {"c", "d", "e"}},
{{"a", "c", "d"}, {"b", "e", "f"}},
{{"a", "c", "e"}, {"b", "d", "f"}},
{{"a", "c", "f"}, {"b", "d", "e"}},
{{"a", "d", "e"}, {"b", "c", "f"}},
{{"a", "d", "f"}, {"b", "c", "e"}},
{{"a", "e", "f"}, {"b", "c", "d"}}}
```

 4 5 6 7 8 9 10 Last Page 6 of 369
﻿