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!!!
As I see it each ore has 5 equally likely outcomes (20% each).
1, 1, 2, 3, 4
The two 1's are of course the same outcome with a 40% chance but splitting them up should simplify the problem.
Since there are 8 ores that's 40 (8*5) equally likely outcomes at 2.5% each.
"All" one has to do is list all 40, count how many are in each category and calculate the odds for each category by multiplying the number by 2.5
I must have missed something, I started listing them and it's going to be a bunch more than 40.
Maybe it is 40 after all, it makes a difference between if you say there are 4 1's and 4 2's or if you say exactly which ores are 1's and which are 2's, in this case we don't care which ore is which, just how many diamonds we get.
Sorry, I think it's too late at night for me to remember how to do this.
Yeah, listing them they way I was going to is not so practical, I think it would give 3125 combinations.
You have a 19% chance to profit and 9% to break even, 28% for either case:
Probability of getting exactly 20 diamonds from 8 ore is 8.94005%
Probability of getting more than 20 diamonds from 8 ore is 19.14801%
Probability of getting at least 20 diamonds from 8 ore is 28.08806%
Rather than trying to calculate it I just wrote a simple program that calculated it for me; the probabilities are the results of 10 million runs so they should be pretty much exact:
private static void diamondPayback()
int count20exact = 0;
int count20plus = 0;
int runs = 10000000;
for (int i = 0; i < runs; ++i)
int count = 0;
for (int j = 0; j < 8; ++j)
// Equivalent to Fortune III (1,1,2,3,4)
count += Math.max(1, rand64.nextInt(5));
if (count == 20) ++count20exact;
if (count > 20) ++count20plus;
System.out.println("Probability of getting exactly 20 diamonds from 8 ore is " + (float)((double)count20exact / (double)runs * 100.0D) + "%");
System.out.println("Probability of getting more than 20 diamonds from 8 ore is " + (float)((double)count20plus / (double)runs * 100.0D) + "%");
System.out.println("Probability of getting at least 20 diamonds from 8 ore is " + (float)((double)(count20exact + count20plus) / (double)runs * 100.0D) + "%");