I am a beginner in writing algorithm in LaTeX using algorithm2e. I am trying to write a simple algorithm (code is attached herewith). However, I am not getting correct output. I want to see line numbers. The output is also attached herewith.
Please note that i included the following command in LaTeX preamble too see line numbers
\usepackage[linesnumbered,lined,boxed,commentsnumbered]{algorithm2e}
There must be something wrong in my code. Is there anyone who can help me execute it correctly?
\begin{algorithm} [H]
\caption{QL algorithm}
Initialize Q-table values (Q(s, a)) arbitrarily\
Initialize a state(s_t)\
Repeat Step 4 to 6 until learning period ends\
Choose an action (a_t) for the current state (s_t) using an exploratory policy\
Take action (a_t) and observe the new state (s_t+1) and reward (r_t+1)\
Update Q-value\
\end{algorithm}


\documentclassand end with\end{document}