| > Yes, but I doubt you had write code to factor a quadratic equation because it's a solved problem and you have libs that will do it for you. Actually, I have, because I've done a fair bit of embedded development and "toss this massive lib on" is not always a reasonable solution. Inferring the structure of plant in controls is often a polynomial factoring problem and it's not something that one tosses Singular or FLINT at on small hardware. But aside from that... Factoring a quadratic by hand is something I expect a CS major to know how to do, because they might very well be doing algebraic manipulation to develop solutions to real world problems. And someone who knows how to factor a quadratic by hand knows a number of formulaic (suboptimal) steps to perform it-- the exact kind of things that's easiest to translate to code before you have gotten into that mindset of explicit thinking. So--- declare and manipulate variables to do the quadratic formula. OK, what if we want to confine ourselves to integers, what can we do? Can we loop and search solutions in some meaningful way like a human would? It's a completely reasonable space to explore as an early programming problem for someone who's familiar with it. I'm teaching a secondary student to program right now. In his core math class he's doing a lot of trig. In turn, we're doing a whole lot of exercises like "make these dots chase the other dot using atan2 and sin/cos". |
Can't argue there :)
> Factoring a quadratic by hand is something I expect a CS major to know how to do
Agreed, I'm more concern about teaching programming while asking such a task. Once you have solid foundation, you can have valuable insights by doing this exercise about float based maths, moving variables around, naming things, translating maths to code. But before that, I think it would hinder learning.
> And someone who knows how to factor a quadratic by hand knows a number of formulaic (suboptimal) steps to perform it-- the exact kind of things that's easiest to translate to code before you have gotten into that mindset of explicit thinking.
I disagree, because it takes 2 abstracts things and mix them together. It's a harsh first step. As a teacher, I get better results when I map coding to some concrete reality first. Later on, yes, you can mix.
> I'm teaching a secondary student to program right now. In his core math class he's doing a lot of trig. In turn, we're doing a whole lot of exercises like "make these dots chase the other dot using atan2 and sin/cos".
This is what I'm talking about. I have terrible results with those for anybody who doesn't really love maths. But creating small games and analysis the text of their favorite song are instant hits.