In this paper we establish new optimal bounds for the derivative of some discrete maximal functions, in both the centred and uncentred versions. In particular, we solve a question originally posed by Bober et al. [‘On a discrete version of Tanaka’s theorem for maximal functions’, Proc. Amer. Math. Soc.140 (2012), 1669–1680].