Rapid and accurate timing synchronization is the first and foremost task in ultra-wideband (UWB) systems. The timing with dirty templates (TDT) algorithm introduced in  is a promising method with low complexity and relaxed operation conditions in the presence of unknown time hopping and multipath channel. Its optimality, however, remains unexplored. In this paper, we develop the maximum-likelihood (ML) timing algorithm and obtain its optimum training sequence. We show that the optimum training sequence of the ML timing estimator coincides with that of the TDT algorithm. In addition, we prove that, using this training sequence, the ML algorithm can be simplified, and that the simplified ML (SML) is equivalent to TDT.