Probability mass function of poisson binomial distribution I'm trying to write a program that calculates the PMF of a Poisson Binomial Distribution. I know there are libraries that have all sort of probability distribution functions, but I'm doing this just for the learning.
I've experience programming but the part I need help with is the math symbols in this equation:

(wikipedia article)
Here I understand sigma it's the summation symbol, and uppercase pi (Π) is the product operator in mathematics. But I'm used to see numbers below and above those symbols that indicate the range of the summation or product.

But in the formula from Wikipedia I don't understand what is the range of the summation or product.
Thank you in advance for any help you can provide.
 A: *

*$i \in A$: $A$ is a particular collection of indices for which the event occurred,.  For example, if we have five trials, the "event" occurred on three of them, and the first, fourth, and fifth trials were the ones on which the three events occurred, $A = \{1, 4, 5\}$.  We multiply the associated probabilities $p_i$ together.  $i$ refers to the individual indices within $A$.

*$j \in A^c$: $A^c$ is the complement of $A$, i.e., the collection of indices for which the event did not occur, e.g., to continue the previous example, if we have five trials and $A = \{1,4,5\}$, $A^c = \{2, 3\}$.  We multiply the associated probabilities of the event not occurring $(1-p_j)$ together.  $j$ refers to the individual indices within $A^c$.

*$A \in F_k$. If $K=k$, that means $k$ events occurred.  However, which $k$ is unknown, so you have to sum over all possible arrangements of the $k$ events occurring in the $n$ total trials.  $F_k$ refers to all possible arrangements of indices for which $k$ events (out of $n$ trials) occurred.
The number of indices in $A$ and the number of indices in $A^c$ must add up to the total number of trials $n$.
For example, say $n=3$ and $k=2$:
$$F_k = \{(1,2), (1,3), (2,3)\}$$
as these are all the ways two out of the three trials can have events - the first and second, the first and third, or the second and third.
$$A \in F_k: A = (1,2) \text{ or } A = (1,3) \text{ or } A = (2,3)$$
$$i \in A:  \text{ if }A = (1,2), \text{ then } i \text{ iterates over } (1,2)$$
$$j \in A^c: \text{ if }A = (1,2), \text{ then } A^c = 3, \text{ so } j = \text{ only }3$$
The outer sum iterates over the (three in this case) elements of $F_k$.  The $i$ loop iterates over the elements of whichever $A$ the outer sum is at at the moment, and the $j$ loop iterates over the elements of $A^c$, which are defined as whatever isn't in $A$.
