def evaluate_polynomial(coefficients, value)
            result = 0
            coefficients.reverse_each do |coefficient|
                result = result*value + coefficient
                result = result % @prime
            end

            return result
        end
def evaluate_polynomial(coefficients, value)
            result = 0
            coefficients.reverse_each do |coefficient|
                result = result*value + coefficient
                result = result % @prime
            end

            return result
        end
This evaluates a polynomial with reversed coefficients at a given
 value. Namely, given the array [a, b, c, d], and x=value, the equation
 is:
 a + bx + cx^2 + dx^3