Statistical analysis of newspaper headlines with optimization