EM function for iteratively recomputing grammars with relative frequency estimation
Function to compute the percentage of unique rules that are generated.