Source: https://sbsrv7.epfl.ch/instituts/isic/lepa/ICP3_lecture_notes/Separation_Methods/Exercices/Nathalie_2010/serie6_corrections.pdf