1.2.3-SNAPSHOT
permalink

- (combination-distribution n k)

Create a distribution of all the k-sized combinations of n integers.

Can be considered a multivariate distribution over k-dimensions, where

each dimension is a discrete random variable on the (0, n] range (though

these variables are decidedly non-independent).

A draw from this distribution can also be considered a sample without

replacement from any finite set, where the values in the returned

vector represent the indices of the items in the set.

Arguments:

n The number of possible items from which to select.

k The size of a sample (without replacement) to draw.

See also:

test-statistic-distribution, integer-distribution, pdf, cdf, draw, support

References:

http://en.wikipedia.org/wiki/Combination

Examples:

© incanter
See http://incanter.org for copyright and license details.

(defn combination-distribution " Create a distribution of all the k-sized combinations of n integers. Can be considered a multivariate distribution over k-dimensions, where each dimension is a discrete random variable on the (0, n] range (though these variables are decidedly non-independent). A draw from this distribution can also be considered a sample without replacement from any finite set, where the values in the returned vector represent the indices of the items in the set. Arguments: n The number of possible items from which to select. k The size of a sample (without replacement) to draw. See also: test-statistic-distribution, integer-distribution, pdf, cdf, draw, support References: http://en.wikipedia.org/wiki/Combination Examples: " [n k] (assert (>= n k)) (assert (and (<= 0 n) (<= 0 k))) (Combination. n k (integer-distribution 0 (nCk n k))))

© incanter
See http://incanter.org for copyright and license details.

Used in 0 other vars

## Comments top

## No comments for

combination-distribution. Log in to add a comment.