0
$\begingroup$

Suppose $$ X_i \sim \text{Bernoulli }(p) $$ What can be said about the distribution of $Y$, given by $$ Y = \sum_{i=1}^N w_i X_i $$ for non-negative weights $w_i$? Note that $N$ here is small, so that no form of the CLT may be applied. I know, from this question, that this is a Poisson Binomial distribution if $w_i=1$, $\forall i$, but my question differs in the fact that I'm taking the same probability $p$ for all $i$.

$\endgroup$
6
  • $\begingroup$ You mention "Poisson Binomial". Is $N$ given, or is it a random variable? $\endgroup$
    – Henry
    Mar 29, 2022 at 14:50
  • $\begingroup$ @Henry $N$ is given. $\endgroup$
    – sam wolfe
    Mar 29, 2022 at 14:51
  • $\begingroup$ For small $N$, say up to $20$, and knowing $p$ and the $w_i$, and that the $X_i$ are independent, it would be easy enough to calculate the exact distribution $\endgroup$
    – Henry
    Mar 29, 2022 at 14:55
  • 1
    $\begingroup$ "What can be said" is awfully vague and broad. What do you want to know about this distribution specifically? $\endgroup$
    – whuber
    Mar 30, 2022 at 15:38
  • 1
    $\begingroup$ If you post the same question simultaneously on multiple forums, it's good form to mention that in the question. Otherwise, if the answer or instructive comments on one forum aren't known on the other forum, you'll be wasting the time of the experts from which you're asking for help: math.stackexchange.com/questions/4415458/…. $\endgroup$
    – JimB
    Mar 30, 2022 at 16:54

1 Answer 1

1
$\begingroup$

Because you have access to Mathematica, here are two possible approaches:

n = 4;

t = Tuples[{0, 1}, {n}]
(* {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 1, 0, 0}, 
    {0, 1, 0, 1}, {0, 1, 1, 0}, {0, 1, 1, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, 
    {1, 0, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}, {1, 1, 1, 0}, 
    {1, 1, 1, 1}} *)

ss = Table[w[i], {i, n}] . # & /@ t
(* {0, w[4], w[3], w[3] + w[4], w[2], w[2] + w[4], w[2] + w[3], 
    w[2] + w[3] + w[4], w[1], w[1] + w[4], w[1] + w[3], 
    w[1] + w[3] + w[4], w[1] + w[2], w[1] + w[2] + w[4], 
    w[1] + w[2] + w[3], w[1] + w[2] + w[3] + w[4]} *)

prob = p^Total[#] (1 - p)^(n - Total[#]) & /@ t
(* {(1 - p)^4, (1 - p)^3 p, (1 - p)^3 p, (1 - p)^2 p^2, (1 - p)^3 p, (1 - p)^2 p^2,
    (1 - p)^2 p^2, (1 - p) p^3, (1 - p)^3 p, (1 - p)^2 p^2, (1 - p)^2 p^2, 
    (1 - p) p^3, (1 - p)^2 p^2, (1 - p) p^3, (1 - p) p^3, p^4} *)

pmf = Transpose[{ss, prob}];
TableForm[pmf, TableHeadings -> {None, {"Y", "Probability"}}]

Table of values and associated probabilities

If the values of $Y$ are not all unique (i.e., w[3]+w[4] == w[1]+w[2] for example), then you'd want to "condense" the above table. Suppose w[i] = i:

TableForm[
 Sort[{#[[1, 1]], Total[#[[All, 2]]]} & /@ GatherBy[pmf /. w[i_] -> i, First] // 
   Simplify, #1[[1]] < #2[[1]] &],
 TableHeadings -> {None, {"Y", "Probability"}}]

Probability table for a specific set of weights:  w[i]=i

An alternative approach with known weights:

n = 4;

dist = TransformedDistribution[Sum[w[i] x[i], {i, n}], 
   Table[x[i] \[Distributed] BernoulliDistribution[p], {i, n}], 
   Assumptions -> 0 < p < 1];

Table[{k, PDF[dist /. w[i_] -> i, k] // Simplify}, {k, 0, n (n + 1)/2}]
(* {{0, (-1 + p)^4}, {1, -(-1 + p)^3 p}, {2, -(-1 + p)^3 p}, {3, (-1 + p)^2 p},
    {4, (-1 + p)^2 p}, {5, 2 (-1 + p)^2 p^2}, {6, -((-1 + p) p^2)}, 
    {7, -((-1 + p) p^2)}, {8, -((-1 + p) p^3)}, {9, -((-1 + p) p^3)}, {10, p^4}} *)

This last approach is much, much slower.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.