# AnalyticComb.jl - Analytic Combinatorics in Julia

**URL:** <https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196>\
**Category:** Package Announcements\
**Tags:** combinatorics, symbolics\
**Created:** [September 24, 2023, 3:02pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196 "2023-09-24T15:02:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![fargolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fargolo/32/37515_2.png) [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Post date:** [September 24, 2023, 3:02pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/1 "2023-09-24T15:02:27Z")

</div>

Hello, fellow Julia enthusiasts,

I started to implement symbolic methods for combinatorial problems ( [GitHub - fargolo/AnalyticComb.jl: Solutions for combinatorial problems using symbolic methods.](https://github.com/fargolo/AnalyticComb.jl) ) following Flajolet & Sedgewick’s textbook.

I am not well versed in symbolic computation, so I would love some help from more experienced developers.

This package implements solutions for combinatorial problems using analytic combinatorics. Check the text book by Flajojelt & Sedgewick ( [https://algo.inria.fr/flajolet/Publications/book.pdf](https://algo.inria.fr/flajolet/Publications/book.pdf) ) and Coursera’s full course by Robert Sedgewick ( [https://www.coursera.org/learn/analytic-combinatorics](https://www.coursera.org/learn/analytic-combinatorics) ).

A brief intro to the subject:

> In, 1751, Euler was studying the number of ways in which a given convex polygon could be decomposed into triangles by diagonal lines. (Flajolet & Sedgewick, p.20)
> 
> He realized that the progression of numbers in the solution (1, 2, 5, 14, 42, 132,…) was directly related to the coefficients of the series expansion of the polynomial fraction (1−2a−√(1−4a)) / (2aa), that is: 1+2a +5a^2 + 14a^3 + 42a^4 + 132a^5 + …
> 
> Given any constructable combinatorial structure, one can use a set of operators to find a generating function and then approach the problem analytically.

Best regards,  
Felipe

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [September 24, 2023, 6:05pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/2 "2023-09-24T18:05:24Z")

</div>

This seems like an interesting package. Unfortunately, I lack the expertise to help. Nonetheless, I wonder whether you can find any inspiration from Symbolics.jl.

---

<div class="post-metadata">

**Author:** ![fargolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fargolo/32/37515_2.png) [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Post date:** [December 21, 2023, 9:50pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/3 "2023-12-21T21:50:05Z")

</div>

**Version 2.0 is out with major performance enhancements**

I needed to run some simulations with large samples and SymPy.jl was unfeasible.

I changed some of the methods (SymPy `:Sym` expressions for Julia native functions and `SymPy.series` for `TaylorSeries.series_expand`).

Run times were 10 to 10^5 faster (no kidding) for some methods . I am quite happy with Julia at the moment. 😀

If this package seems interesting, stay in tune.  
I’ll release SymbolicInference.jl soon. It uses AnalyticComb.jl to make inference on real problems (e.g. chaotic time-series). Nils ([NilsToAn · GitHub](https://github.com/NilsToAn/)) and Norbert Marwan ([pucicu (Norbert Marwan) · GitHub](https://github.com/pucicu)) from Potsdam started contributing on a paper about this.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 22, 2023, 1:10am UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/4 "2023-12-22T01:10:00Z")

</div>

> [@fargolo](#):
>
> I’ll release [SymbolicInference.jl](https://juliahub.com/ui/Packages/SymbolicInference) soon.

Symbolic interface should be a name used for symbolic interfaces

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [December 22, 2023, 1:11am UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/5 "2023-12-22T01:11:52Z")

</div>

“interface” vs “inference”

---

<div class="post-metadata">

**Author:** ![fargolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fargolo/32/37515_2.png) [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Post date:** [December 22, 2023, 7:22pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/6 "2023-12-22T19:22:03Z")

</div>

Indeed.

This comment made me think that “SymbolicMethods” would actually be a better name for what AnalyticComb.jl is at the moment.

I have did not implement much of the ‘second part’ of the book (with complex analysis) yet.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [December 23, 2023, 10:23pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/7 "2023-12-23T22:23:45Z")

</div>

For example, knowing the generating function of a sequence, and therefore all its singular varieties, can your code provide assymptotics on the sequence itself ? I think the book provide results on both first and second order if I am right. Is that implemented or is that in the “second part” ?

---

<div class="post-metadata">

**Author:** ![fargolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fargolo/32/37515_2.png) [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Post date:** [December 25, 2023, 2:35pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/8 "2023-12-25T14:35:51Z")

</div>

Not yet for general cases, @lrnv.

That’s the focus of the 2nd part.

There are some assymptotics for specific problems though.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [December 25, 2023, 2:43pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/9 "2023-12-25T14:43:33Z")

</div>

> [@fargolo](#):
>
> Not yet for general cases, @lrnv.
> 
> That’s the focus of the 2nd part.

It would be interesting to see how close the implementation limits would be to the theory, I am impatient to look at it !

---

<div class="post-metadata">

**Author:** ![fargolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fargolo/32/37515_2.png) [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Post date:** [May 30, 2024, 2:18pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196/10 "2024-05-30T14:18:38Z")

</div>

@lrnv

Take a look at this first application for time-series:

> [@Time-series analysis - Probabilistic inference on RQA ( SymbolicInference.jl)](https://discourse.julialang.org/t/time-series-analysis-probabilistic-inference-on-rqa-symbolicinference-jl/114701):
>
> [How it started](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196) The [SymbolicInference.jl package](https://github.com/fargolo/SymbolicInference.jl) uses [Analytic Combinatorics](https://github.com/fargolo/AnalyticComb.jl) to perform probabilistic inference over certain combinatorial classes. The first application is explained in this white paper [Probabilistic inference on arbitrary time-series via symbolic methods: exploring complex dynamics with analytics combinatorics and recurrence analysis](https://osf.io/preprints/osf/3ws85). It tackles time series analysis using combinatorial specifications for binary words to handle binary matrices from recurrence quantification ana…
