Basic elements of reinforcement learning