jga

15 Reputation

4 Badges

8 years, 150 days

MaplePrimes Activity


These are replies submitted by jga

@Carl Love Thank you very much, Carl. This looks great. I'll get ot the implementation right away! 

I understand what you're saying about the "test" I conducted. The numbers you post in yout example speak for themselves, the code seems to improve by at least one order of magnitude in almost every aspect, which is amazing. 

As I said above I'll get to the implementation now, if there are any interesting developments I'll let yo guys know :P

Thanks again!

 

Hi @Carl Love , I'm testing the code to incorporate into my program and I'm getting what I think might be some unusual behaviour. It's probably due some mistake on my part. 1) There is a warning: "Warning, Exception in unload function 'cleanup': Error, bad id" and 2) it seems to be slowe than the "direct/rudimentary" way of computing this:

> n:=100;
                                                                   n := 100
> k:=23;
                                                                    k := 23
> p:=11;
                                                                    p := 11
>  
> CodeTools:-Usage(binomial(n,k) mod p);
memory used=69.69KiB, alloc change=0 bytes, cpu time=4.00ms, real time=13.00ms, gc time=0ns
                                                                       3
> CodeTools:-Usage(Binomial(n,k) mod p);
memory used=3.1MB, alloc=40.3MB, time=0.12
Warning, type signature [integer, integer, integer] for function max is not recognized
memory used=5.84MiB, alloc change=32.00MiB, cpu time=148.00ms, real time=894.00ms, gc time=8.00ms
                                                                       3
> quit
Warning, Exception in unload function 'cleanup': Error, bad id
memory used=6.7MB, alloc=40.3MB, time=0.20

Thanks,

J

Edit: I'll happily accept your answer, but I don't know if you want to post the final version of the code in your OP?
 

@Carl Love @vv

Thanks to both for the help. To be honest I can't follow the discussion that's going on in here. I can tell you that in my algorithm there's no relation between N and K with p. I'll try the integrated version and see how does it compare to the direct method in my case. 

Essentially my program will build big matrices whose entries are these binomial coefficients. After this I still need to find the kernel (or equivalently, the rank) of them in prime characteristic. I previously programmed this in sage and realized my code was VERY inefficient because building the matrix was very slow. I hope Maple's famous mod p tools will help me out here.

Cheers!

Hi @John Fredsted , thanks for your answer. This is definitely useful. Cheers.

Hi @Kitonum , I guess in this case my question translates into how changing the rational function f (which I've added in an edit to the OP) from the variable q into the variables q=sin(k*x/2), even allowing some different k's. Maybe this should be clear from your answer, but I'm compeltely new to Maple. Thanks.

Hi @John Fredsted , I don't have any code, but I've added the explicit rational function to the OP. Thanks.

Page 1 of 1