I recently tried to implement a ranking algorithm, AllegSkill, to Python 3.
Here's what the maths looks like:
This is then what I wrote:
t = (µw-µl)/c # those are used in
e = ε/c # multiple places.
σw_new = (σw**2 * (1 - (σw**2)/(c**2)*Wwin(t, e)) + γ**2)**.5
I actually thought it is unfortunate of Python 3 to not accept √ or ² as variable names.
>>> √ = lambda x: x**.5
File "<stdin>", line 1
√ = lambda x: x**.5
^
SyntaxError: invalid character in identifier
Am I out of my mind? Should I have resorted for a ASCII only version? Why? Wouldn't an ASCII only version of the above be harder to validate for equivalence with the formulas?
Mind you, I understand some Unicode glyphs look very much like each other and some like ▄ (or is that ▗▖ ) or ╦ just can't make any sense in written code. However, this is hardly the case for Maths or arrow glyphs.
Per request, the ASCII only version would be something along the lines of:
winner_sigma_new = ( winner_sigma ** 2 *
( 1 -
( winner_sigma ** 2 -
general_uncertainty ** 2
) * Wwin(t,e)
) + dynamics ** 2
)**.5
...per each step of the algorithm.
