Difference between revisions of "Documentation/How Tos/Calc: COMBIN function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(→See also:) |
(→Syntax:) |
||
Line 5: | Line 5: | ||
=== Syntax: === | === Syntax: === | ||
− | <tt>'''COMBIN( | + | <tt>'''COMBIN(n; k)'''</tt> |
− | : <tt>''' | + | : <tt>'''n'''</tt> is the number of items in the set. |
− | : <tt>''' | + | : <tt>'''k'''</tt> is the number of items to choose from the set. |
: <tt>'''COMBIN'''</tt> returns the number of ways to choose these items. For example if there are 3 items A, B and C in a set, you can choose 2 items in 3 different ways, namely AB, AC and BC. | : <tt>'''COMBIN'''</tt> returns the number of ways to choose these items. For example if there are 3 items A, B and C in a set, you can choose 2 items in 3 different ways, namely AB, AC and BC. | ||
Line 14: | Line 14: | ||
: <tt>'''COMBIN'''</tt> implements the formula: | : <tt>'''COMBIN'''</tt> implements the formula: | ||
− | :: <tt>''' | + | :: <tt>'''<i>n</i>!/(<i>k</i>!(<i>n</i>-<i>k</i>)!)'''</tt> |
=== Example: === | === Example: === |
Revision as of 20:32, 8 April 2008
COMBIN
Returns the number of combinations of a subset of items.
Syntax:
COMBIN(n; k)
- n is the number of items in the set.
- k is the number of items to choose from the set.
- COMBIN returns the number of ways to choose these items. For example if there are 3 items A, B and C in a set, you can choose 2 items in 3 different ways, namely AB, AC and BC.
- COMBIN implements the formula:
- n!/(k!(n-k)!)
Example:
COMBIN(3,2)
- returns 3.