In this paper, we prove that the dimension of the space of positive (bounded, respectively) ℒ-harmonic functions on a complete Riemannian manifold with ℒ-regular ends is equal to the number of ends (ℒ-nonparabolic ends, respectively). This result is a solution of an open problem of Grigor'yan related to the Liouville property for the Schrödinger operator ℒ. We also prove that if a given complete Riemannian manifold is roughly isometric to a complete Riemannian manifold satisfying the volume doubling condition, the Poincaré inequality and the finite covering condition on each end, then the dimension of the space of positive (bounded, respectively,) solutions for the Schrödinger operator with a potential satisfying a certain decay rate on the manifold is equal to the number of ends (ℒ-nonparabolic ends, respectively). This is a partial answer of the question, suggested by Li, related to the regularity of ends of a complete Riemannian manifold. Especially, our results directly generalize various earlier results of Yau, of Li and Tam, of Grigor'yan, and of present authors, but with different techniques that the peculiarity of the Schrödinger operator demands.