\(Hromadné\ generování\ příkladů\)

Off[General::"spell1"];
nzadani = 5;
pomprokoreny := 
        Random[Integer, {-5, 7}];
pomproacko := Random[Integer, {1, 4}];
indexnahodnehozadani := 
        Random[Integer, {1, nzadani}];
korenyacka = 
        Table[{pomprokoreny, pomprokoreny, pomproacko}, {nzadani}] /. {x1_, 
              x2_, a_} -> {x1, x2, a, 
              (a^2) (((x1 - x2))^2)};
zadani = 
        korenyacka /. {x1_, x2_, a_, d_} -> 
            TraditionalForm[
              Expand[a*(x - x1)*(x - 
                      x2)]];
Do[Print["", i, ". zadani:   ", zadani[[i]]], {i, 
        nzadani}]
Do[Print["Koreny ", i, ". rovnice:   ", "x1 = ", 
        korenyacka[[i, 1]], "  x2 = ", 
        korenyacka[[i, 2]], "     diskriminant = ", 
        korenyacka[[i, 4]]], {i, nzadani}]