The distribution of elements in automatic double sequences

Let A=(A(i,j))"i","j"="0^~ be a q-automatic double sequence over a finite set @W. Let [email protected][email protected] and assume that the number N"g(A,n) of g's in the nth row of A is finite for each n. We provide a formula for N"g(A,n) as a product of matrices according to the digits in the base q expansion of n. This formula generalizes several results on Pascal's triangle modulo a prime and on recurrence double sequences. It allows us to relate the asymptotic typical behavior of N"g(A,n) to a certain Lyapunov exponent. In some cases we determine this exponent exactly.