AnalyticComb
Documentation for AnalyticComb.
AnalyticComb.I_gf
AnalyticComb.MSET
AnalyticComb.SEQ
AnalyticComb.W_coeff
AnalyticComb.p_binary_words_doub_runl
AnalyticComb.partitions_asym
AnalyticComb.partitions_gf
AnalyticComb.primes_composition_asym
AnalyticComb.restricted_sum_comp
AnalyticComb.restricted_sum_comp_gf
AnalyticComb.restricted_sum_part
AnalyticComb.restricted_sum_part_gf
AnalyticComb.stirling_catalan_asym
AnalyticComb.stirling_factorial_asym
AnalyticComb.I_gf
— MethodI_gf(z)
Integers as combinatorial structures
$I(z)= \sum_{n \geq 1} z^n = \frac{z}{1-z}$
AnalyticComb.MSET
— MethodMSET(z)
Multiset operator (Pólya exponential operator).
Defined as $A = MSET(B) \implies A(z) = \frac{1}{1 - B(z)}$.
AnalyticComb.SEQ
— MethodSEQ(z)
Sequence operator (Pólya quasi-inverse operator).
Defined as $A = SEQ(B) \implies A(z) = \frac{1}{1 - B(z)}$.
AnalyticComb.W_coeff
— MethodW_coeff(r;n_tot=200)
Taylor series coefficient from generating function for binary words that never have more than r consecutive identical letters.
The number of binary words that never have more than r consecutive identical letters is found to be (set α = β = r). n_tot defaults to 200, according to the example in Flajolet & Sedgewick pag. 52
AnalyticComb.p_binary_words_doub_runl
— Methodp_binary_words_doub_runl(k,n)
Returns probablity associatied with k-lenght double runs (or either 0s or 1s) in a sequence of size n.
Specification is W ∼= SEQ(b) SEQ(a SEQ(a) b SEQ(b)) SEQ(a). Refer to the example in Flajolet & Sedgewick pag. 52.
AnalyticComb.partitions_asym
— Methodpartitions_asym(n)
Asymptotics for partition of integers (EIS A000041) by Hardy and Ramanujan, later improved by Rademache
AnalyticComb.partitions_gf
— Methodpartitions_gf(z,max)
Generating function for integer partitions.
$P(z)= \prod{m = 1}_{\Inf} \frac{1}{1-z^m}$ Use series
to obtain counts(EIS A000041): series(partitions_gf(z,10),z,0,8)
for n up to 8.
AnalyticComb.primes_composition_asym
— Methodprimes_composition_asym(n)
Asymptotics for composition of n into prime parts (A023360).
AnalyticComb.restricted_sum_comp
— Methodrestricted_sum_comp(n,r)
Number of compositions of n with components in the set {1,2,..,r}.
r = 2 yields Fibonnaci numbers (EIS A000045): $F_{n} = F_{n-1} + F_{n-2}$. r>2 yields generalized Fibonacci numbers.
AnalyticComb.restricted_sum_comp_gf
— Methodrestricted_sum_comp_gf(r)
Generating function for compositions with restricted summand.
AnalyticComb.restricted_sum_part
— Methodrestricted_sum_part(n,r)
Number of partitions with components in r with restricted summand n.
n must be an integer and r must be a set of integers, like in r = [1,5,10,25] , n = 99.
AnalyticComb.restricted_sum_part_gf
— Methodrestricted_sum_part_gf(r)
Generating function for partition with restricted summand.
AnalyticComb.stirling_catalan_asym
— Methodstirling_catalan_asym(n)
Stirling approximation for n_th Catalan number. (EIS A000108)
$\frac{4^n}{\sqrt{\pi n^3}}$
AnalyticComb.stirling_factorial_asym
— Methodstirling_factorial_asym(n)
Stirling approximation for n! as (n/exp(1))^nsqrt(2pi*n). (EIS A000142)
$n! \sim \sqrt{2 \pi n} {\frac{n}{e}}^{n}$