Mathematics

Associated with Math.SE; for both general discussion & math qu...
Jun 16, 2012 21:50
Can someone help me with stat question
Apr 10, 2012 12:48
the problem is that a*a overflows
Apr 10, 2012 12:48
int64_t modPow(int64_t a, int64_t x) {
    int64_t res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = ModM(res * a);
        }
        a = ModM(a*a);  //right here

        x /= 2;
    }
    return res;
}
Apr 10, 2012 12:48
the problem is that my modulus is a huge semiprime
Apr 10, 2012 12:48
the CRT itself is overflowing
Apr 10, 2012 12:48
that's why this is so annoying
Apr 10, 2012 12:48
This is part of the Chinese Remainder Theorem
Apr 10, 2012 12:42
a way to break up a mod xy
Apr 10, 2012 12:42
one that doesn't use large numbers
Apr 10, 2012 12:42
yes
Apr 10, 2012 12:37
I can't write a mod x*y because x*y is too large to fit in a data type
Apr 10, 2012 12:35
is there an another way to write (a mod (x*y))?
Apr 10, 2012 12:34
Hello
Apr 8, 2012 01:12
thank you so much
Apr 8, 2012 01:12
ah that's what it was!
Apr 8, 2012 01:10
everything uses uint64's
Apr 8, 2012 01:09
I get 174371283783502760
Apr 8, 2012 01:09
i'm using uint64's though
Apr 8, 2012 01:07
uint64_t p = 1000003;
uint64_t b = 1000033;
uint64_t x = modBinomial(543, 12, p);
uint64_t y = modBinomial(543, 12, b);
cout << x*b*modInverse(b,p) + y*p*modInverse(p,b);
Apr 8, 2012 01:07
and for some reason it's not giving me the right value
Apr 8, 2012 01:07
i just tried that
Apr 8, 2012 01:04
i have absolutely no idea :(
Apr 8, 2012 01:03
right
Apr 8, 2012 01:02
is a1 n choose k or can it be n choose k mod p / b etc
Apr 8, 2012 01:01
(n choose k)*b*[inverse b mod p] + (n choose k)*p*[inverse of p mod b]
Apr 8, 2012 01:01
ah ok
Apr 8, 2012 01:01
i thought n1 was p?
Apr 8, 2012 01:00
n choose k mod p and n choose k mod b
Apr 8, 2012 01:00
in my case what is a1, a2, n1, n2?
Apr 8, 2012 00:59
So I do a1*n2*[inverse n2 mod n1] + a2*n1*[inverse of n1 mod n2]?
Apr 8, 2012 00:57
i just want to combine two results
Apr 8, 2012 00:57
equation makes no sense to me
Apr 8, 2012 00:56
I don't understand
Apr 8, 2012 00:52
i can find n choose k mod p and n choose k mod b, but need to combine the results
Apr 8, 2012 00:51
i am trying to find n choose k mod p*b where p and b are prime
Apr 8, 2012 00:49
anyone know chinese remainder theorem
Apr 7, 2012 05:37
hi
Apr 7, 2012 03:15
nvm
Apr 7, 2012 03:15
how many unique ways can I do this
Apr 7, 2012 03:15
if I have c items and I want to divvy them up into n bins
Apr 6, 2012 11:06
hi
Apr 5, 2012 21:59
probability is just one subarea of statistics
Apr 5, 2012 03:51
It's a tough one
Apr 5, 2012 03:51
Nope, not yet
Apr 5, 2012 03:50
zz
Apr 5, 2012 01:19
sent a test email, let me know if you see it
Apr 5, 2012 01:15
same name?
Apr 5, 2012 01:13
in the event we aren't on at the same time
Apr 5, 2012 01:13
Do you have any other method of contact?