Original Post — Direct link

I wrote a Matlab code to simulate the average number of barrows runs needed to obtain all 24 uniques and ran it for 100,000 trials. This assumes 6 brothers runs.

Average number of chests: 1255
Average number of items: 75

Note: these use the geometric mean which is more appropriate for skewed data sets.

https://preview.redd.it/b5pienrlcjw41.jpg?width=1322&format=pjpg&auto=webp&s=8a1c68e96a682fc6e3eda3369cd3b8f3804dea83

Code:

N = 100000;

Trials = zeros(N,25);

for ii = 1:N
step = 0;
while all(Trials(ii,1:24)) == 0
A = randi([1,2448],1,7);
for jj = 1:7
if A(jj) <= 24
Trials(ii,A(jj)) = Trials(ii,A(jj)) + 1;
end
end
step = step +1;
end
Trials(ii,25) = step;
end

X = Trials(:,25);
Avg = geomean(X);
histogram(X,50)
hold on
xline(Avg,'-b','Geometric Mean')
hold off

External link →
over 4 years ago - /u/Mod_Kieren - Direct link

This is awesome! I remember messing around in MatLab during my maths degree on things like this!

I'd like to extend the maths challenge to calculate the average number of chests to obtain any 1 full Barrows set.