欧拉计划:请帮我理解#106

发布于 2024-08-13 12:17:56 字数 437 浏览 3 评论 0原文

我已经解决了#103和#105,但我很难理解 #106 ,具体来说25这个数字是从哪里来的呢?

如果我们谈论的是具有相同数量元素的两个不相交子集,那么

1-elem vs. 1-elem: there are 4 x 3 = 12 comparisons
2 vs. 2: C(4, 2) = 6 comparisons

如果我们包括具有不同数量元素的不相交子集,那么

1 vs. 2: C(4, 1) x C(3, 2) = 12
1 vs. 3: C(4, 1) = 4

我在这里缺少什么?提前致谢。

I have solved #103 and #105, but I have a hard time understanding #106, specifically where does the number 25 come from?

If we are talking about two disjoint subsets with equal number of elements, then

1-elem vs. 1-elem: there are 4 x 3 = 12 comparisons
2 vs. 2: C(4, 2) = 6 comparisons

If we include disjoint subsets with non-equal number of elements, then

1 vs. 2: C(4, 1) x C(3, 2) = 12
1 vs. 3: C(4, 1) = 4

What am I missing here? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傾城如夢未必闌珊 2024-08-20 12:17:56

对于前两种类型的比较,我得到了一半的数字——我认为与另一个比较相反的比较不算是新的比较。

例如,如果四个元素是 a、b、c、d,则 2 vs 2 比较 a、b 与 c、d 与 c、d 与 a、b 相同。所以我得到:

1 vs 1: 6
2 vs 2: 3
1 vs 2: 12
1 vs 3: 4

加起来确实是 25。

For the first two types of comparisons, I get half your numbers -- I think a comparison that is just the reverse of another comparison doesn't count as a new one.

For example, if the four elements are a,b,c,d, then the 2 vs 2 comparison a,b vs. c,d is the same as c,d vs. a,b. So I get:

1 vs 1: 6
2 vs 2: 3
1 vs 2: 12
1 vs 3: 4

which does indeed add up to 25.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文