| + | I think I calculated the expected number of mushrooms spawned per number of trees in the 7x7 square. random.Next maxvalue is exclusive, so random nr is either 1 or 2. n_trees/2 is rounded towards 0 (integer division). So n_trees/2 is [0,0,1,1,2,2,3,3,4,4,5] for 0 throuh 10 n_trees. With random.Next(1,3) equal to 1 and 2 respectively, we have [1,1,1,1,2,2,3,3,4,4,5] and [1,1,2,2,4,4,5,5,5,5,5] mushrooms produced. Hence the expected value of the number of mushrooms for 0 to 10 trees is [1,1,1,1,2,2,3,3,4,4,5] + [1,1,2,2,4,4,5,5,5,5,5] / 2 = [1,1,1.5,1.5,3,3,4,4,4.5,4.5,5]. So interestingly, due to the rounding down towards 0 in the integer division, 3, 5, 7, and 9 trees do not add any benefit to the number of mushrooms when compared to 2, 4, 6, and 8 trees in the 7x7 square. [[User:Lc-hobby|Lc-hobby]] ([[User talk:Lc-hobby|talk]]) 12:53, 19 April 2024 (UTC) |