The modular group occupies a central position in many branches ofmathematical sciences. In this paper we give average polynomial-timealgorithms for the unbounded and bounded membership problems forfinitely generated subgroups of the modular group. The latter resultaffirms a conjecture of Gurevich.