ComputeDivFact: Compute the ratio of factorials.

Description

Compute the ratio of factorials using Prime Factorization. For example, ComputeDivFact(c(a, b), c(d, e, f)) computes \frac{a! b!}{d! e! f!}.

Usage

 1 ComputeDivFact(num, deno = NULL, out.log = FALSE) 

Arguments

 num The vector of all numbers which have their factorials in the numerator. deno The vector of all numbers which have their factorials in the denominator. Default is NULL, there is only a numerator. out.log Is the logarithm of the result returned instead? Default is FALSE.

Value

The result of the ratio or its logarithm if out.log = TRUE.

choose

Examples

 1 2 3 4 5 6 7 8 9 choose(100, 20) ComputeDivFact(100, c(20, 80)) lchoose(100, 20) ComputeDivFact(100, c(20, 80), out.log = TRUE) factorial(100) ComputeDivFact(100) lfactorial(100) ComputeDivFact(100, out.log = TRUE) 

Search within the primefactr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.