The idea of the cubic polynomial generator is that for the A-Math syllabus, there must be 1 factor that is linear, and expressible in the form of Ax + B, for integer coeffiicients. As for the quadratic factor independent of the linear factor, it can either have 0, 1 or 2 real root (distinct or not). Hence, I first write a "quadratic generator", and then separately a "linear" generator".
Putting them together gives me a cubic polynomial. This code generates a list of possible cubic polynomials with incredible precision, more often than not, and storing information as to what type of "roots" I expect to get.
The inspiration was the fact that I found one of my "Worked Example" was unsolvable, which led me to the idea of Cubic Generator. This set of polynomials is what I use in my curriculum work as it is "error" free.
A random genreator produces a linear factor that guarantees the existence of a rational root, because sometimes all roots can be irrational.
But we also need a quadratic root - whether factorizable, irrational or neither.
We now put them together!
By randomising the numbers, I will be able to collect the cubic expressions. In fact, in each output, I will know the value of the roots, as well as the "type" of roots.
"1" means the roots are all rational (3 real roots)
"2" means the roots comes in a pair of irrationals, and a single rational root (Still 3 real roots)
"3" means the roots come in a complex conjugate pair (not required for the Secondary School) and a single rational root (1 real root).
If there are repeated root, the value of the root is simply written in plain sight, just like in the first example - whose roots are -0.25, -2 and -2.
As a former Data Scientist Apprentice in a media company, my work revolved around GenAI Prompting and Back-End Python in support of Business and Consumer Analytics.
I brought the skillset from this place into my teaching workplace. While it certainly isn't something I would use in teaching directly, it has profound impact in my workstream when it comes to producing materials for my students.
Generating Cheatsheets by pumping in existing resources, and continuous prompting to fine tune the model in replicating what's in my mind.
Generating my termly lessons just by asking the AI agent to write for me, and helping me to check for clashes in rescheduling.
Generating questions modified from existing exam papers for mock papers and practice questions.