How can smartphones detect the activities of their users and what does this have to do with math?