chess mathematical formula