Freyert/khan-exercises — comment on commit fea7a0b1f86108e5c596a44164f3a5f8b8486d2c
File:  line 0
By Freyert:

Basically the issue was that this module had several data ensures it didn't need.

A. It had a data ensure that made sure two randomly selected denominators would equal each other, plus it wanted to make sure that the LCM was less then 61, but if you read the hints there is no explanation for finding the LCM. Randomly choosing one denominator, and then setting the other one equal to it is clearly the correct choice here.

B. I decided to go the extra mile and remove the data-ensures on the numerators. Here the module just wants to make sure that the two fractions added together are not more than one, but also not less then 0. These one is a little more complicated. For N1 if the operator is addition we have to make sure that one numerator is two less than the denominator so that if we add one/x to y/x it never equals x/x. N2 also must be one less than the difference between the Denominator and the Numerator so that the fractions never equal 1.
When the operator is negative N1 must be at least 2 so that if we subtract 1 we don't get zero, but it must also still be less than the denominator so we don't get any weird x/x in our problems. The second numerator can then take any number within the range [1, N1 -1] and we will never get a zero.

As far as I can tell from the testing I did on this, this works just as well as the original with no lag.