Probabilistic Finite Automata



Probabilistic Finite Automata (PFA) is an extension of traditional finite automata that incorporates probabilities into state transitions. This approach is useful for to design systems where outcomes are not deterministic but instead have some uncertainty (or probability).

In this chapter, we will see the basics of Probabilistic Finite Automata and understand it through example to understand how they work.

Basics of Probabilistic Finite Automata

A Probabilistic Finite Automaton (PFA) is nothing but a finite automaton where each transition between states is assigned a probability. This concept was first introduced by O. Rabin in 1963.

Unlike the deterministic finite automata (DFA) or non-deterministic finite automata (NFA), where the transitions are definite and has probability 1.0 for each transition, in a PFA, the transitions are probabilistic. This means that for each input symbol, the automaton may move to different states with certain probabilities.

Definition and Components

The formal definition of PFA is −

$$\mathrm{\{Q,\: \Sigma,\: \delta,\: I,\: F,\: M \}}$$

Where,

  • Q − A finite set of states.
  • Σ − A finite set of input symbols (also known as the alphabet).
  • δ − A transition function that takes a state and an input symbol and returns a probability distribution over the states.
  • I − The initial state probability distribution. It represents the probability of starting in each state.
  • F − The final state probability distribution. It shows the probability of ending in each state.
  • M − A probability matrix associated with each input symbol, determining the likelihood of transitions between states.

Understanding the Probability Matrix

In PFA, the transition probabilities for each input symbol form what is called a stochastic matrix or probability matrix. Each row of the matrix corresponds to a current state, and each column corresponds to a possible next state. The value in each cell of the matrix represents the probability of transitioning from one state to another upon reading a particular input symbol.

For example, consider the following probability matrices for the input symbols a and b

M(a) =

States q0 qf
q0 0 1.0
qf 0.8 0.2

M(b) =

States q0 qf
q0 0.3 0.7
qf 1.0 0

In this setup, the transition diagram will look like the following −

Probability Matrix Transition Diagram

M(a) indicates that when the automaton reads a in state q0, it will definitely move to state qf with probability 1.0. In state qf, upon reading a, it has a 0.8 probability of staying in qf and a 0.2 probability of moving to q0.

M(b) suggests that on reading b in state q0, there is a 0.3 probability of staying in q0 and a 0.7 probability of moving to qf.

Initial and Final State Probabilities

The PFA also requires us to define the initial and final state probabilities:

  • Initial State Probability (I) − This represents the probability distribution over the states at the beginning of the process.
  • Final State Probability (F) − This represents the probability distribution over the states at the end of the process.

For instance, if the initial state probability is I(q0) = 1 and I(qf) = 0, the automaton starts in state q0 with certainty. Similarly, if F(q0) = 0 and F(qf) = 1, the automaton must end in state qf.

Example: String Acceptance by a PFA

Let us see another example to understand how a PFA better. It will check if a string is accepted.

Example Setup

Consider a PFA with the following components −

  • States − {q0, qf}
  • Input Symbols − {a, b}
  • Initial State Probability − I = {1, 0} (The automaton starts in q0 with probability 1)
  • Final State Probability − F = {0, 1} (The automaton ends in qf with probability 1)

Probability Matrices

M(a) =

States q0 qf
q0 0.25 0.5
qf 0 1

M(b) =

States q0 qf
q0 0.5 0.75
qf 1.0 0

The machine will be like −

String Acceptance by a PFA

String Processing: ab and baa

Let us calculate whether the strings ab and ba are accepted by this PFA.

For the string "ab"

$$\mathrm{I \:\times\: M(ab)\: \times\: F^T \:=\: I \:\times\: M(a)\: \times\: M(b)\: \times\: F^T}$$

$$\mathrm{\left[ \begin{array}{cc} 1 & 0 \end{array} \right] \times \left[ \begin{array}{cc} 0.25 & 0.5 \\ 0 & 1 \end{array} \right] \times \left[ \begin{array}{cc} 0.5 & 0.75 \\ 1 & 0 \end{array} \right] \times \left[ \begin{array}{c} 0 \\ 1 \end{array} \right]}$$

$$\mathrm{= 0.1875}$$

The acceptance probability is 0.1875

For the string "ba"

$$\mathrm{I \times M(ba) \times F^T = I \times M(b) \times M(a) \times F^T}$$

$$\mathrm{\left[ \begin{array}{cc} 1 & 0 \end{array} \right] \times \left[ \begin{array}{cc} 0.5 & 0.75 \\ 1 & 0 \end{array} \right] \times \left[ \begin{array}{cc} 0.25 & 0.5 \\ 0 & 1 \end{array} \right] \times \left[ \begin{array}{c} 0 \\ 1 \end{array} \right]}$$

$$\mathrm{= 1}$$

The acceptance probability is 1.0, so it will be accepted.

Conclusion

In this chapter, we covered the basics of Probabilistic Finite Automata (PFA). The idea of PFA is unique and it is a powerful extension of finite automata that states probabilities into state transitions.

We explored the fundamental components of a PFA, including states, input symbols, transition functions, and probability matrices. Through the example, we explained how a PFA processes strings and check whether they are accepted based on the calculated probabilities or not.

Advertisements