# How to verify if a graphical model has the markov property?

If I draw the computational graph of an HMM and an RNN from an architectural point of view they look very similar. The main difference is that an RNN gets some input $$x$$ and the HMM only operates on the latent sequence. From my understanding - and reading that from the drawn graph - both the hidden states $$h_i$$ in the RNN and the latent variable $$Z_i$$ are conditionally dependent on the previous state and produce some output. What I don't understand is, that an HMM is said to have the markov property (i.e., is memoryless) whereas the RNN does not. Why, where can I observe the difference? How can I read that property from a computational graph (if at all)?

The Markov property applies to sequences of random variables. Let $$(X_n)_{n\in\mathbb{N}^*}$$ be a sequence of random variables, it is said to follow the Markov property iif: $$p(x_n|x_1,\dots,x_{n-1})=p(x_n|x_{n-1}).$$
Thus, if you can show, from the computational graph or any other equations defining your model, that the distribution of $$X_n$$ given $$X_1,\dots,X_{n-1}$$ only depends on $$X_{n-1}$$ you have proven the Markov property for the sequence of r.v. in question. The Markov property for the hidden random variables in a HMM is indeed one of the core definitions of HMMs.