- The Modern C# Challenge
- Rod Stephens
- 136字
- 2021-08-13 15:23:52
6. Binomial coefficients
The binomial coefficient of N and K gives the number of ways that you can pick N values from a set of K values. The binomial coefficient is usually written as and is pronounced N choose K.
For example, suppose you have a set of four values, {A, B, C, D}. The possible ways to select two of those values are {A, B}, {A, C}, {A, D}, {B, C}, {B, D}, and {C, D}. There are six possible ways to select two items from the original set of four items, so =6.
You can use the following formula to calculate binomial coefficients:
For the example where we select two items out of four, the formula gives the following:
Write a program that calculates binomial coefficients. Test your program by verifying the following values:
推薦閱讀
- 432級臺階之第2級臺階
- 仿真模型可移植性規(guī)范及其應(yīng)用
- 奇妙數(shù)學(xué)史:數(shù)字與生活
- 線性代數(shù)及其應(yīng)用(原書第6版)
- 數(shù)學(xué)建模:算法與編程實現(xiàn)
- 迷人的邏輯題
- Ethereum Smart Contract Development
- 救命的數(shù)學(xué)
- 高等數(shù)學(xué)同步練習(xí)指導(dǎo)
- 越玩越聰明的印度數(shù)學(xué)和孫子算經(jīng)
- 2頁紙圖解數(shù)學(xué):以極聰明的方式,讓你三步讀懂?dāng)?shù)學(xué)
- 幾何公差那些事兒
- 特殊函數(shù)概論習(xí)題解答
- 數(shù)學(xué)要素(全彩圖解 + 微課 + Python編程)
- Digital Forensics with Kali Linux