Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum To get 3 ones per row and column, make the initial set all matrices of the form I + I[d1] + I[d2] where d1 is a derangement of [1..6] and d2 is a derangement of both [1..6] and d1.

@vv Thank you for formulating the theorem. I was not confident of its truth until I ran the code. Still, it needs proof.

Regarding the algorithm development time: I read Kitonum's initial posing of the problem right before I went to bed. I came up with the algorithm as I fell asleep, about 5 - 10 minutes.

@acer I had already been considering the changes that you suggested. Indeed they produce the same results. I have often commented here on MaplePrimes about how incredibly slow the constructor Matrix is.

By making a few more changes, I've got the time under 0.9 seconds. And if one is content with listlist form for the final results, I can do it in under 0.3 seconds.

restart:
gc():
st:= time():
n:= 6:
N:= [$1..n]:
Sn:= combinat:-permute(n):
Id:= [seq([seq(`if`(i=j, 1, 0), j= 1..n)], i= 1..n)]:
I0:= subs([0=1, 1=0], Id):
MA:= {seq(
         seq(M[p], p= Sn), 
         M= seq(I0-Id[d], d= remove(p-> ormap(evalb, p =~ N), Sn))
     )}:
time() - st;
MA:= {seq(rtable(M, subtype= Matrix), M= MA)}:
gc():
time() - st;

 

@_Maxim_ I can't conceive of any use for the ranges of properties. If assume(x::(a..b)) did mean that x has property b but not property a, that could conceivably be useful; but it doesn't mean that, as shown by

is(2, rational..real);

     true

It seems that assume(x::(a..b)) is the same as assume(x::b).

You asked for a list of the known properties. I think that everything that is initially known about properties is contained in the following tables:

eval(`property/ParentTable`);
eval(`property/ChildTable`);
eval(`property/ExclusiveTable`);

It's not much of a knowledge base.

As far as I'm aware, Maple's property system hasn't been updated (*footnote) during the entire time that I've been using Maple, which is since 1999. The assuming operator was added early in my Maple time, but it's just a wrapper that calls assume with no change to the underlying properties, as you can verify by showstat(`assuming`).

*footnote: There is apparently a separate assume/property facility that can be used by the Physics package. This package seems to be vigorously maintained and updated.

@dpaddy We can't really follow along unless you post your code in a reproducible format, but to my naked eye, it appears that your expression is simply a rational function of x with constant coefficients. I have a hard time believing that Maple can't accurately compute its residue.

@Rouben Rostamian  It looks like the OP is already using abs.

The OP should post the function in a reproducible format so that we can work with it.

@_Maxim_ Correct, as far as type is concerned RealRange(0,2) might as well be foo(0,2)---it's just a function.

You should also read ?in, which describes an operator SetOf whose argument is a type; however, I've never encountered a situation where a computation using SetOf couldn't be expressed more succinctly without it.

@acer The McCarthy short-circuit evaluation rules for boolean operators apply to the infix forms of and, or, and implies but not to their prefix forms. Thus, with the infix forms, if the truth of the whole expression can be determined from the left operand, then the right operand isn't even evaluated; whereas with the prefix forms, all arguments are evaluated regardless. This explains some of Maxim's anomalies.

I don't think that it applies to this Question, but a further source of anomalies is that in 2D Input (at least in some versions) the infix boolean operators are translated to their prefix forms.

 

 

 

@_Maxim_ RealRange per se isn't a type, but RealRange(1,2) is a type because it's a function, and all functions are types. (I'm using function in the Maple sense: an unevaluated function call or invocation.)

Just looking at this quickly (for less than a minute) and thinking how I'd express it in terms of z "by hand", I'm seeing a lot "argument of z" and "modulus of z". Do you see any possibility of an analytic expression in z?

@Carl Love Sorry, I had failed until now to notice that your plot was 3-D. The instructions that I gave work for 2-D plots. I don't know if it's possible for 3-D plots.

@Preben Alsholm Any such integral can be reduced to a pair of real integrals, like below, provided that evalc understands how to break it down. The integral in Question can be thus encoded

assume(Y>0);
Limit(
   (evalc@Complex)(
      Int~(evalc~([Re,Im](subs(s= x+I*y, x= 1, 1/(s^2+1)))), y= -Y..Y)[]
   ),
   Y= infinity
);

Limit(
   Int((-y^2+2)/((-y^2+2)^2+4*y^2), y = -Y ..Y) +
      I*Int(-2*y/((-y^2+2)^2+4*y^2), y = -Y .. Y),
   Y = infinity
)

It's clear at this point that both integrals converge at both infinities, so taking the limit uniformly in both directions is safe. It's also clear that the imaginary integral is 0 (for all Y).

applyop(value, 1, %);

Limit((1/2)*ln(Y^2+2*Y+2)-(1/2)*ln(Y^2-2*Y+2), Y = infinity)

value(%);

0

 

@_Maxim_ The documentation at ?timelimit contradicts what you say. It says directly in the first paragraph

  • For efficiency reasons, the timelimit bound is ignored while in built-in routines.

That's the documentation; I'm not sure what the reality is.

@Preben Alsholm Assuming that every builtin procedure has a positive integer index (from its option builtin= ... declaration) and that there are not huge gaps in the number sequence so that none has an index greater than 9999, the following constructs a list of all of them with both their names and index numbers.

restart:
interface(warnlevel= 0):
UL:= 9999:
B:= map(
   P-> [[op(3, eval(P))], eval(P)],
   select(
      P-> op(3,eval(P)) <> NULL,
      [seq(parse(sprintf("proc() option builtin=%d; end", k)), k= 1..UL)]
   )
): 
nops(B);

I count 314 in Maple 2016. They seem to be indexed alphabetically, ranging from 199 = ASSERT to 583 = zip.

@Carl Love Here is my corrected Answer. We need to create a new type, subscripted, which is akin to suffixed but tries to match a symbol's end rather than its beginning.

restart:
TypeTools:-AddType(
   subscripted,
   (x, S)->
      x::symbol and 
     `if`(
        S::set, 
        ormap(s-> type(x, subscripted(s)), S), 
        substring(x, -length(__||S)..) = __||S
     ) 
):             
poly:= a__b + b__a + a__b^2:
select(hastype, poly, subscripted(b));

To further the analogy with suffixed, I coded it so that {subscripted(a), subscripted(b)} is equivalent to subcripted({a,b}), and likewise for sets of any size. Also note that the subscripts need not be symbols; anything that can be appended by || will do; in particular, integers are allowed as subscripts.

First 353 354 355 356 357 358 359 Last Page 355 of 708