Package young :: Module combination
[show private | hide private]
[frames | no frames]

Module young.combination

library for permutation and combination
Function Summary
  catalan(num)
catalan(n) -> Return the Catalan number
  catalan_generator()
catalan_generator() -> Return the Catalan number as a generator.
  combination(first, second)
combination(n, m) -> Return the combination of (n,m).
  factorial(x, y)
factorial([m=1), n) -> Return the factorial of n.
  k_composition(n, k)
k_composition(n, k) -> Return the number of k-composition of n.
  permutation(*seq)
permutation(sequence) -> Return the permutation of sequence
  weak_k_composition(n, k)
weak_k_composition(n, k) -> Return the number of weak k-composition of n.

Function Details

catalan(num)

catalan(n) -> Return the Catalan number

catalan_generator()

catalan_generator() -> Return the Catalan number as a generator.

combination(first, second)

combination(n, m) -> Return the combination of (n,m).

n can be a sequence or an integer. m must be an integer.

If n is an integer, return the combination of (n, m)

If n is a sequence, out of the sequence, take m elements.

factorial(x, y=0)

factorial([m=1), n) -> Return the factorial of n.

If m is given, return the multiply of sequence from m to n. m x (m+1) x ... x n

k_composition(n, k)

k_composition(n, k) -> Return the number of k-composition of n.

permutation(*seq)

permutation(sequence) -> Return the permutation of sequence

weak_k_composition(n, k)

weak_k_composition(n, k) -> Return the number of weak k-composition of n.

Generated by Epydoc 2.1 on Sun Aug 1 02:55:58 2004 http://epydoc.sf.net