nck

Efficient calculation of combination or binomial coefficient, without direct calculating factorials.

You are now following this Submission

Efficient calculation of combination or binomial coefficient, without direct calculating factorials.
Currently, this module will not give very accurate result (see the discussion page below)
usage:
>> nck(7,5)
21
modified using better alrorithm

Cite As

JaeHyeok Park (2026). nck (https://www.mathworks.com/matlabcentral/fileexchange/105320-nck), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.5

changed description

1.0.4

merged multiply and divide calculation in one line

1.0.3

adopt method described in https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coefficient/

1.0.2

changed loop endpoint

1.0.1

minor change in description

1.0.0