Since you mention throwing the chain...would I be revealing exactly how much of a newbie I am if ask why this happens?

The bike portion of my first Tri, Danskin Webster (New England) is v. v. hilly. They say about 80% get off and walk.

I actually was thrilled to have made it through the hardest parts by using my granny gear when I needed it, but about mile 9 I lost my chain (on a decline actually) and this never haapened during training so not only did I have no idea how to get it back on, but I'm not really sure why it happened.

Luckily it was right at an intersection so there were race helpers there who helped me, but how do I avoid it for future?