be a well-formed machine, the summation of entries of each column of $ M_\sigma $ must be 1. The final state is denoted as $v_f = v_{|{\tilde{w}}|}$. At the end, the weighting operator[^2] returns the probability of observing each state as $$Pr[\mbox{observing } s_i] = \frac{| v_f[i] | }{|v_f|},$$ where $ 1 \leq i \leq |S| $, $ v_f[i] $ is the $ i $-th entry of $ v_f $, and $ |v_f| $ is $l_1$ norm of $ v_f $. Thus, the input $w$ is accepted by $ A $ with probability $$f_A(w) = \sum_{s_i \in S_a} \frac{| v_f[i] | }{|v_f|}.$$

Next, we define a new affine model. A (realtime) affine counter automaton (AfCA) $A$ is an AfA augmented with a counter. Formally, it is a 5-tuple $$A = (S,\Sigma,\delta,s_I,S_a),$$ where the difference from an AfA $$\delta: S \times {\widetilde{\Sigma}}\times \{Z,NZ\} \times S \times \{-1,0,+1\} \rightarrow {\mathbb R}$$ is the transition function governing the behavior of $A$ such that when it is in the state $ s \in S $, reads the symbol $ \sigma \in {\widetilde{\Sigma}}$, and the current status of the counter is $ \theta \in \{Z,NZ\} $ ($Z:$ zero, $NZ:$ nonzero), it makes the following transition 