Talk:Chest loot/Archive 1

Method?
Hello, I was wondering how the values on the page were calculated. I got somewhat different ones.

My method was as follows:

And god bless you if you follow that. I only describe it so that maybe a person can qualitatively say whether I'm down the wrong path or not.

And you know, I wanted to know if there was an easier way, or what your way was,. – Sealbudsman (Aaron) t/c 06:33, 26 May 2015 (UTC)


 * , would you perhaps be able to comment? –Goandgoo ᐸ Talk Contribs 09:20, 27 May 2015 (UTC)
 * The data on pages like Dungeon and Stronghold was taken from the code of the game. I'm too tired right now to do the math myself to see whether the table on this page is correct or not or whether Sealbudsman is on the right track, or even to try to figure out whether it's actually useful to say you'll get an average of 0.652 bread per dungeon chest over the long term versus just stating the stacks per chest and the weights and quantities of the possible items. Anomie x (talk) 12:14, 27 May 2015 (UTC)
 * I personally find calculated values like 'chance to get at least one of this item' (from pages like Dungeon and Stronghold) and 'expected number of this item per chest' (from this page) to be more directly useful than the raw stack sizes and weights -- for example when considering which kind of chests I might look in for a certain item, which is something I might do during gameplay.
 * Anyway all I really want to know from Seahen is, how Seahen got those numbers. Ideally, I just think if those numbers are going to be there, and updated as the game changes, the method of calculating them ought to be spelled out somewhere like on this talk page.  And right now I would just like to audit the page, but am finding it difficult.  I could be totally trying to do it conceptually wrong, the long way, or anything.  Nobody's shortcoming but my own, I'm sure, but I am just hoping we could eventually put together a bit of documentation. – Sealbudsman (Aaron) SealbudsmanFace.png t/c 15:11, 27 May 2015 (UTC)
 * My method was to take the average number of stacks per chest as the middle of the range (except for the dungeon chest, since that's documented as filling 8 slots chosen with replacement and then deduplicated, for which I used a specific formula from here with n=27, k=8). Then I took the average number of items per stack as the middle of its range, and the probability of each specific item per stack (given in each structure's article). Then I multiplied all three numbers together:
 * Copies of item A per chest = copies of item A per stack of item A × stacks of item A per stack of anything (i.e. probability that a given stack is of item A) × stacks of anything per chest
 * (Note that enchanted books in a village library chest are unstacked after they're generated.) I believe Sealbudsman's error is assuming that 2 stacks of the same item are just as likely as 1 stack of that item; that would be the case if the probability and then the number of stacks were rolled separately for each item (which would result in some chests generating empty and others overspilling, because no items or too many items had happened to be chosen). Seahen (talk) 06:56, 10 June 2015 (UTC)


 * Great to hear from you. Thanks so much.  I think my biggest problem was a failure to recognize that if you're trying to come up with the average number of items when using two random variables, you just need to multiply both averages, as I think you are describing.  My method was pretty unusably convoluted, although your method gets the same numbers as I get.
 * For instance, iron ingots in a village chest, the chest fills from 3 to 8 stacks, and iron ingots come in stacks of 1 to 5, with a weight of 10/94. So that, given your method (as I understand it), is (1+5)/2 × 10/94 × (8+3)/2 = 3 × ~0.106 × 5.5 ~= 1.755
 * Whereas you have it on the table as 1.350. Am I misunderstanding you? – Sealbudsman (Aaron) SealbudsmanFace.png t/c 02:36, 11 June 2015 (UTC)
 * It looks like the source table, at least for village chests, has changed since I made the table. (It used to be probability per slot, with the number of slots uniformly distributed within a range.) I'll re-read the relevant articles and either update my calculations or explain the discrepancy over the weekend. Seahen (talk) 05:42, 12 June 2015 (UTC)
 * And I'll double check the tables for accuracy this weekend. – Sealbudsman (Aaron) SealbudsmanFace.png T/C 14:54, 12 June 2015 (UTC)