I have a vector of binary variables, $s$ representing a state at some point in time, and a transformation matrix $T$. The initial state is $s_0$.
$s_n = Ts_{n-1}$
Given a number of transformations, $n$, find the total number of times the state of each element changes. $n$ could be a very large number.
While it is quite easy to find the state after $n$ transformations in $O(lg\ {n})$ time, I am unable to find such a relation for the total number of changes.
$c_n = s_n \oplus s_{n-1} $
Need to find, $\Sigma^n_{i=1} \ c_i$.