I don't think you could work out the algorithm, because it's not mathematic. It's a handful of quirky arbitrary rules.
But hey, give it a shot; here are three random passwords (calculated using a slightly different algorithm than the one i actually use):
hotmail: 3m4m349 facebook: w45c033 aol: t41m325
Now, tell me what my Gmail password is.