In the first part of the book practical algorithms for building optimal trading strategies are constructed. Both non-restricted and risk-adjusted (Sterling ratio and Sharp ratio) trading strategies are considered. Constructed optimal trading strategies can be used as training dataset for the AI application. In the next part of the book one particular type of Machine Learning - finding optimal linear separators - is considered, and combinatorial deterministic algorithm for computing minimum linear separator set in 2 dimensions is given. In the last part of the book presented efficient algorithms for preventing overfitting. Shape constrained regression is an accepted methodology to deal with overfitting. Algorithms for nonparametric shape constrained regression in the form of isotonic and unimodal regressions are given.