Expected Value (E)

Definitions

H Die hit number p(S) (H-z)/10 Chance of single success, no rerolls
z Positive re-roll number p(z) (z+1)/10 Chance to roll the positive reroll number
n Negative re-roll number p(n) (10-n)/10 Chance to roll the negative reroll number

Positive Reroll Die

Ez = (1-p(z))⋅0 + (1-p(z))p(z)⋅1 + (1-p(z))p(z)2⋅2 + (1-p(z))p(z)3⋅3 + ...
Ez = (1-p(z))p(z)⋅1 + (1-p(z))p(z)2⋅2 + (1-p(z))p(z)3⋅3 + ...
Ez/(1-p(z)) = 1p(z) + 2p(z)2 + 3p(z)3 + ...
p(z)Ez/(1-p(z)) = 1p(z)2 + 2p(z)3 + ...
(1-p(z))Ez/(1-p(z)) = p(z) + p(z)2 + p(z)3 + ...
Ez = p(z) + p(z)2 + p(z)3 + ...
p(z)Ez = + p(z)2 + p(z)3 + ...
(1-p(z))Ez = p(z)
Ez = p(z)/(1-p(z))
Ez = ((z+1)/10) / ((9-z)/10)
Ez = ((z+1)/10) ⋅ (10/(9-z))
Ez = (z+1) / (9-z)

Negative Reroll Die

En = (n-10)/n

Normal Die

E = p(z)⋅(1+Ez) + p(S) + p(n)⋅(-1+En)
E = p(z)⋅(Ez+1) + p(S) + p(n)⋅(En-1)
E = (z+1)/10⋅(Ez+1) + (H-z)/10 + (10-n)/10⋅(En-1)
10E = (z+1)⋅(Ez+1) + H - z + (10-n)⋅(En-1)
10E = (z+1)⋅10/(9-z) + H - z + (10-n)⋅-10/n
10E = (z+1)⋅10/(9-z) + H - z + (n-10)⋅10/n
E = (z+1)/(9-z) + H/10 - z/10 + (n-10)/n
E = (z+1)/(9-z) + H/10 - z/10 + 1 - 10/n
E(9-z) = (z+1) + H(9-z)/10 - z(9-z)/10 + (9-z) - 10(9-z)/n
10nE(9-z) = 10n(z+1) + Hn(9-z) - zn(9-z) + 10n(9-z) - 100(9-z)
10n(9-z)E = 10nz + 10n + 9Hn - Hnz - 9nz + nz2 + 90n - 10nz - 900 + 100z
10n(9-z)E = + 10n + 9Hn - Hnz - 9nz + nz2 + 90n - 900 + 100z
10n(9-z)E = + 100n + 9Hn - Hnz - 9nz + nz2 + - 900 + 100z
10n(9-z)E = 100(z-9) + 9n(H-z) - nz(H-z) + 100n
10n(9-z)E = 100(z-9) + (9n-nz)(H-z) + 100n
10n(9-z)E = 100(z-9) + n(9-z)(H-z) + 100n
10n(9-z)E = -100(9-z) + n(9-z)(H-z) + 100n
10n(9-z)E = -100(9-z) + n(9-z)(H-z) + 100n
10nE = -100 + n(H-z) + 100n/(9-z)
E = -10/n + (H-z)/10 + 10/(9-z)
E = 10/(9-z) + (H-z)/10 - 10/n