qcoh's comments

qcoh | 9 years ago | on: Category Theory for the Sciences

You need to know a few interesting categories and functors before you can appreciate it. Without that, it is really abstract nonsense.

qcoh | 10 years ago | on: Namecheap live chat social engineering leads to loss of 2 VPS

I had a similar situation just recently with an old Gmail account. Despite knowing the password, Gmail wants me to answer the security question or log in from a place I logged in ten years ago or list folder names (which didn't exist the last time I used that account) or ...

The whole point of this misery was to recover my Steam account to play a few games. Fortunately, Steam lets you recover your account if you can provide proof of ownership (like CD keys of physical copies).

I don't want Google to be the safekeeper of my digital identity.

qcoh | 10 years ago | on: Automatic Differentiation (2009)

Symbolic differentiation is what you learned in school and do by hand. Automatic differentiation is, as far as I understand it, you take your nice function, develop it into a Taylor series around x:

    f(x + h) = f(x) + f'(x) h + f''(x) h^2 / 2 + ...
Suppose that f is a really, really nice function (defined and holomorphic in a large enough domain in the complex numbers and a Taylor expansion with real coefficients). The curious thing happens when you think of h as just an indeterminate and you evaluate it, for instance, at i s, where i =sqrt(-1) and s is a tiny number. Then

    f(x + is) = f(x) + f'(x) is + f''(x) (-s^2)/2 + ...
Just looking at the imaginary part gives you:

    Im(f(x+is))/s = f'(x) + O(s^2).
This means you can compute the derivative with an O(s^2) error just by evaluating at a complex number. The only thing needed was that all operations are implemented not just for real numbers but complex numbers. Instead of the R-algebra R[i] = C, why not try to use the R-algebra R[ε] and evaluate at ε, where ε is a symbol with ε^2 = 0? Remember, i is also just a symbol with the property i^2 = -1!!!

    f(x + ε) = f(x) + f'(x) ε + f''(x) ε^2/2 + ...
Since 0 = ε^2 = ε^3 = ..., all higher order terms vanish and you get

    f'(x) = coefficient of ε in f(x + ε).
(Compare with the complex numbers: Im = "coefficient of i" but this time around, there is no error)

Everything that you need is to know how to implement arithmetic operations for numbers in R[ε], e.g.

    (a+b ε) + (c + d ε) = (a+c) + (b+d) ε
    (a+b ε) (c + d ε) = ac + (ad + bc) ε + bd ε^2 = ac + (ad + bc) ε
A problem occurs when you try to divide by ε. This is simply undefined in R[ε], which, unlike C is not a field. But not all is lost, suppose you want to divide (a + b ε) by (c + d ε), where c is not 0, then

    (a+b ε) / (c + d ε) = (a + b ε) (c - d ε) / (c^2 + (-cd + cd) ε) = something with ε in the numerator / c^2,
That is, division by ε only occurs when you divide by 0 in the first place.

To recapitulate: If you have a class DualNumber with overloaded +, -, * , /, ^, you can find the derivative of, say, the fourth-order approximation of e^x at x = 0.5, by computing

    DualNumber x = DualNumber(0.5, 1);
    DualNumber approx = 1 + x + x^2/2 + x^3/6 + x^4/24;
    cout << approx.EpsCoeff() << endl;
(Sorry if this not a good explanation but I've spent too much time on it :P)

qcoh | 10 years ago | on: The category design pattern

> Yeah, generic design pattern which is minimal, compact and simple.

A good argument for monads. Much better than the dishonest appeal to mathematics.

qcoh | 10 years ago | on: The category design pattern

It's useful because it's a generic design pattern not because of the mathematics behind it (of which virtually nothing is actually used, at least in everyday programming).

qcoh | 10 years ago | on: The category design pattern

But just using the definitions is cargo cult and using abstractions for the sake of using abstractions is not necessarily good mathematics. Currently it looks like "use this design pattern because mathematics".

qcoh | 10 years ago | on: What Refugees Bring When They Run for Their Lives

>Like unless they have families that they're hoping to have evacuated (why didn't they bring them over in the first place?),

The reasons I've gathered so far are: The journey is dangerous not just because of the risk of drowning. If I recall correctly, there were stories of rape. There's also a law for family reunification (I don't know the details but at least in the case of minors this means they can bring their family). Lastly, many young Syrian men flee because they could be conscripted by the army.

>I don't know how the Europeans intend to get all of these refugee adults up to economic snuff at the same grade of Europeans who were trained in the ways of the West from birth.

I don't think we know either.

qcoh | 11 years ago | on: Game Design Tips from Tom Hall (1994)

I think it made the location in Metal Gear Solid seem much more real. Aside from maybe Deus Ex I don't know any games where this worked well without feeling like backtracking.
page 2