Skip to content

Commit

Permalink
Added asymptotics for Stirling factorials, partitions and primes comp…
Browse files Browse the repository at this point in the history
…osition
  • Loading branch information
fargolo committed Sep 23, 2023
1 parent 56ee9a9 commit c7b4d16
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ julia>p_binary_words_runl(6,200)
0.166...
```





Stirling approximation for n!:
```
julia> stirling_factorial(7)
4980.395831612462
```

5 changes: 3 additions & 2 deletions src/AnalyticComb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ using SymPy
#using TaylorSeries
#using DynamicalSystems

export
export
stirling_factorial, partitions, primes_composition
p_binary_words_runl

include("binary_words.jl")
#include("inference_plot.jl")
include("asymptotics.jl")

end
22 changes: 22 additions & 0 deletions src/asymptotics.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
stirling_factorial(n)
Stirling approximation for n! as (n/exp(1))^n*sqrt(2*pi*n).
"""
stirling_factorial(n) = (n/exp(1))^n*sqrt(2*pi*n)


"""
partitions(n)
Asymptotics for partition of integers by Hardy and Ramanujan, later improved by Rademache
"""
partitions(n) = (1/(4*n*sqrt(3)))*exp(pi*sqrt(2n/3))


"""
primes_composition(n)
Asymptotics for composition of primes.
"""
primes_composition(n) = 0.30365 * 1.47622^n
5 changes: 0 additions & 5 deletions src/binary_words.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@





"""
W_coeff(r;n_tot=200)
Expand Down

0 comments on commit c7b4d16

Please sign in to comment.