Input: a valid plan π and a function update_frequencies that updates the frequencies and rule coefficients