且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从一组x项的随机抽取n项所有可能的组合(算法)

更新时间:2023-01-11 19:54:40

选择P输出的n个项目,这是公式来告诉你有多少组合也有。

Choosing p out of n items, this is the formula to tell you how many combinations there are.

                  n!
n choose p  = -----------
               p! (n-p)!

谷歌计算器会做数学题给你:

Google calculator will do the math for you:

http://www.google.com/search?q=6+选择+ 4

6选4 = 15