2-st task of MSU CMC Graphical Models course