I will explain how some basic theory of random trees can be useful for some rather advanced algebro-geomertic computations, namely, to prove Kontsevich's formula for intersection numbers on the moduli spaces of curves.