The anti-collision mechanism is an important part in Radio-frequency Identification (RFID) technology. Recently, many anti-collision algorithms were designed based on the EPCglobal standards. These works mainly focused on the tag population estimation. But they chose frame size based on the classical results of Random Access (RA) systems. We show that a new theory is needed for the optimization of the RFID systems as they have characteristics very different from the RA systems. We model the reading process as a Markov Chain and derive the optimal reading strategy through first-passage-time analysis. We show that the optimal strategy can be easily incorporated into the EPCglobal standards to give significant performance improvement.