Source: http://www.fpbm.ma/file/CoursExercices/TD%20denombrements.pdf