In digital systems we represent these as 1 and 0, respectively. There are only two rules which create the basis of the algebra. The first rule is the NOT operation, or negation. Mathematically ...
The first term is in position 1, the second term is in position 2 and so on. Position to terms rules use algebra to work out what number is in a sequence if the position in the sequence is known.