4 ms·
That's actually a reasonable question. What's a lot more likely: "Here are fifteen for loop headers. For each one, write how many times the loop body will exec
by randrews 16y ago
That's actually a reasonable question. What's a lot more likely:
"Here are fifteen for loop headers. For each one, write how many times the loop body will execute."
- xyzzyz 16y agoThis is undecidable.
- amalcon 16y agoOnly in general.
- xyzzyz 16y agoThe problem of distinguishing when it is decidable and when it is not, is undecidable itself (Rice theorem).
- amalcon 16y agoWell yes, but the questions could be trivially decidable. Not that this would make them good questions.
- randrews 16y agoit's kind of my point that it would make them bad questions. :) I think expecting a public school textbook to ask questions that require thought is really optimistic.
- hasenj 16y agoIt's reasonable for us. Most people (who are not into programming) would find it ridiculous and pointless.
- dkarl 16y agoIt's a reasonable way (the only way) to develop a skill -- even after you have a conceptual understanding of how to do something, you still have to practice a little bit at it. Practice is required first of all to clarify your understanding, but even then practice is necessary to polish your skill enough that you can use it to accomplish something. (I.e., you have to be able to execute the skill and have enough attention left over to understand something else.) So many problems in education come from the stigmatization of anything resembling practice as "rote" and "unstimulating." When you stigmatize repetition, you make it very hard to develop skills. In effect, students are expected to develop "understanding" (the fun, easy part) without developing any skills (the boring, repetitive part.) Unfortunately, working without any polished, dependable skills is awful. It's anxiety-inducing. You have a little bit of doubt about every single step, and as you complete step after step, your confidence in getting the right answer goes down and down. Having a set of solid skills gives you base of confidence, a security blanket that reassures you while you tackle new ideas.
- hasenj 16y agoI think you missed the point. Most people find first year of computer science very hard. For me it was easy, but plenty of people found it hard, and I think many people changed majors because of that. Now imagine if it was mandatory in high school. Teachers probably won't understand it much. The curriculum will probably focus on "formula"-like things (perhaps, patterns?), syntax maybe, and a whole bunch of boring details, and ignore the most important part: problem solving. Students might study (read: memorize) all kinds of functions for doing things. Grade 8: loops for sorting numbers, loops for finding min and max numbers, loops for calculating factorials. for-loop synatx in C. for-loop syntax in python. Grade 9: recursive functions for sorting (e.g. merge sort), recursive functions for calculating factorials, recursive functions for finding min/max numbers in a list. I only realized this very recently, but math has a lot in common with computer science. Its core is about problem solving. Unfortunately, that's not how it gets taught in high school. In high school, math is a set of arbitrary formulas you have to memorize and use to "solve" arbitrary equations. We were given a lot of "practice problems"; they were the most boring thing in the world. They didn't teach you anything; their only purpose is brush up your muscle memory so that when you see a problem of the form "A B C" you know which formula to use and how to use it.
- daxelrod 16y agoThe above exactly the kind of exercise we were assigned in my high school's intro CS course. The course was taught by a math teacher. BUT: The school waited until a month before the semester started to tell the math teacher that she'd be teaching the course. Worse, they had already picked out a textbook that was filled with exercises like this. Worst of all, she had basically never done any programming before. As time went on, and she actually had a chance to learn the material, this kind of coursework was replaced with more interesting and useful programming assignments. I later took a calculus course from this teacher, and in that course, she actually took great pains to avoid repetitive problem sets; almost every problem she assigned was designed to teach us something different. Repetitve exercises are likely easiest to assign and grade.