sanket407's blog

By sanket407, history, 8 years ago, In English

In TCS codevita-2016 round 2 there was a question in which we need to calculate sum of even binomial coefficients like ((nC0)+(nC2)+(nC4)+(nC6)+...+(nCk)) mod 10^9+7 where n and k can be upto 10^14 and k<=n

How do i solve it ?? ( im not sure about the time constraint , It might be greater than the normal 1s)

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Go from n to n-1. Now you have all binomial coefficients instead of even ones.