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!}\).
ComputeDivFact(num, deno = NULL, out.log = FALSE)
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 |
out.log | Is the logarithm of the result returned instead?
Default is |
The result of the ratio or its logarithm
if out.log = TRUE
.
choose
choose(100, 20)#> [1] 5.359834e+20ComputeDivFact(100, c(20, 80))#> [1] 5.359834e+20lchoose(100, 20)#> [1] 47.73063ComputeDivFact(100, c(20, 80), out.log = TRUE)#> [1] 47.73063factorial(100)#> [1] 9.332622e+157ComputeDivFact(100)#> [1] 9.332622e+157lfactorial(100)#> [1] 363.7394ComputeDivFact(100, out.log = TRUE)#> [1] 363.7394