---
title: Stochasticity Problem for Weighted Automata
url: https://www.emergentmind.com/topics/stochasticity-problem-for-weighted-automata
type: topic
---

# Stochasticity Problem for Weighted Automata

The stochasticity problem for weighted automata concerns whether an automaton’s transitions and acceptance mechanism yield a probabilistic model—i.e., a quantitative language that assigns a probability value to each input word such that the sum over all words is 1, and every word receives a non-negative value. The study of this problem intricately links minimisation, expressive power, computational tractability, and algebraic characterizations across various classes of weighted and probabilistic automata.

## 1. Fundamental Concepts and Definitions

Weighted automata (WA) generalize classical finite automata by annotating transitions with real-valued weights. A *probabilistic automaton (PA)* is a special case: every transition’s weight is a probability in $[0,1]$, and outgoing transitions from a state sum to at most $1$. The stochasticity problem asks whether a given weighted automaton defines a stochastic language—a function $f: \Sigma^* \to [0,1]$ summing to $1$ over all words.

Formally, for an automaton $\mathcal{A}$, **stochasticity** entails:
- Non-negativity: $f(w) \ge 0$ for all $w \in \Sigma^*$,
- Normalisation: $\sum_{w \in \Sigma^*} f(w) = 1$ [2510.19276].

In probabilistic and weighted settings, additional concerns arise:
- For reductions or minimisation, do resulting automata remain stochastic (i.e., valid PA)?
- What is the complexity of checking or enforcing stochasticity?
- Can every weighted automaton’s quantitative language be equivalently realized by a stochastic model?

## 2. Minimisation Algorithms and Numerical Stability

Classical minimisation algorithms for WA, such as Schützenberger’s standardisation, efficiently reduce state count but suffer numerical instability when applied with floating-point arithmetic, and may yield non-stochastic automata when applied to PA (e.g., negative weights or transition matrices violating row-sum constraints) [1404.6673]. To address these, the Arnoldi-based minimisation method generalizes orthogonalization via Householder reflectors:

