Problem 108: Binary Pascal Words |
Pascal's triangle displays binomial coefficients following Pascal's rule: $$\binom{n}{i}=\binom{n-1}{i-1}+\binom{n-1}{i}.$$ The regular structure of the triangle permits fast access to coefficients. In the problem, the $n$th binary Pascal word $P_n$ is the $n$th row of Pascal's triangle modulo 2, that is, for $0\leq i\leq n$: $$P_n[i] = \binom{n}{i} \bmod 2.$$ Here are the resulting words $P_n$ for $0\leq n\leq 6$:
$P_{0}$ | = | $\sa{1}$ | ||||||
$P_{1}$ | = | $\sa{1}$ | $\sa{1}$ | |||||
$P_{2}$ | = | $\sa{1}$ | $\sa{0}$ | $\sa{1}$ | ||||
$P_{3}$ | = | $\sa{1}$ | $\sa{1}$ | $\sa{1}$ | $\sa{1}$ | |||
$P_{4}$ | = | $\sa{1}$ | $\sa{0}$ | $\sa{0}$ | $\sa{0}$ | $\sa{1}$ | ||
$P_{5}$ | = | $\sa{1}$ | $\sa{1}$ | $\sa{0}$ | $\sa{0}$ | $\sa{1}$ | $\sa{1}$ | |
$P_{6}$ | = | $\sa{1}$ | $\sa{0}$ | $\sa{1}$ | $\sa{0}$ | $\sa{1}$ | $\sa{0}$ | $\sa{1}$ |