Markov chain, Markov decision process, and deep reinforcement learning with applications to hospital management and real-time ride-hailing