From Mathematics to Art: Modelling the Pascal’s Triangle with Petri Nets
Abstract
1. Introduction
- A Petri net model of Pascal’s triangle is proposed;
- The emergence of the Sierpiński triangle by parity is established within the model;
- The appearance of the Gaussian distribution by random routing is obtained;
- A short discussion of Petri net properties is provided.
2. Theory Background
2.1. Mathematical Background
« L’homme n’est qu’un roseau, le plus faible de la nature; mais c’est un roseau pensant. »
2.2. Petri Nets
3. A Petri Net for Pascal’s Triangle
3.1. General Rule
- Bounded—since each place can contain a finite number of tokens equal to the corresponding Pascal’s coefficient;
- Acyclic—since each transition at level n Produces tokens at level n+1 (no backward connection);
- Not live—because transitions are permanently disabled once their input places are emptied;
- Not reversible—as it is impossible to come back to the initial state (no backward arc).
3.2. Binomial Coefficients as Token Counts
3.3. Computational Complexity and Marking-Based Propagation
- For each line k, there are k + 1 places; therefore, for the depth n, the number of places is (n + 1)(n + 2)/2.
- The number of transitions is n(n + 1)/2 (because the last line has no transitions).
- The number of tokens doubles at each line, and the number of firings rapidly becomes difficult to handle (sum of powers of 2 at depth n):
- For each line k, the number of places is still (n + 1)(n + 2)/2.
- The number of transitions is still n(n + 1)/2.
- The number of firing becomes 2 for each transition, therefore n(n + 1).
4. Emergence of the Sierpiński Triangle
Implementation Notes (Python)
def binom_is_odd(n: int, k: int) -> bool:
return (k & (n - k)) == 0
5. Rectangular Representation
5.1. General Rule
- Transitions are not taken into account.
- Only the number of tokens in each place is considered.
- Each pixel is characterised by a depth n and a position k with .
- For each depth n and each position k, the value is computed and coloured black if odd, white if even.
- Empty positions (when there is no place corresponding to the Petri net) are left blank, resulting in a rectangular array where each row contains valid entries.
5.2. Rectangular Representation Modulo Five with Okabe–Ito Palette
- Each pixel corresponds to a place with .
- The value is computed.
- The residue is mapped to the Okabe–Ito palette, chosen for its clarity:
- black;
- blue (#0072B2);
- orange (#E69F00);
- vermillion (#D55E00);
- green (#009E73).
- Empty positions with are black.
5.3. Implementation Notes on the Okabe–Ito Palette
5.4. Implementation Notes (Python)
def binom_mod5(n: int, k: int) -> int:
res = 1 # initialize result modulo 5
while n or k: # loop while base-5 digits remain
ni, ki = n % 5, k % 5 # extract least significant base-5 digits
if ki > ni: # if any digit of k > digit of n -> zero
return 0
res = (res * comb(ni, ki)) % 5 # multiply by small binomial,
# reduce modulo 5
n //= 5; k //= 5 # drop processed digit (int. div. by 5)
return res # final result modulo 5
6. Kandinsky Representation of the Pascal’s Petri Net
- The colour of each circle is determined by the number of tokens . A Kandinsky-inspired palette is used, written as follows:
- beige (#f5f5dc, neutral background);
- carmine red (#b22222);
- turquoise (#40e0d0);
- lemon yellow (#ffd300);
- deep violet (#6a0dad).
- The radius of each circle directly depends on the coefficient. To balance the growth of binomial values, a logarithmic scaling is applied:where is a base radius and a scaling factor. This ensures that small coefficients (near the borders) appear as small dots, while central coefficients are much larger.
Implementation Notes (Python)
r = r0 + alpha * np.log1p(comb(n, k))where comb(n,k) is the binomial coefficient, r0 is a base radius, and alpha a scaling factor. The colour of the circle is selected from a predefined Kandinsky-inspired palette (red, turquoise, yellow, violet, and beige).
7. Gaussian Emergence from Random Routing
8. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Pascal, B. Traité du Triangle Arithmétique, 1st ed.; Manuscript, first published posthumously in 1665, 1654; Guillaume Desprez: Paris, France, 1665. [Google Scholar]
- Aliu, A.; Rexhepi, S.; Iseni, E. Efficiency of Understanding Some Mathematical Problems by Means of Pascal’s Triangle. Int. Electron. J. Math. Educ. 2023, 18, em0753. [Google Scholar] [CrossRef]
- Hilton, P.; Pedersen, J. Looking into Pascal’s triangle: Combinatorics, arithmetic, and geometry. Math. Mag. 1987, 60, 305–316. [Google Scholar] [CrossRef]
- Hilton, P.; Pedersen, J. Relating Geometry and Algebra in the Pascal Triangle, Hexagon, Tetrahedron, and Cuboctahedron Part I: Binomial Coefficients, Extended Binomial Coefficients and Preparation for Further Work. Coll. Math. J. 1999, 30, 170–186. [Google Scholar] [CrossRef]
- Gandhi, M.A.; Padi, T.R.; Gandhi, M.A. Combinatorial Probability Distribution for 2nd Diagonal Elements of the Pascal’s Triangle with Sequence of Natural Numbers in Prime Diagonal. Triangle 2023, 1, 35–49. [Google Scholar]
- Mathonet, P.; Rigo, M.; Stipulanti, M.; Zénaïdi, N. On digital sequences associated with Pascal’s triangle. Aequ. Math. 2023, 97, 391–423. [Google Scholar] [CrossRef]
- Beiu, V.; Dăuş, L.; Jianu, M.; Mihai, A.; Mihai, I. On a surface associated with Pascal’s triangle. Symmetry 2022, 14, 411. [Google Scholar] [CrossRef]
- Martínez-Cruz, M.Á.; Patiño-Ortiz, J.; Patiño-Ortiz, M.; Balankin, A.S. Some Insights into the Sierpiński Triangle Paradox. Fractal Fract. 2024, 8, 655. [Google Scholar] [CrossRef]
- Pyörälä, A.; Shmerkin, P.; Suomala, V.; Wu, M. Covering the Sierpiński carpet with tubes. Isr. J. Math. 2025, 265, 769–799. [Google Scholar] [CrossRef]
- Taylor, T.D. The Beauty of the Symmetric Sierpiński Relatives. Proceedings of Bridges 2018: Mathematics, Art, Music, Architecture, Education, Culture, Stockholm, Sweden, 25–29 July 2018; pp. 163–170. [Google Scholar]
- Wilkinson, S.; Settle, B. n-Flake Variations. In Proceedings of the Bridges 2024 Conference Proceedings, Richmond, VA, USA, 5 July 2024; pp. 479–482. [Google Scholar]
- Qi, H.; Shiraz, M.; Gani, A.; Whaiduzzaman, M.; Khan, S. Sierpiński triangle based data center architecture in cloud computing. J. Supercomput. 2014, 69, 887–907. [Google Scholar] [CrossRef]
- Ali, A.; Rafique, H.; Arshad, T.; Alqarni, M.A.; Chauhdary, S.H.; Bashir, A.K. A fractal-based authentication technique using Sierpiński triangles in smart devices. Sensors 2019, 19, 678. [Google Scholar] [CrossRef]
- Murata, T. Petri nets: Properties, analysis and applications. Proc. IEEE 1989, 77, 541–580. [Google Scholar] [CrossRef]
- Girault, C.; Valk, R. Petri Nets for Systems Engineering: A Guide to Modeling, Verification, and Applications; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
- Van der Aalst, W.M. Business process management as the “Killer App” for Petri nets. Softw. Syst. Model. 2015, 14, 685–691. [Google Scholar] [CrossRef]
- Grobelna, I.; Karatkevich, A. Challenges in Application of Petri Nets in Manufacturing Systems. Electronics 2021, 10, 2305. [Google Scholar] [CrossRef]
- Grobelna, I.; Wiśniewski, R.; Wojnakowski, M. Specification of Cyber-Physical Systems with the Application of Interpreted Nets. In Proceedings of the IECON 2019—45th Annual Conference of the IEEE Industrial Electronics Society, Lisbon, Portugal, 14–17 October 2019; Volume 1, pp. 5887–5891. [Google Scholar] [CrossRef]
- Karatkevich, A. Dynamic Analysis of Petri Net-Based Discrete Systems; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar]
- Grobelna, I.; Wiśniewski, R.; Grobelny, M.; Wiśniewska, M. Design and Verification of Real-Life Processes With Application of Petri Nets. IEEE Trans. Syst. Man Cybern. Syst. 2017, 47, 2856–2869. [Google Scholar] [CrossRef]
- Mailland, D.; Grobelna, I. A Novel Approach to the Collatz Conjecture with Petri Nets. Information 2025, 16, 745. [Google Scholar] [CrossRef]
- Pascal, B. Pensées; Port-Royal: Paris, France, 1670. [Google Scholar]
- Meštrović, R. Lucas’ theorem: Its generalizations, extensions and applications (1878–2014). arXiv 2014, arXiv:1409.3820. [Google Scholar]
- Bishop, A.J. Review of research on visualization in mathematics education. Focus Learn. Probl. Math. 1989, 11, 7–16. [Google Scholar]
- Mancosu, P. Visualization in logic and mathematics. In Visualization, Explanation and Reasoning Styles in Mathematics; Springer: Dordrecht, The Netherlands, 2005; pp. 13–30. [Google Scholar]
- Abedalrahim, J.; Alsayaydeh, J.; Zainon, M.; Oliinyk, A.; Aziz, A.; Rahman, A.; Baharudin, Z.; Teknologi, F.; Elektrik, K.; Elektronik, D.; et al. The development of system for algorithms visualization using SIMJAVA. J. Eng. Appl. Sci. 2020, 15, 3024–3034. [Google Scholar]
- Alsyayadeh, J.A.J.; Irianto; Aziz, A.; Chang, K.X.; Hossain, A.Z.; Herawan, S.G. Face recognition system design and implementation using neural networks. Int. J. Adv. Comput. Sci. Appl. 2022, 13, 519–526. [Google Scholar] [CrossRef]
- Zhang, K.; Yu, J. Generating abstract paintings in Kandinsky style. In SIGGRAPH Asia 2013 Art Gallery; ACM: New York, NY, USA, 2013; pp. 1–6. [Google Scholar]
- Murata, J. Seeing the Invisible: Kandinsky and the Multi-dimensionality of Colors. In Phenomenology and the Arts: Logos and Aisthesis; Springer: Cham, Switzerland, 2020; pp. 87–98. [Google Scholar]
- Ziobro, R. Pascal’s Triangle and Lucas’s Theorem. Formaliz. Math. 2024, 32, 235–245. [Google Scholar] [CrossRef]
- Kosobutskyy, P.; Yedyharova, A.; Slobodzyan, T. From Newton’s Binomial and Pascal’s Triangle to Collatz’s Problem. Comput. Des. Syst. Theory Pract. 2023, 5, 121–127. [Google Scholar] [CrossRef]
- Mereb, M. On Determinants of Matrices Related to Pascal’s Triangle. J. Comb. Theory Ser. A 2024, 200, 105803. [Google Scholar] [CrossRef]
- Yamagami, S.; Taniguchi, T. A Generalization of Lucas’ Theorem and Symmetries of Pascal’s Triangle. Integers 2020, 20, A77. [Google Scholar]
- Chen, X. Properties of Pascal’s Triangle and Pascal’s Pyramid with Applications. Theor. Nat. Sci. 2025, 84, 36–39. [Google Scholar] [CrossRef]
- Gütschow, J.; Nesme, V.; Werner, R.F. The fractal structure of cellular automata on abelian groups. In Discrete Mathematics & Theoretical Computer Science: Proceedings of the Automata 2010—16th Intl. Workshop on CA and DCS, Nancy, France, 14–16 June 2010; DMTCS: Nancy, France, 2010; pp. 51–70. [Google Scholar] [CrossRef]
- Prusinkiewicz, P.; Hanan, J. Lindenmayer Systems, Fractals, and Plants; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013; Volume 79. [Google Scholar]
- Neroli, Z. Fractal dimensions for iterated graph systems. Proc. R. Soc. A 2024, 480, 20240406. [Google Scholar] [CrossRef]
- Tarocchi, M. Conjugacy in rearrangement groups of fractals. arXiv 2023, arXiv:2309.16613. [Google Scholar] [CrossRef]
- Skums, P.; Bunimovich, L. Graph fractal dimension and the structure of fractal networks. J. Complex Netw. 2020, 8, cnaa037. [Google Scholar] [CrossRef] [PubMed]
- David, R.; Alla, H.; David, R.; Alla, H. Discrete, Continuous, and Hybrid Petri Nets; Springer: Berlin/Heidelberg, Germany, 2010. [Google Scholar]
- Karam, H.; Hassanien, A.E.; Nakajima, M. Petri Net Modeling Methods For Generating Self-Similar Fractal Images. In ITE Technical Report 22.45; The Institute of Image Information and Television Engineers: Minato City, Japan, 1998; pp. 13–18. [Google Scholar]
- Karam, H.; Hassanien, A.E.; Nakajima, M. Fractal image generation based on Petri net theory. In Proceedings of the ICAT’98 International Conference on Artificial and Tele-Existence, Gifu, Japan, 18–20 November 1998; pp. 33–39. [Google Scholar]
- Hussein, H.K.; Hassanien, A.E.; Nakajima, M. Escape-time modified algorithm for generating fractal images based on petri net reachability. IEICE Trans. Inf. Syst. 1999, 82, 1101–1108. [Google Scholar]
- Kuberal, S.; Kalyani, T.; Thomas, D.; Kamaraj, T. Petri net generating Triangular arrays. Proc. Comput. Sci. 2015, 57, 642–649. [Google Scholar] [CrossRef][Green Version]
- Lucas, E. Théorie des Nombres; Gauthier-Villars: Paris, France, 1891. [Google Scholar]
- Abu Salem, K.M. On the Sierpiński Gasket and Pascal’s Triangle Modulo a Prime. Am. Math. Mon. 2001, 108, 754–759. [Google Scholar] [CrossRef]
- Okabe, M.; Ito, K. Color Universal Design (CUD): How to Make Figures and Presentations That Are Friendly to Colorblind People. 2008. Available online: https://jfly.uni-koeln.de/color/ (accessed on 21 September 2025).
- Kosobutskyi, P.; Lobur, M.; Matviiv-Lozynska, Y. Method of statistical imitation, its creator S. Ulam and basic principles of application for random processes modeling. Comput. Data Anal. Model. (CDS) 2021, 3, 21–30. [Google Scholar] [CrossRef]
- Laplace, P.S. Théorie Analytique des Probabilités; Courcier: Paris, France, 1812. [Google Scholar]
- Verrill, H.A. Generative Art from the Calculus Classroom. In Proceedings of the Generative Art Conference (GA2022), Rome, Italy, 12–14 December 2022; pp. 183–189. [Google Scholar]
- Verrill, H.A. Fractals from Hinged Hexagon and Triangle Tilings. In Proceedings of the Bridges 2024: Mathematics, Art, Music, Architecture, Education, Culture, Richmond, VA, USA, 1–5 August 2024; pp. 327–334. [Google Scholar]










Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mailland, D.; Grobelna, I. From Mathematics to Art: Modelling the Pascal’s Triangle with Petri Nets. Symmetry 2025, 17, 2181. https://doi.org/10.3390/sym17122181
Mailland D, Grobelna I. From Mathematics to Art: Modelling the Pascal’s Triangle with Petri Nets. Symmetry. 2025; 17(12):2181. https://doi.org/10.3390/sym17122181
Chicago/Turabian StyleMailland, David, and Iwona Grobelna. 2025. "From Mathematics to Art: Modelling the Pascal’s Triangle with Petri Nets" Symmetry 17, no. 12: 2181. https://doi.org/10.3390/sym17122181
APA StyleMailland, D., & Grobelna, I. (2025). From Mathematics to Art: Modelling the Pascal’s Triangle with Petri Nets. Symmetry, 17(12), 2181. https://doi.org/10.3390/sym17122181
