For centuries, scientists have puzzled over the arrow of time – the idea that time flows irreversibly from past to future.