Skip to content
m·amathatlas
ExploreAboutOpen problemsCited authorsMy libraryFeedback
Sign in
FRENES
Loading views…Recent views only, across all languages. Vercel history is unavailable for this page. Repeat visits in the same tab are grouped for 30 minutes.
ShareLinkedInXFacebookWhatsApp
← All open problems
Unanswered question

Computing distribution of non-identical coin flips

Probability & statistical mechanicsTheoretical computer science

Imported on November 28, 2026

The forum classified this question as unanswered when collected. This does not certify an open research problem; check the answers and revision history at the source.

Read the question with its definitions and background below. The source provides the full formulation and further discussion; the glossary and Wikipedia links offer additional reading aids.

Problem statement

Suppose I have NNN coins, where coin iii has probability pip_ipi​ of coming up heads. I flip all NNN coins and let SNS_NSN​ be the number of heads. How can I compute the distribution of SNS_NSN​ efficiently?

To be a bit more precise, we are considering the sum of NNN independent, not-necessarily-identically distributed Bernoulli random variables; this distribution is called a Poisson binomial distribution. Let Xi=(xi,0,xi,1...,xi,i)X_i=(x_{i,0},x_{i,1}...,x_{i,i})Xi​=(xi,0​,xi,1​...,xi,i​) be the distribution of the sum of the first iii coins, where xi,jx_{i,j}xi,j​ is the probability that the sum is jjj. We are trying to compute XNX_NXN​ efficiently.

It's pretty easy to compute this distribution in O(N2)O(N^2)O(N2) time as follows. Note that X1=(p1,1−p1)X_1=(p_1,1-p_1)X1​=(p1​,1−p1​). Note also that Xi+1X_{i+1}Xi+1​ can be computed by convolving XiX_{i}Xi​ with (pi+1,1−pi+1)(p_{i+1},1-p_{i+1})(pi+1​,1−pi+1​), which takes O(N)O(N)O(N) steps. So, XNX_NXN​ can be computed recursively in O(N2)O(N^2)O(N2) steps.

However, we can do better. Suppose N=2nN=2^nN=2n is a power of two. (If we not, we can pad and reduce to this case.) We begin with NNN distributions over {0,1}\{0,1\}{0,1}, one for each XiX_iXi​. We convolve these distributions in pairs to get N/2=2n−1N/2=2^{n-1}N/2=2n−1 distributions over {0,1,2}\{0,1,2\}{0,1,2}. After repeating this process for nnn steps, we will have convolved all the distributions to recover XnX_nXn​. Using a discrete Fourier transforms, a convolution of two length kkk vectors can be computed in O(klog⁡(k))O(k \log (k))O(klog(k)) steps. Combining a binary tree structure and DFTs, I believe the overall complexity of computing XNX_NXN​ is O(Nlog⁡2(N))O(N \log^2(N))O(Nlog2(N)).

Can this be improved? Specifically, can it be done in O(Nlog⁡(N))O(N \log(N))O(Nlog(N)) time?

The only reference I've stumbled on for this question so far is Chen, S. X.; J. S. Liu (1997). "Statistical Applications of the Poisson-Binomial and conditional Bernoulli distributions". I believe that that paper only mentions algorithms with complexity O(N2)O(N^2)O(N2) or worse.

Statement and context adapted from MathOverflow · Bill Bradley

CC BY-SA 3.0 · Formatting adapted; mathematical formulas preserved · Source history

Topics : computational-complexity · probability-distributions · convolution

Authors listed by the source : Bill Bradley

Sources and original status

  • MathOverflow Status in source : unanswered at collection

Last activity on the question : June 14, 2017

Coverage, sources and method

This count measures imported entries, including distinct variants. It is not a count of all open mathematical questions worldwide. One entry may belong to several fields and sources.

This directory is neither exhaustive nor updated in real time. “Reported open” describes the source classification observed at import; imported entries have not each undergone independent mathematical verification. The 32 explained entries were reviewed separately.

Formal Conjectures: only “research open” statements with no reported formal proof are retained; their tag is checked in a pinned repository revision. Variants remain distinct. A “sorry” placeholder is not sufficient to establish open status.

Erdős: solved or independent problems and entries with a Lean solution are excluded, including “open (Lean)”. Exact matches to the main Formal Conjectures statements are merged.

Open Problem Garden: the open index is checked against the solved index; spam, identified clones and some outdated statuses are excluded. Statements and definition context are attributed to their original pages; formulas are preserved and the content remains under the GFDL. Recognized duplicates across sources are merged; this does not resolve every mathematical equivalence.

OEIS: direct extraction of conjectural comments and formulas, one entry per sequence, excluding mentioned resolutions. MathOverflow and Math Stack Exchange: questions classified as unanswered by their API, excluding closed posts and non-research categories. They remain distinct from problems reported open. This is a partial, dated collection; every entry credits its authors and license.

Documented exclusions account for recent announcements and conflicting statuses. A stronger variant or a special case can remain open after a different statement is settled.

Attribution: The Formal Conjectures Authors; teorth/erdosproblems and contributors; Open Problem Garden and contributors. Each source retains its license.

  • Formal Conjectures · 1,924 · Apache-2.0 / CC-BY-4.0
  • Erdős Problems (teorth) · 622 · Apache-2.0
  • Open Problem Garden · 404 · GFDL (source content); only title/category/link metadata imported
  • OEIS · 18,857 · CC BY-SA 4.0
  • MathOverflow · 19,035 · CC BY-SA (version on each entry)
  • Mathematics Stack Exchange · 35 · CC BY-SA (version on each entry)
Report a development or correction
mathatlas

An independent atlas to understand, read, and question research.

The papers present claimed results at different stages of verification.
NewsletterShare feedbackAbout Data and privacy
Created by Sonny Mupfuni