1.2.3-SNAPSHOT Arrow_down_16x16

combination-distribution

incanter.distributions

  • (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:

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/distributions.clj:249 top

(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))))
Vars in incanter.distributions/combination-distribution: <= >= and assert defn
Used in 0 other vars

Comments top

No comments for combination-distribution. Log in to add a comment.