You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Number of upper-bound integer sums {: #number-of-upper-bound-integer-sums }
141
142
142
143
Consider the following equation:
143
144
144
145
$$x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 20$$
145
146
146
-
where $0 \le x_i \le 8 (i = 1,2,\ldots 6)$.
147
+
where $0 \le x_i \le 8 ~ (i = 1,2,\ldots 6)$.
147
148
148
149
Task: count the number of solutions to the equation.
149
150
150
-
Forget the restriction on $x_i$ for a moment and just count the number of nonnegative solutions to this equation. This is easily done using [binomial coefficients](binomial-coefficients.md): we want to break a sequence of $20$ units into $6$ groups, which is the same as distributing $5$ "walls" over $25$ slots:
151
+
Forget the restriction on $x_i$ for a moment and just count the number of nonnegative solutions to this equation. This is easily done using [Stars and Bars](stars_and_bars.html):
152
+
we want to break a sequence of $20$ units into $6$ groups, which is the same as arranging $5$ _bars_ and $20$ _stars_:
151
153
152
154
$$N_0 = \binom{25}{5}$$
153
155
154
156
We will now calculate the number of "bad" solutions with the inclusion-exclusion principle. The "bad" solutions will be those in which one or more $x_i$ are greater than $9$.
155
157
156
-
Denote by $A_k (k = 1,2\ldots 6)$ the set of solutions where $x_k \ge 9$, and all other $x_i \ge 0 (i \ne k)$ (they may be $\ge 9$ or not). To calculate the size of $A_k$, note that we have essentially the same combinatorial problem that was solved in the two paragraphs above, but now $9$ of the units are excluded from the slots and definitely belong to the first group. Thus:
158
+
Denote by $A_k ~ (k = 1,2\ldots 6)$ the set of solutions where $x_k \ge 9$, and all other $x_i \ge 0 ~ (i \ne k)$ (they may be $\ge 9$ or not). To calculate the size of $A_k$, note that we have essentially the same combinatorial problem that was solved in the two paragraphs above, but now $9$ of the units are excluded from the slots and definitely belong to the first group. Thus:
157
159
158
160
$$ | A_k | = \binom{16}{5} $$
159
161
160
-
Similarly, the size of the intersection between sets $A_k$ and $A_p$ is equal to:
162
+
Similarly, the size of the intersection between two sets $A_k$ and $A_p$ (for $k \ne p$) is equal to:
0 commit comments