Equivalence between RAM-based neural networks and probabilistic automata