Блог пользователя Yubai

Автор Yubai, история, 2 года назад, По-английски

Try to solve the following problem, only by combining meaning but not the generating function.

$$$\sum_x \binom{2x+k}{x}\binom{P-2x-k}{a-x}$$$

There are q times inquiries, Given k, P, a, each time, print the value of this sum, $$$q,k,P,a \leq 1e5$$$.

I'll give an answer in 24 hours. If solved, please write the method in the comments and try the harder problems below, which replace 2 by t, t will be given before all queries.

$$$\sum_x \binom{tx+k}{x}\binom{P-tx-k}{a-x}$$$
  • Проголосовать: нравится
  • +54
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

interesting

»
2 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится
hint
  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    sad that no one is interested in it. If anyone wants an answer, please reply to me and I will give the answer as soon as possible

»
2 года назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится
sol

But I think there should be a more direct combination explanation, I very much hope that who are interested will come to discuss.

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Motivated by your problem, I once encountered this long time back but left it because couldn't make any progress.

$$$\sum_i {i\choose k} {n-i\choose l-k}$$$

There are q times inquiries, Given k, l, n, each time, print the value of this sum

$$$ 1 \leq k \leq l \leq n \leq 2e6 \ and \ q \leq 2e3$$$

I thought it seems like choosing l object out of n but it was wrong iirc.

Any hints?

Yubai

Thank you

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    This is a classic combinatorial problem. Consider there are n+1 balls, and you need to choose l+1 balls. One way to calculate it is enumerate the position of the (k+1)th ball, suppose its current position is $$$i+1$$$, then you only need to choose k balls from the first i balls, and choose (l+1-1-k) balls from the last (n+1-i-1) balls, got the sum you gave.

    so, the answer is $$$\binom{n+1}{l+1}$$$, which can make $$$q\leq 2e6$$$ too.