Genetic algorithm is a stochastic optimisation method for solving difficult optimisation problems. This bachelor's thesis first discusses its implementation, followed by examples indicating the inconveniences which may appear when dealing with putting genetic algorithm into practise. When searching for the best solution, genetic algorithm inspects areas with the higher probability of containing a globally optimal solution. Schema theorem tries to explain the mechanics behind genetic algorithm, but it cannot be used for the analysis of its convergence properties. For this purpose, finite homogeneous Markov chains need to be applied. It is proven that canonical genetic algorithm does not converge to the global optimum, which does not hold for two of its variants maintaining the best solution found over time, without using it to generate new individuals. The first example shows a proof of convergence of an elitist genetic algorithm, where the matrices of crossover operator $K$, selection operator $S$ and mutation operator $M$ are stochastic matrices. Additionaly, matrix $M$ has to be positive and matrix $S$ has to be column allowable. It turns out, as stated in the second proof of convergence, that the sufficient conditions for convergence are not as harsh as mentioned previously. Matrices $K$, $S$ and $M$ have to be stochastic and diagonal-positive, while matrix $M$ has to be irreducible as well.