Skip to content
Embercode
✕
CombinatoricsQuick quiz

Counting principles

8 questions. Covers Stars and bars.

Questions 1 to 5 of 8

  1. 1. How many non-negative integer solutions does x1 + x2 + x3 + x4 + x5 = 30 have, with no upper limits on any variable?

    Type a number.

  2. 2. How many positive integer solutions does x1 + x2 + x3 + x4 = 9 have, where every variable is at least 1?

    Type a number.

  3. 3. In inclusion-exclusion over the boxes that break their upper bound, what sign does the term for a set S of boxes get?
  4. 4. There are k = 3 boxes. In the mask, bit i set means box i is in S. Which masks get a minus sign in the sum?

    Pick every answer that is true.

  5. 5. A student changes one line of count_bounded in the bakery solution. The sample input 30 5 with the five limits is run again. ``cpp ans = (__builtin_popcount(mask) % 2 == 0) ? (ans - term + MOD) % MOD : (ans + term) % MOD; `` What does the changed program print, modulo 1000000007?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.