Mathematically modelling the mind