Hi! On my survival SMP, I'm trying to make a diamond ore store. I have one part, where you buy one ore for 3 diamonds, so there is a 40% chance you endure no losses and a 20% chance you profit. I also want to have a bulk buying area. In this area, you would purchase 8 diamond ore for 20 diamonds. I am trying to find the odds that you make back your 20 diamonds exactly, and I'm trying to find the odds that you profit. Any help would be massively appreciated. Thank you!!!

The Meaning of Life, the Universe, and Everything.

Join Date:
12/24/2018

Posts:
46

Member Details

That's a really tough one, had to ask someone with a maths degree for help.

The answer should be 19.2%

-> That also includes the durability losses from mining an extra 8 diamond ores

The code I got back is this:

import random
b = 3000000
d = 0
for g in range(b):
z = 0
for x in range(8):
y = random.randint(1,5)
if y == 1 or y == 2:
z += 1
elif y == 3:
z += 2
elif y == 4:
z += 3
elif y == 5:
z += 4
if z >= (20 + 24/1562):
d += 1

print(d/b)

Rollback Post to RevisionRollBack

To post a comment, please login or register a new account.

Hi! On my survival SMP, I'm trying to make a diamond ore store. I have one part, where you buy one ore for 3 diamonds, so there is a 40% chance you endure no losses and a 20% chance you profit. I also want to have a bulk buying area. In this area, you would purchase 8 diamond ore for 20 diamonds. I am trying to find the odds that you make back your 20 diamonds exactly, and I'm trying to find the odds that you profit. Any help would be massively appreciated. Thank you!!!

Helpful Information:

Fortune III odds

40% to have x1

20% to have x2

20% to have x3

20% to have x4

That's a really tough one, had to ask someone with a maths degree for help.

The answer should be

19.2%-> That also includes the durability losses from mining an extra 8 diamond ores

The code I got back is this: