TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Intuition behind combinatorial interpretation of binomial formula?

2 点作者 vector_spaces大约 2 年前
Can you give me an intuitive explanation for why the binomial coefficient gives the number of r combinations of n objects?<p>Specifically, most proofs use the fact that (nCr)(r!) = nPr, defining nCr to be the number of r-combinations in n objects, and nPr to be the number of r-permutations, then solving for nCr. It&#x27;s not clear to me how to understand why the left hand side of this equality makes sense in terms of the product rule though<p>I know the first factor says that there are nCr ways to choose an r-combination from n choices, but I&#x27;m not sure what to make of the other factor (again, thinking in terms of the product rule).

2 条评论

NtochkaNzvanova大约 2 年前
Think about how binomial coefficients arise. Suppose you want to expand out the product<p><pre><code> (a+b)^n = (a+b)(a+b)...(a+b) </code></pre> into a polynomial. If you just expanded it out, without grouping terms, there would be 2^n terms. Each of these terms would be obtained by choosing either a or b from the first factor; a or b from the second factor; ...; a or b from the nth factor, and then multiplying those a&#x27;s and b&#x27;s together.<p>If you then group the terms, you&#x27;ll find that the coefficient of the a^r b^(n-r) term will be nCr, the binomial coefficient.<p>Thinking back to the a-or-b selection process, note that each a^r b^(n-r) term corresponds to a path where you chose r a&#x27;s and (n-r) b&#x27;s. Now imagine that the n factors correspond to forming a subset of a set of n objects, where choosing a at position i means &quot;include the i&#x27;th object in the subset&quot; and choosing b at position i means &quot;exclude the i&#x27;th object from the subset&quot;. Thus, each distinct choice of a&#x27;s and b&#x27;s defines a distinct subset of the n objects.<p>Choosing r a&#x27;s and (n-r) b&#x27;s means forming a subset of r out of the n elements. Hence the interpretation of nCr as the number of combinations of r elements out of a total of n elements.
评论 #36101189 未加载
_Microft大约 2 年前
If you calculate the number of permutations (order matters), you will double-count a lot of combinations (order does not matter) with the same elements that only differ by the order of the elements. How many times does that happen? That depends on the number of elements, <i>r</i>. So in how many ways can these elements be arranged? <i>r!</i> To undo this double-counting, you divide <i>nPr</i> by <i>r!</i>.<p>I feel the situation is much clearer if you actually write <i>nCr</i> and <i>nPr</i> out.<p>Edit: the Wikipedia articles on combination and permutation are also helpful.
评论 #36101125 未加载