To the inclusion of residents in Labor Standard Law, the first step is to figure out different combinations of working hours and numbers of duty in residents under the latest regulations. This study mainly converts the latest resident working hours regulations into mathematical formulas to check the different combinations of duty numbers and working hours, and the overtime pay. According to the guidelines announced by the Ministry of Health and Welfare, we formulated them as mathematic formulas. We also conducted the concepts of expected value to deal with the effect of saving time by PM off in different combinations of duty shifts. This formula can quickly get all possible combinations, and calculate the impact working hours and overtime pay. Although some articles still question the real benefit of the limitation of working hours in resident, it is a start to improving residents' labor right. By the mathematic formulas, we can calculate the combinations to get the more efficient arrangements in working and teaching, and how much we have to pay.