Doing the math on Gambler's Fate


#1

I was bored today so I decided to do the math on Gambler’s Fate behavior. Here is a photo of my results:

The behavior of Gold decaying to Silver and then decaying to nothing is a very simple Markov Chain, which I then represented as a binary tree (as every state can change into 2 different states every second).

Each state is a node on the tree (G for Gold, S for Silver, X for not existing anymore, I didn’t draw all X nodes as I found it unnecessary). Every second Gold can either remain as gold or become silver, each of its children nodes reflect that; Silver on the other hand can remain as silver or “die”; and a “dead” node can remain dead or continue to not exist (the same thing, but making it have 2 children nodes as the others keeps things consistent). This behavior makes the tree of possibilites grows exponentially, in base 2.

To calculate the probability of a decoy lasting at least N seconds, we need to get the ratio of “alive” nodes to the total nodes on the tree at depth N. As explained on the previous paragraph, the tree has 2N-1 nodes at depth N, meanwhile the total amount of alive nodes grows linearly, one node at time, as only the lone G node can spawn 2 more alive nodes. Thus, at depth N, the ratio alive/total is N / 2N-1. Let’s refer to this ratio as TN, N being the depth of the tree as well as a time in seconds.

I remind you that TN is the probability of the decoy surviving at least N seconds, not of it surviving exactly N seconds (this value would be TN - TN+1, for example: the decoy has a 25% chance of lasting exactly 2 seconds).

As you can see, the average duration of the decoy is 4 seconds, as half of the time it will last 4s or more and the other half it will last 3s or 2s.

Just to make sure, I wrote a lua script to simulate the behavior of the decoy and, indeed, my calculations seem correct. Here are the results for 100 million rolls:


02s:	25003719
03s:	24996025
04s:	18746892
05s:	12502522
06s:	7806597
07s:	4691625
08s:	2737143
09s:	1562021
10s:	879513
11s:	487487
12s:	269118
13s:	146308
14s:	79366
15s:	42789
16s:	22878
17s:	12174
18s:	6523
19s:	3399
20s:	1797
21s:	999
22s;	503
23s:	290
24s:	157
25s:	82
26s:	38
27s;	14
28s:	10
29s:	5
30s:	4
31s:	2

average duration: 4.00011294 s

and here is the script:


reps = arg[1] or 1000

function roll()
	local state = 2
	local count = 0

	while state ~= 0 do
		if math.random(2) == 1 then
			state = state - 1
		end
		count = count + 1
	end

	return count
end

totals = {}
for i=1,reps do
	local c = roll()

	if totals[c] == nil then
		totals[c] = 0
	end

	totals[c] = totals[c] + 1
end

total = 0
for i,v in pairs(totals) do
	total = total + i*v
	print(i,v)
end

print("\naverage duration: "..total/reps.." s")

In conclusion, this prism is pretty bad. The mana efficiency of this prism is terrible, 90 mana (cost of T6) for 4 seconds on average (duration of T1) is utterly pathetic, the only things this prism has going for it are perfect control over the position of the decoy - which you only really need on extreme situations or if you can’t eyeball it normally (git gud) - and a fairly small chance of it lasting for a decent amount of time (I find this inconsistency annoying, but that’s just me).

(By the way, can anybody tell me how to format code in this forum? I tried <code></code>, but it didn’t do anything. The format on the while and if seems to be automatic.)


#2

The BBS uses Markdown, and the way to blockquote code is using backticks. Single backticks like this for inline code. Triple backticks

like this to blockquote code
with syntax highlighting

Indenting is similar but it does not have syntax highlighting – that how your while is being treated. It is meant for things like preformatted tables.


#3

The math of this is interesting. The total time is the time spent as gold + time spent as silver, and as each “colour” works the same way you can work out the result for one and double it.

So e.g. for silver, it lasts for 1 second, after which each second has a 50% chance to disappear. So it has a 0.5 probability to last a 2nd second. A 0.25 probabilty to last a 3rd second. And so on.

This produces a simple geometric series:

1 + 0.5 + 0.25 + 0.125  + ...

or ∑rn with r = 0.5. The sum converges to 1 / (1 - r) = 1 / 0.5 = 2

So silver lasts for 2 seconds, on average, as does gold. The total time therefore averages 4


#4

Thanks, I fixed it!


#5

Dude im a realm player not euler’s and einstein’s love baby


#6

yeah it is kinda poop if you’re an endgame player decoys wise

on the bright side you still get 4 atk 4 dex, or as much as an omni

t7 is best decoy prism, this one is powerful in that you don’t have to calculate how far the decoy goes with tiered or go in with brain


#7

You might want to read up on this if you’re interested in more: https://en.wikipedia.org/wiki/Negative_binomial_distribution


#8

It’s actually better matched by the geometric distribution, which is a special case of the negative binomial distribution:

Really though using probability distributions are too advanced a tool. We are just interested in the average which can be calculated directly, to compare with all the other prisms with fixed durations.


#9

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.