Note: all this is contingent on the correctness of Xenocidius's simulator.
I'm a bit surprised this hasn't come up, since it's actually not that difficult a problem to solve directly. Why bother? One, it's much faster than running a high number of trials, and two, it has zero variance. Essentially, what the simulator does is select 4 cards from the deck, rejecting pillars in the first eight iterations, then spin using that smaller pool.
Let's make a first approximation by ignoring the chance of getting pillars altogether. To make the math that follows more concise, I'm going to define the following:
P(N, p, k) = (N choose k) * p
k * (1-p)
N-k = Prob(X=k) for X ~ Binom(N,p)
(look up binomial distribution on wikipedia for more info)
The notation that follows could use some work, but meh.
The probability of a given card appearing k times in the 4 slots is P(4, n/N, k), for n = number of given card in deck, N = total cards in deck.
If said card shows up k times in the pool, then we have a probability (k/4)
3 of getting that card on any given spin (since the card needs to come up exactly 3 times). It should be intuitive that the total probability of getting a card from a given spin is the sum from k=1 to 4 (technically 0 to 4, but that first term is 0) of the product of these to terms, i.e.
A := \sum
k=04 P(4, n/N, k) * (k/4)
3Repeat for each card in the deck.
Simply applying this formula to the first deck in
the AI3 Droprate Tests thread in the Farming Studies / Statistics subforum [nofollow], we get the following results:
Card | Expected | Simulator results |
Lightning | 0.0432 | 0.042 |
Parallel Universe | 0.0236 | 0.023 |
Immortal | 0.0236 | 0.023 |
Dimensional Shield | 0.0997 | 0.097 |
Lobotomizer | 0.0236 | 0.024 |
Phase Dragon | 0.0432 | 0.043 |
Phase Spider | 0.0685 | 0.067 |
Mindgate | 0.0685 | 0.067 |
Silence | 0.0236 | 0.023 |
As a first approximation, this is very good, although you'll notice that it's a bit optimistic overall, since I've assumed that pillars won't appear in the pool.
So what happens if we add back p pillars? This part gets a bit more complicated, although we can still explicitly solve it without even resorting to more complicated mathematical constructs like Markov chains.
Let's start by considering 4 additional events E
5 through E
8, corresponding to 5-8 pillars out of first 8 cards chosen.
Event E
i simply appears with probability P(8, p/(N+p), i).
Given event E
i, the probability that a given non-pillar card appears k times looks like:
\sum
j=0k P(8-i, n/N, j) * P(i-4, n/(N+p), k-j)
(win j copies of the card in the first 8, then k-j copies in the remaining trials)
Similarly, the probability that a given pillar card appears k times is:
P(i-4, n/(N+p), k)
Let's assemble all these parts now. The probability of winning a card that appears n times in a deck with N non-pillars and p pillars is
(1 - \sum
i=58 P(8, p/(N+p))) * A + \sum
i=58 P(8, p/(N+p), i) \sum
k=04 (k/4)
3 \sum
j=0kP(8-i, n/N, j) * P(i-4, n/(N+P), k-j)
if the card is not a pillar, and
\sum
i=58 \sum
k=04 P(8, p/(N+p), i) * P(i-4, n/(N+P), k)
if it is.
This final formula (as evaluated by the below javascript code) yields the following results on that same ai3 deck:
Card | Expected | Simulator results |
Aether Pillar | 0.0038 | 0.004 |
Lightning | 0.0423 | 0.042 |
Parallel Universe | 0.0232 | 0.023 |
Immortal | 0.0232 | 0.023 |
Dimensional Shield | 0.0973 | 0.097 |
Lobotomizer | 0.0232 | 0.024 |
Phase Dragon | 0.0423 | 0.043 |
Phase Spider | 0.0669 | 0.067 |
Mindgate | 0.0669 | 0.067 |
Silence | 0.0223 | 0.023 |
Hope someone finds this at least entertaining.
function choose(n,k) {
var ret = 1;
for (var i = 0; i < k; i++) {
ret = ret * (n - i) / (k - i);
}
return ret;
}
function prob(N, p, k) {
// binomial pdf with parameters N, p
return choose(N,k) * Math.pow(p, k) * Math.pow(1 - p, N-k);
}
function pillarless_yields(n, N) {
var sum = 0;
for (var i = 0; i <= 4; i++) {
sum += Math.pow(i/4, 3) * prob(4, n/N, i);
}
return sum;
}
function yields(n, N, P, pillar) {
// pillar is true if this item is a pillar.
var psum = 0;
var sum = 0;
for (var i = 5; i <= 8; i++) {
var p = prob(8, P/(N+P), i);
psum += p;
for (var k = 0; k < 4; k++) {
if (!pillar) {
for (var j = 0; j <= k; j++) {
sum += p * Math.pow(k/4, 3) * prob(8-i, n/N, j) * prob(i-4, n/(N+P), k-j);
}
} else {
sum += p * Math.pow(k/4, 3) * prob(i-4, n/(N+P), k);
}
}
}
if (!pillar) {
sum += pillarless_yields(n, N) * (1-psum);
}
return sum;
}
// These are the distribution of cards in the ai3 aether deck.
var arr = [3,2,2,5,2,3,4,4,2];
console.log(arr.map(function (x) {return 3*yields(x, 27, 15, false);}).join('\n'));;
console.log(3*yields(15, 27, 15, true));