Investing at the stock market is often considered as a way of gambling. That is because most people can’t manage the see the mathematics behind it. Someone with enough mathematical knowledge can see the algorithms in movements of stocks and find the correct function for it, basically optimize their portfolio. With the correct function one can foresee fate of their investments or when to invest on what. The aim of portfolio optimization is to find the set of efficient feasible portfolios. A portfolio is feasible if it satisfies a relevant set of relevant linear constraints; it is efficient if it provides less risk than any other feasible portfolio with the same expected return and more expected return than any other feasible portfolio with s...