# In addition to the reward function, which other functions do I need to implement Q-learning?

In general, $$Q$$ function is defined as

$$Q : S \times A \rightarrow \mathbb{R}$$ $$Q(s_t,a_t) = Q(s_t,a_t) + \alpha[r_{t+1} + \gamma \max\limits_{a} Q(s_{t+1},a) - Q(s_t,a_t)]$$

$$\alpha$$ and $$\gamma$$ are hyper-parameters. $$r_{t+1}$$ is the reward at next time step. $$Q$$ values are initialized arbitrarily.

In addition to the reward function, which other functions do I need to implement Q-learning?

In addition to the RF [*], you also need to define an exploratory policy (an example is the $$\epsilon$$-greedy), which allows you to explore the environment and learn the state-action value function $$\hat{q}$$. Moreover, although you don't need to know the details (i.e. the specific probabilities of transitioning from one state to the other) of the transition model, often denoted by $$p$$, you need a function that returns you the next state $$s'$$ for each action $$a$$ that you take in the current state $$s$$. You may not need to define this function, but, for example, the next state could be given by some kind of simulator of the environment (for example, in the case of Atari games, the Atari simulator may provide you the next frame of the game, which you could use to build an approximation of the next state). You can read the Q-learning pseudocode here.