Ç - 一个简单的前pression在一个范围内的数字计算组合? [英] C - a simple expression for counting combinations in a range of numbers?
问题描述
那么一个真正的模糊的说法(对我)
Well really a vague statement (to me)
什么是基本的前pression来计算:
What is the basic expression to calculate:
- 而采取的K N东西组合在同一时间为一个整数数字
- "The number of combinations of n things taken k at a time as an integer"
的编辑:的
多一点澄清:
例如,四个项目A,B,C的组合,D历时3在同一时间为ABC,ABD,ACD,和BCD。换句话说,有总的四样东西四种不同的组合在历时3一时间。
A little more clarification: "For example, the combinations of four items a,b,c,d taken three at a time are abc, abd, acd, and bcd. In other words, there are a total of four different combinations of four things "taken three at a time"."
我是在一个非入门C级,同时试图完成我的数学要求的CS程度的转移。我所有的我的工作变得非常高分迄今,但更高层次的数学上来我真的会被卡住。但是,我离题..
I'm taking a non introductory C class while attempt to complete my math requirements to transfer for a CS degree. I am getting very high scores on all of my work thus far, but when higher level math comes up I really get stuck. But I digress..
号码的范围是1-10的 N 的
和 K 的的范围是1-4。
The range of numbers would be 1-10 for n and k's range would be 1-4.
下面是我收到的唯一的参考,这是在我头上的方式。
Below is the only reference I have received and it is way over my head.
http://www.themathpage.com/apreCALC /排列组合,2.htm
推荐答案
基本的前pression为n!/(K!(N-K)!)。计算这个一种有效的方法是使用帕斯卡三角的2D DP表
The basic expression is n!/(k!(n-k)!). An efficient way to calculate this is to use a 2D DP table of pascal's triangle.
这篇关于Ç - 一个简单的前pression在一个范围内的数字计算组合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!