better symbolic solution of minimiz square error problem using z = p/(1-p) substitution and explicit symmetries