randRange(1, 30, 4, 2) randFromArray(FRACTIONS) randRange(2, 4) [[ANSWER1[0] * MULTIPLIER, ANSWER1[1] * MULTIPLIER]] shuffle(FRACTIONS.concat(ANSWER2)) shuffle(FRACTIONS)

Find the pair of equivalent fractions below:

Select two equivalent fractions.
_.map($("input[type=checkbox]:checked"),function(object){ return OPTIONSINC[parseInt(object.id.match(/\d+$/))]; })
if (guess.length !== 2) { return ""; } return abs(guess[0][0] / guess[0][1] - guess[1][0] / guess[1][1]) < pow(2, -42);
$('input[type="checkbox"]').prop('checked',false); $('#check' + _.indexOf(_.map(OPTIONSINC, JSON.stringify), JSON.stringify(guess[0]))).prop('checked',true); $('#check' + _.indexOf(_.map(OPTIONSINC, JSON.stringify), JSON.stringify(guess[1]))).prop('checked',true);

One way to solve this is to simplify each fraction. For example, the first fraction is equivalent to fraction(OPTIONSINC[0][0],OPTIONSINC[0][1],true,true).

Here are all the fractions simplified. Which two are the same?
  • fraction(OPTION[0],OPTION[1],true,true)

fraction(ANSWER1[0],ANSWER1[1]) = fraction(ANSWER2[0][0],ANSWER2[0][1])

Find a different form of the fraction fraction(ANSWER2[0][0],ANSWER2[0][1])

Select the equivalent fraction.
_.map($("input[type=checkbox]:checked"),function(object){ return OPTIONS[parseInt(object.id.match(/\d+$/))] })
if (guess.length !== 1 ) { return ""; } return abs(guess[0][0] / guess[0][1] - ANSWER1[0] / ANSWER1[1]) < pow(2, -42);
$('input[type="checkbox"]').prop('checked',false); $('#check' + _.indexOf(_.map(OPTIONSINC, JSON.stringify), JSON.stringify(guess[0]))).prop('checked',true);

Simplify the fraction we are looking for: fraction(ANSWER1[0], ANSWER1[1], true, true).

Simplify each fraction.

  • fraction(OPTION[0], OPTION[1], true, true)

Identify the fraction which matches.

fraction(ANSWER2[0][0],ANSWER2[0][1]) = fraction(ANSWER1[0],ANSWER1[1])