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

I split this off as a separate question.

Certainly Maple can perform both of these tasks. I can't work on it for several hours yet.

Concerning the second question, do you mean to search for whole lines only? Or may it be necessary to search for substrings within the lines? If the latter, is it possible that there are multiple occurences of the target string within a single line? And in such case should the target be counted multiple times?

@Carl Love And here is the efficient implementation using PolynomialTools:-CoefficientList.

MyCoeffList:= proc(p::polynom, x::name, y::name)
uses PT= PolynomialTools;
local k, L:= map(PT:-CoefficientList, PT:-CoefficientList(p, x, termorder= reverse), y);
    [seq([L[k][], 0$k-nops(L[k])][], k= 1..nops(L))]
end proc:

MyCoeffList(p, x, y);

So, you have about 4 billion elements, each element being a fair-sized linear polynomial. Clearly this cannot be stored in the memory of any normal computer. Fortunately, the coefficients of the polynomials are only 0 or 1. Each polynomial could be represented by a binary number. You have 32 variables, right? So that would be 4-bytes per polynomial, so the minimum memory requirement would be 16Gb. That's assuming that you can get Maple to use only 4 bytes for an integer; I think it might require 8 bytes. Maybe a string representation can be packed into fewer bytes.

Maple's numerical integration seems state-of-the-art to me, but maybe I don't really know what state-of-the-art is. What would you have added?

@Kitonum It is not quite true that my code does not give an unequivocal result when two of the input vectors have the same angle. The sort command guarantees in such cases that the output will be in the same order as the input.

@k20057 5

I've tried sampling without replacement, but I get similar results: The average number of particles with 0 energy is still about 2.2.

Perhaps each 6-tuple needs to be weighted according to its frequency of occurence.

@wingjammer 

It just requires a small modification. The following should work for any Maple. Keep the procedure Angle the same, and change SortByAngle to

SortByAngle:= (A::Matrix)->
     Matrix(sort(convert(A^%T, listlist), (P,Q)-> Angle(P) < Angle(Q)))^%T
:

 

Don't you mean counterclockwise? In the example that you gave, the points (0,1), (-1,0), (0,-1) are arranged counterclockwise.

@k20057 5 

I see what you mean. I wonder if what we need is to sample without replacement? I can't work on it for a few hours yet.

Do you have any guess for x, y, z? Can you restrict any of them to a range? Are they real?

@Kitonum 

Yes, I agree your code is better. Vote up. I am relying on the fact that binomial(n,k) = 0 for k a negative integer. That's more expensive than explicitly including the zeros. Also, my code has the procedure-call overhead for (m+1)^2 procedure calls.

@acer I think that you'll find some understanding if you look at the brief procedure `eval/laplace`, especially this

6   oper := eval(op(0,e),eqs);
   7   if oper <> op(0,e) then
   8     return eval(oper(op(e)),eqs)
       end if;

What about the procedure I wrote, RandomPartitions? I do not understand why that is not what you want.

@Markiyan Hirnyk 

I am using Maple 16 right now. Doing so, I get no tilde, but only when restart is in its own execution group. I will try again in Maple 18 (on a different computer) and report back (in several hours).

@nm 

I did not forget a line of code. I provided only the new line of code, which I intended for you to execute after the code that you had already posted.

First 531 532 533 534 535 536 537 Last Page 533 of 709