A dual-purpose algorithm is capable of estimating the principal component and minor component from input signals by simply switching the sign of some terms in the same learning rule. Compared with single-purpose algorithms, a dual-purpose algorithm has many advantages. In this paper, a novel dual-purpose algorithm is proposed based on the study of some existing algorithms. The dynamic behavior of this dual-purpose algorithm is investigated by the deterministic discrete time method. Some constraint conditions, which provide a way to choose the initial weight vector and learning factor, are also derived to guarantee its convergence. Numerical simulation results not only demonstrate the fast convergence of the proposed algorithm but also demonstrate the correctness of the convergence conditions. INDEX TERMS Dual-purpose algorithm, principal component analysis, minor component analysis, dynamic behavior analysis.