In this paper the problem of pattern recognition in the two-level system is investigated. The application of linear decision functions to the determination of the optimal recognition algorithms is presented. The results are obtained in a numerical way using a random method of optimization.