aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Int.choose.3
blob: 57a79540c7cbcaeba79337a83b032edaaab3f2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Int.choose 3 2025-04-30 "Tomo man-pages"
.SH NAME
Int.choose \- binomial coefficient
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Int.choose\ :\ func(n:\ Int,\ k:\ Int\ ->\ Int)
.fi
.SH DESCRIPTION
Computes the binomial coefficient of the given numbers (the equivalent of `n` choose `k` in combinatorics). This is equal to `n.factorial()/(k.factorial() * (n-k).factorial())`.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
n	Int	The number of things to choose from. 	-
k	Int	The number of things to be chosen. 	-
.TE
.SH RETURN
The binomial coefficient, equivalent to the number of ways to uniquely choose `k` objects from among `n` objects, ignoring order.

.SH EXAMPLES
.EX
>> (4).choose(2)
= 6
.EE