Arrangements and Combinations · Basic Rules

Lesson 2

Nikolai Chukhin · Alexander S. Kulikov

In this lesson, we will formulate several basic rules, each of which, on the one hand, is obvious, and on the other hand, is used in almost every calculation.

Sum Rule: If there are \(n\) objects of the first type and \(k\) objects of the second type, then there are \(n+k\) objects in total. In terms of set theory: if sets \(A\) and \(B\) are disjoint, then \(|A \cup B|=|A|+|B|\).

first_set = {'e', 'u'}
second_set = {8, 2, 5}

print(first_set | second_set)

{2, 5, 'u', 'e', 8}

For the piece on the chessboard (that goes one cell up or to the right), it takes 14 moves to get from the bottom-left corner to the top-right corner: seven moves up and seven moves to the right. (Note that the answer for the previous problem may be entered both as \(\texttt{14}\) and \(\texttt{7+7}\).)