In an alternating series, generally you analyze the sequence of "absolute" terms. In this problem, it is possible for both variables $b and $d to be negative, making the denominator of the rational expression negative. But the problem answer does not take this into account.
Solution: change variable setup $b = non_zero_random(-10,10,1); to $b = random(1,10,1);
(Also, the setup of variable $a can just use random instead of non_zero_random because the random range used doesn't include 0...)
In an alternating series, generally you analyze the sequence of "absolute" terms. In this problem, it is possible for both variables
$band$dto be negative, making the denominator of the rational expression negative. But the problem answer does not take this into account.Solution: change variable setup
$b = non_zero_random(-10,10,1);to$b = random(1,10,1);(Also, the setup of variable
$acan just userandominstead ofnon_zero_randombecause the random range used doesn't include 0...)