image D - Binomial Coefficient is Fun

  • Thoughts.

    • With N=2000, O(N^2) would be fine.
    • With M=10^9, it seems impossible to do dynamic programming like β€œthe first one is x and the rest are M-x”.
    • If B is smaller than A, it is zero and can be ignored.
    • Distribute the remaining among 2000 boxes
    • Since there are about of individual events, they cannot be calculated individually and added together in time.
      • β†’ should be able to be bundled and calculated by some formula transformation.
      • View [binomial coefficient formula
      • Vandermonde’s identity
      • It’s a product of binomial coefficients into a single binomial coefficient, which is close to the objective.
      • Adding a lower value is also close to the objective of being constant
      • Cannot be used directly because the value above changes.
      • There must be a formula like a variant of this β†’ let’s find it.
    • Write a code to naively calculate that you want to get and observe : | 1 | 1 | 1 | 4 | 4C1 | | β€” | β€” | β€” | β€” | β€” | | 1 | 1 | 2 | 10 | 5C2 | | 1 | 1 | 3 | 20 | 6C3 |
      • β†’
    • In the case of Section 3.
    • generally
      • This is a mistake see addendum A
    • Calculating sample 1 with this formula gave 8, but I doubt it because of the messy calculations along the way.
      • I’m supposed to have to come up with all the patterns below R, and I’m using the formula R=1.
    • In the first place, R can be about 10^9, so it seems impossible to calculate the binomial coefficient?
      • This is a mistake see addendum B
  • Official Explanation

    • as is the answer

    • Since R=M-S

    • Why does this happen?

      • The official explanation in natural language is, in essence, the following formula
    • Postscript B

      • Calculation of binomial coefficients
      • I tend to do β€œcreate a binomial coefficient table for faster calculation”.
        • I made a library…
      • But when the upper binomial coefficient is 10^9 and the lower is 10^6, as in this case, we should have used .
    • Postscript A

      • generally
        • This is an error.
      • is correct
        • so
          • Oh, that one doesn’t fit…
      • This formula only calculates the case where the β€œvalue to be assigned” is exactly R
      • The value we want is - Use field hockey stick identity.
      • This increases by 1, and the value we seek is .
      • Now we come down to the same formula as in the official explanation.
  • β†’ Explanation AC

  • OEIS

  • A path that does not involve β€œpredicting general terms from experimentally constructed sequences.” - I could transform the equation by interpreting it as Collapsing Duplicate Combinations.

from ARC110


This page is auto-translated from /nishio/ARC110D using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.