- **Algorithm:** Computes forward and backward reductions, forms orthonormal bases, and provides a numerically stable process for minimisation for WAs.
- **Complexity:** Polynomial time, $O(|\Sigma| n^3)$ arithmetic operations.
- **Error Bounds:**
  - For each input symbol $a$, reduction error is bounded by $\| E(a) \| \leq 2\sqrt{n} \tau + c m n^3 \texttt{mach}$.
  - For language error over any word $w$, the difference $|L_A(w) - L_{A'}(w)|$ is bounded by a function of $\tau$, $|w|$, and machine epsilon.
- **Implication for Stochasticity:** If minimisation is constrained to PA, parameter $m$ in error bounds is set to $1$; hence, the algorithm respects stochastic constraints as long as post-processing enforces row-stochasticity.

Lossy minimisation is also possible by increasing error tolerance $\tau$, trading exactness for reduced state count and bounding deviation from stochasticity explicitly. This has direct application in settings such as image compression, where approximate realisation suffices [1404.6673].

## 3. Decidability and Computational Complexity

### Weighted/Probabilistic Automata Minimisation

- **WA Minimisation:** In P (in randomised NC and $O(|\Sigma|n^3)$ arithmetic), but classical algorithms might not preserve stochasticity unless modified to enforce constraints.
- **PA Minimisation:** NP-hard and in PSPACE due to the requirement to remain within the PA class. An explicit reduction to existential theory of the reals ($\exists\mathbb{R}$) captures the existence of a smaller stochastic automaton, and is PSPACE-computable [1404.6673].
- **NFA Minimisation:** PSPACE-complete for general non-deterministic finite automata.
- **DFA Minimisation:** NL-complete; thus efficiently computable.

### Emptiness, Value, and Big-O Problems

- **Emptiness/Value for General PA:** Undecidable in general, due to infinite ambiguity or unbounded nondeterminism [2205.08175].
- **Finitely Ambiguous PA:** For $k$-ambiguous automata (every word has at most $k$ accepting runs), emptiness is NP-complete/quasipolynomial, and value admits PTAS; for polynomial ambiguity, both problems become PSPACE-hard.
- **Big-O Problem:** Given two automata $A,B$, is $A$ bounded above by a constant times $B$ for all words? This is undecidable in general, even for labelled Markov chains (LMCs); polynomial-time solvable for unambiguous automata; coNP-complete for unary, and conditionally decidable for bounded and finitely ambiguous languages subject to transcendental number theory conjectures [2007.07694].

| Problem                       | Complexity                | Numerical Stability        |
|-------------------------------|--------------------------|---------------------------|
| WA minimisation               | P ($\mathrm{NC}^2$)      | Classically unstable      |
| WA minimisation (stable)      | P ($O(|\Sigma| n^3)$)    | Bounded error guarantees  |
| PA minimisation               | NP-hard, in PSPACE       | Stochasticity must be enforced |
| NFA minimisation              | PSPACE-complete          | Not always stochastically valid |
| DFA minimisation              | NL-complete              | Always preserves stochasticity |
| Lossy WA minimisation         | P, explicit error bound  | Permits controlled loss   |
| PA emptiness (finite ambiguity)| NP–NEXPTIME              | Efficient for small $k$   |
| Big-O                         | Undecidable (general)    | Decidable for unambiguous/unary/bounded [2007.07694] |

## 4. Algebraic Characterization and Generalization

For arbitrary input monoids, automata theory requires the *extension postulate*: transitions on generators extend uniquely to monoid homomorphisms. This is necessary for well-definedness beyond free monoids, such as languages over commutative or finitely presented monoids. The commuting property between input word and transition matrix homomorphisms is also essential to characterizations of images under homomorphisms [2002.01214].

Turakainen’s theorem generalizes: every language accepted by a weighted automaton over a monoid can be realized by a monoidal stochastic automaton, possibly with increased state count and with transformations making matrices non-negative and row-stochastic. However, closure properties under union, intersection, and concatenation are more limited than for regular languages unless cut points are isolated.

## 5. Expressiveness and Closure Properties

Probabilistic transitions expand the landscape of quantitative languages, but the impact depends on the value function. For supremum, the class of languages definable by deterministic, nondeterministic, and probabilistic automata coincides [0909.1647]. For limsup and liminf, probabilistic automata strictly extend expressiveness, enabling precise separation of properties not discernible under nondeterminism. For limit-average and discounted sum, the situation is more intricate: discounted sum sees no expressiveness gain; limit-average induces incomparability between the nondeterministic and probabilistic cases.

Closure properties vary:

| Value Function  | max | min | comp. | sum | Strictly more powerful? |
|-----------------|-----|-----|-------|-----|------------------------|
| Sup             | ✓   | ✓   | ✓     | ✓   | No                     |
| LimSup/LimInf   | ✓   | ✓   | ✗     | ✓   | Yes                    |
| LimAvg          | ✓   | ✗   | ✗     | ?   | Yes/unknown            |
| Discounted sum  | ✓   | ✓   | ✓/✗   | ✓   | No                     |

For probabilistic weighted automata, only certain semantics and value functions admit closure under all Boolean operations; for instance, only Pos-LimSup and As-LimInf are robust under max, min, complement, and sum [0909.1647].

## 6. Realizability and Minimality

The realization problem for rational series by bideterministic weighted automata—those both deterministic and codeterministic—exhibits sharp boundaries. Over fields and tropical semirings, minimality and decidable realization hold, with unique minimal automata corresponding to the series [2303.10631]. Over commutative rings with zero divisors, minimality may fail, and realization can be undecidable. For positive semirings beyond tropical, undecidability is shown via encoding PCP instances.

## 7. Stochasticity in Cost Register Automata and Spectral Methods

For general cost register automata (CRA), stochasticity (i.e., normalization and non-negativity) is undecidable—proved via reduction from the PCP and Turing machine halting [2510.19276]. However, restriction to linear (affine) CRAs enables an efficient spectral algorithm:

- Equivalent to weighted automata, the transition matrix $M$ is tested for spectral radius $\rho(M)<1$, ensuring the automaton's output defines a finite measure.
- If finite, a similarity transformation produces a locally sub-stochastic automaton for the same language.
- The class of stochastic regular languages is captured by the smallest set containing finite support distributions, closed under convex combination, Cauchy (convolution) product, and discounted Kleene star (Kleene-Schützenberger characterization).

## 8. Summary and Open Directions

The stochasticity problem for weighted automata governs the intersection of expressiveness, tractability, minimality, and algebraic structure. State minimisation is efficient and certifiably accurate for WAs through numerically stable orthogonalization (with stochasticity constraints for PAs), but for general probabilistic automata, minimisation is computationally harder due to stochasticity constraints (NP-hard/in PSPACE [1404.6673]). Emptiness and value problems are tractable for finitely ambiguous PAs, intractable for general or polynomial ambiguity [2205.08175]. Realizability and minimality are tied to algebraic properties of the semiring or monoid [2303.10631, 2002.01214]. The characterization via spectral methods and closure properties ties stochasticity to both automata-theoretic and measure-theoretic principles [2510.19276].

Open questions remain regarding the precise complexity of PA minimisation, maximum expressiveness for limit-average, and extension of efficient algorithms for larger ambiguity classes. The algebraic frameworks continue to inform probabilistic programming, verification, learning, and sampling in formal and applied contexts.

Source: https://www.emergentmind.com/topics/stochasticity-problem-for-weighted-automata