Transition matrices
if and only if there is a transition from
to
labeled by
.
number of paths from
to
reading
.
if and only if there is a transition from
to
labeled by
and
has been tagged before
(which only depends on
by functionality).
Maintaining products
To find
We need to find the smallest
such that:
Binary search by computing the product:
- Recomputing this product is too costly:
matrix multiplications each time.
-
and
are almost the same.
- If
and
have been precomputed for every
:
Each product in the binary search can be computed with two
products.