Mandarin tones are usually the most difficult part for beginning-level students of Mandarin. Students of different countries have different difficulties in learning Mandarin tones. Due to the limited time in the class, teachers can hardly correct the tonal errors of every single student and give the students enough time for practicing pronunciation. As a result, it is very important for students to do lots of effective exercises to practice the pronunciation of Mandarin tones after class. Nowadays, as the technology advances, many people dedicate themselves to developing specific computer software to support teaching or providing adaptive pronunciation-exercises for students. Although many products are available to date, their functions can still be improved. Accordingly, researches in this field are ongoing. In this article, we introduce a research on an automatic Mandarin tonal error-detection system, which is carried out together by MIT, ITRI in Taiwan, and National Taiwan Normal University. Based on cluster analysis, the system can analyze the tonal patterns in speech corpora of many as well as individual students, so that researchers can precisely catch students' tonal error-patterns. The current research provides not only a quantitative and more objective approach for analyzing speech corpora, but also a basis for developing a computer-assisted system for teaching Mandarin tones.