The modular group occupies a central position in many branches of
mathematical sciences.  In this paper we give average polynomial-time
algorithms for the unbounded and bounded membership problems for
finitely generated subgroups of the modular group.  The latter result
affirms a conjecture of Gurevich.