Skip to content

Commit

Permalink
Merge pull request #4912 from MdShihabAhmed/patch-1
Browse files Browse the repository at this point in the history
Update cses-1716.mdx
  • Loading branch information
SansPapyrus683 authored Nov 8, 2024
2 parents 472d788 + c7afd9b commit d0013a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions solutions/gold/cses-1716.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ to count how many ways you can put the children between the apples.
## Explanation

To get a more illustrative idea of the given problem, consider $n + m - 1$ white
balls in a row. Of those $n + m - 1$ white balls, $m - 1$ are chosen to be
colored black as separators, which gives us exactly $m$ segments of (possibly
balls in a row. Of those $n + m - 1$ white balls, $n - 1$ are chosen to be
colored black as separators, which gives us exactly $n$ segments of (possibly
zero) white balls. There are

$$
\binom{n + m - 1}{m - 1}
\binom{n + m - 1}{n - 1}
$$

ways to choose the balls to color black.

The ways to color $m - 1$ balls black corresponds to the ways to distribute
those $n$ apples to $m$ children, since the number of white balls in a segment
The ways to color $n - 1$ balls black corresponds to the ways to distribute
those $m$ apples to $n$ children, since the number of white balls in a segment
corresponds to the number of apples given to a child.

<Info title="Stars and bars">
Expand Down

0 comments on commit d0013a6

Please sign in to comment.