[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83615-en":3,"doc-seo-83615-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83615,16904993612988,"Olivia Brown","https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd",8,"Research & Report","On the Algebraic Analysis of Runtime Distribution of Probabilistic Programs","An algebraic framework analyzes runtime distributions of probabilistic programs in the Generalized Constant Probability (GCP) format, which use a counter and a state variable updated probabilistically in a regime-dependent way. Program semantics are defined through weighted runs of an associated type of probabilistic pushdown automaton (pPDA), yielding a (sub-)probability generating function (pgf) whose coefficients give exact loop-iteration probabilities. The pgf is shown to be algebraic and characterized via kernel-polynomial roots, enabling dominant singularity, radius of convergence, and exact asymptotic expansions with exponential coefficient tail bounds. Soundness holds for GCP and completeness for the single-state subclass.","arXiv :2607 .0 1856v2 [ cs .FL] 5 Jul 2026  \nOn the algebraic analysis of runtime distribution of probabilistic programs  \nMichele Borealea,∗ , Luisa Collodia and Alessandro Pompa Di Gregorioa  \na Università degli Studi di Firenze, Italy  \n\n| ARTICLE INFO |  | AB STRACT |\n| --- | --- | --- |\n| Keywords:\u003Cbr>Probabilistic programming running time\u003Cbr>tail bounds\u003Cbr>generating functions kernel method |  | We present an algebraic method for analyzing probabilistic programs with counters and discrete states, Generalized Constant Probability (GCP) programs. We define the operational semantics of GCP in terms of the runs of a type of probabilistic pushdown automata (pPDAs) . We characterize the resulting (sub-)probability generating function (pgf) Δ(􀁺) as an algebraic function, representable via the roots of a kernel polynomial associated with the program. Next, we provide algorithms that, leveraging this information, compute under mild algebraic conditions the dominant singularities and the exact radius of convergence of Δ(􀁺), leading to an exact asymptotic expansion and to exponential bounds for its coefficients. Our approach is sound for GCP programs and complete for the single-state subclass. |\n\n1. Introduction  \nMuch research effort has been devoted to methods for analyzing termination and running time of probabilistic programs. For almost-sure termination, a wide range of techniques, based on e.g. ranking supermartingales, have been proposed—see e.g. [1, 9, 13] and references therein. For expected running time, proof systems and algorithms have been put forward for specific classes of programs, often with the goal of obtaining upper bounds, see e.g. [25, 16, 19] . All these techniques are necessarily incomplete, as the termination problem is undecidable in general.  \nBeyond almost-sure termination and bounds on expectation, one often needs more precise analytic information about the probability distribution of running time, such as its asymptotic behaviour and sharp (exponential) boundson its tails. Identifying an interesting class of programs for which this information can be obtained algorithmically is the goal of the present paper. We target programs featuring both a counter 􀁤 and a state variable 􀁱 that can be updated probabilistically. An example is shown in Listing 1 (our running example) . In essence, we allow for different regimes of  \nwhile ( 􀁤 ≥ 0 ){  \nif ( 􀁱 = 1 ) then  \n{ 12 : 􀁤 ∶= 􀁤 + 1 ; 􀁱 ∶= 2 [] 12 : 􀁤 ∶= 􀁤 − 1 ; 􀁱 ∶= 1 }  \nelse  \n{ 23 : 􀁤 ∶= 􀁤 + 1 ; 􀁱 ∶= 1 [] 16 : 􀁤 ∶= 􀁤 − 2 ; 􀁱 ∶= 2 [] 16 : 􀁤 ∶= −1 }}  \nListing 1: Running Example.  \nprobabilistic updates for 􀁤 and 􀁱, depending on the current value of 􀁱. This format generalizes the Constant Probability (CP) programs of [16], so we refer to it as the Generalized Constant Probability (GCP) format.  \nOur analysis of GCP programs follows a distinctively algebraic approach. We define the semantics of a program directly via the weighted runs of its associated PDA, obtaining a (sub-)probability generating function (pgf) 􀁦 (􀁺) =∑􀁮≥0 􀁰 􀁮􀁺􀁮 whose coefficients 􀁰 􀁮 give the probability that the program executes exactly 􀁮 loop iterations. We then leverage tools from analytic combinatorics [15] to analyze such pgf’s. We decompose and analyze them in terms of runs of a probabilistic PDA, in turn equivalent to a type of random walks in ℤ2 called meanders [15, 3] . This way,  \n∗Corresponding author  \n [michele.boreale@unifi.it](michele.boreale@unifi.it) (M. Boreale); [luisa.collodi@unifi.it](luisa.collodi@unifi.it) (L. Collodi); [alessandro.pompa@edu.unifi.it](alessandro.pompa@edu.unifi.it) (A. Pompa Di Gregorio)  \n (M. Boreale); (L. Collodi); (A. Pompa Di Gregorio) ORCID(s):  \n1  \nAlgebraic analysis of probabilistic programs  \nwe prove that 􀁦 (􀁺) is an algebraic function, characterized via the roots of a kernel polynomial 􀁋 (􀁺, 􀁵) . Analyzing 􀁋 (􀁺, 􀁵), we can under mild algebraic conditions compute the radius of convergence 􀁒 of 􀁦(􀁺) and its singularities of minimal modulus (do","cbCaiuyHaxDXq8Vh","https://ap.wps.com/l/cbCaiuyHaxDXq8Vh","pdf",628271,3,1,21,"English","en",105,"# Introduction\n## Termination and running-time analysis\n## Beyond expectation: distribution and tail behavior\n## GCP programs and operational semantics","[{\"question\":\"What class of probabilistic programs does the paper analyze, and what makes them special?\",\"answer\":\"It analyzes Generalized Constant Probability (GCP) programs featuring both a counter and a state variable updated probabilistically depending on the current state. This format generalizes Constant Probability (CP) programs by allowing multiple probabilistic regimes.\"},{\"question\":\"How is the runtime distribution represented in the proposed method?\",\"answer\":\"The runtime is encoded by a (sub-)probability generating function (pgf) where coefficients give the probability of executing exactly m loop iterations. The pgf is derived from weighted runs of a probabilistic pushdown automaton (pPDA) corresponding to the program semantics.\"},{\"question\":\"What key analytic result enables asymptotic and tail analysis?\",\"answer\":\"The pgf is proven to be an algebraic function characterized through the roots of a kernel polynomial linked to the program. From this kernel information, dominant singularities and the radius of convergence can be computed, yielding exact asymptotic expansions and exponential bounds for coefficients.\"}]",1784189288,53,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"on-the-algebraic-analysis-of-runtime-distribution-of-probabilistic-programs","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/on-the-algebraic-analysis-of-runtime-distribution-of-probabilistic-programs/83615/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-26","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What class of probabilistic programs does the paper analyze, and what makes them special?","Question",{"text":75,"@type":76},"It analyzes Generalized Constant Probability (GCP) programs featuring both a counter and a state variable updated probabilistically depending on the current state. This format generalizes Constant Probability (CP) programs by allowing multiple probabilistic regimes.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How is the runtime distribution represented in the proposed method?",{"text":80,"@type":76},"The runtime is encoded by a (sub-)probability generating function (pgf) where coefficients give the probability of executing exactly m loop iterations. The pgf is derived from weighted runs of a probabilistic pushdown automaton (pPDA) corresponding to the program semantics.",{"name":82,"@type":73,"acceptedAnswer":83},"What key analytic result enables asymptotic and tail analysis?",{"text":84,"@type":76},"The pgf is proven to be an algebraic function characterized through the roots of a kernel polynomial linked to the program. From this kernel information, dominant singularities and the radius of convergence can be computed, yielding exact asymptotic expansions and exponential bounds for coefficients.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]