Find nCr mod p when n, r, p are large

Revision en1, by serasesi, 2017-10-27 16:41:32

I want to find nCr(n choose r, if you will) modulo a prime. The trouble is that all the numbers i.e. n, r and prime are large and are of the order of 10^9.

One method I could come up with is computing each of the three factorials individually(using FFT and multipoint evaluation) but that seems too tedious. It may also timeout.

Is there anything else I can do ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English serasesi 2017-10-27 16:41:32 407 Initial revision (published)