A discrete dynamical system arising in molecular biology