Oh you...
Unfortunately I'm not kidding. The +11->+12 upgrade can be modeled as a Markov chain with these states and transitions.
Calculating where you'll be after 647 transitions is straightforward:
octave:1> A = [ .9 .1 0; .9 0 .1; 0 0 1 ]
A =
0.90000 0.10000 0.00000
0.90000 0.00000 0.10000
0.00000 0.00000 1.00000
octave:2> A^647
ans =
0.00237 0.00024 0.99739
0.00215 0.00022 0.99763
0.00000 0.00000 1.00000
Reading from the second row:
+10 0.215%
+11 0.022%
+12 99.763%
So that's a 0.237% chance of failure after 647 attempts, which is an order of magnitude more likely than a card drop. You're telling us that in 500000 trials, not once did you exceed 647 attempts. The probability of this occurring is 5.6x10^-516, or 0.0000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000056%
I think it's more likely that there's something wrong with your simulation.
This is assuming that your 647 is indeed for +11 to +12. It might actually be for +10 to +12 (
since your page says least=2), in which case a maximum of 647 is
even more unlikely.
(You also have least=40 for +13. Getting three successes in a row at 10% is 0.1%. You weren't able to hit a 1/1000 once in 500000 tries? Really?)
In contrast, here's a simulation that's easy to understand:
$ cat sim1.lua
local print = print
local random = math.random
local function upgrade()
local level = 11
local count = 0
while level < 12 do
count = count + 1
if random(10) == 1 then
level = level + 1
elseif level ~= 10 then
level = level - 1
end
end
return count
end
math.randomseed(os.time())
local fail = 0
for i = 1, 500000 do
if upgrade() > 647 then fail = fail + 1 end
end
print(fail)
$ luajit sim1.lua
1220
1220/500000 = 0.244%
Then there's the matter of average number of ores used. The actual expected values, given by a simple recurrence relation, are:
+10 -> +11 => 10 (10 from +10)
+11 -> +12 => 100 (110 from +10)
+12 -> +13 => 910 (1020 from +10)
+13 -> +14 => 8200 (9220 from +10)
+14 -> +15 => 73810 (83030 from +10)
+15 -> +16 => 664300 (747330 from +10)
+16 -> +17 => 5978710 (6726040 from +10)
+17 -> +18 => 53808400 (60534440 from +10)
+18 -> +19 => 484275610 (544810050 from +10)
+19 -> +20 => 4358480500 (4903290550 from +10)
You can extend the simulation:
$ cat sim2.lua
local print = print
local random = math.random
local function upgrade(level, target)
local count = 0
while level < target do
count = count + 1
if random(10) == 1 then
level = level + 1
elseif level ~= 10 then
level = level - 1
end
end
return count
end
math.randomseed(os.time())
for j = 10, 13 do
local sum = 0
local k = j + 1
for i = 1, 500000 do
sum = sum + upgrade(j, k)
end
print(string.format("+%d -> +%d => %f", j, k, sum / 500000))
end
for k = 12, 14 do
local sum = 0
for i = 1, 500000 do
sum = sum + upgrade(10, k)
end
print(string.format("+10 -> +%d => %f", k, sum / 500000))
end
$ luajit sim2.lua
+10 -> +11 => 10.004268
+11 -> +12 => 100.186342
+12 -> +13 => 913.884986
+13 -> +14 => 8207.019994
+10 -> +12 => 109.927122
+10 -> +13 => 1020.979678
+10 -> +14 => 9226.278846
Pretty close to the actual values, right?
But your page says:
+13 => 963.74
+14 => 16384
Edited by renouille, 12 May 2012 - 01:15 AM.