Statistics for Automated recognition of handwritten mathematics