compute p-value number of occurrence in different samples I'm wondering how I could compute a p-value for this kind of analysis.
Let's say I've 5 boxes. Each box is made with the same 100 cases (numbered 1 to 100). In each of these 5 boxes some cases are black and some are white. In general most of the cases are white. The number of black cases is not equal across boxes. 
My goal is to detect over-represented black cases (so the same case number) within these 5 boxes and to compute a p-value for each case number.
It's quite easy to compute the number of occurrences of "black" event for each case number. In this example it's between 0 (the case is white in all 5 boxes) and 5 (the case is black in all 5 boxes).
Here's one example with 5 boxes containing 4 cases each. 
[-] = white ;
[x] = black
        1  2  3  4 
Box1 : [x][-][x][-]
Box2 : [-][x][x][-]
Box3 : [-][-][x][x]
Box4 : [-][-][x][x]
Box5 : [-][-][-][-]

When I translate that to number of occurence by case position :
pos occurence
1           1
2           1
3           4
4           2

In this example, position 3 is the case found in 80% of the boxes. Thus this position should be enriched compared to random. Now how can I compute a p-val for each of these position knowing this distribution.
 A: Each case is essentially a sequence of 5 black/white independent trials. There are 100 cases. You assume all cases should have the same probability for black except a few "outliers" you want to detect. These outliers are believed to have a higher probability for black.
You can consider each case (that is not an outlier) has a binomial distribution with parameter $B(5,f)$ where $f$ is unknown but fixed.
If $f$ was known (say 0.2 corresponding to 1 black per case in average), then you could easily compute a p-value of $k$ blacks: it is the probability that the binomial $B(f,5)$ is at least $k$. For example, with $k=4$, it is $\binom{5}{4}f^4(1-f)+\binom{5}{5}f^5=0.67\%$. With $f=0.2$ here is the p-value table:
                                                       

If $f$ is unknown then you need to estimate it. If you consider your outliers are so rare that their influence would be negligible on the average, then you could just compute the average frequency over all cases: numbers of blacks divided by 500.
If you can't consider this, then it becomes a rather difficult problem. One possibility is a hidden variable model (mixture) involving something like expectation/maximization to solve. But I think this would lead us too far.
