added python code containing combinatorial equations