Dan and I have come up with a total of 5 methods of programming this little problem. There are undoubtedly a plethora of good solutions. I gave this to my programming class to do in Small Basic. SB is perfect for this kind of little assignment, it does simple graphics without any fuss. I have three kids in the class. Two solutions were very similar to the state variable solution, especially since I showed one kid what a state variable did and how it worked and he shared the idea to the other two kids. I expected the same basic solution from all three kids. Kid number three had to be different. He turned in the code and I stared. “What the heck did he do?!” It took me a while to figure out he had come up with a recursive solution. Very clean, very unique. I love it.

If you are going to teach programming the cookie cutter has to go out the window. In math there is usually a “best” method to reach the solution. In programming there are good solutions and bad solutions, all of which will work. And sometimes there are solutions that are just better than anything you may have thought of. Smart kids in math are manageable, you know where they are going and what tools they have to work with to get there. Smart kids in programming find tools you did not know existed and they will use them in ways you never thought of. I love it.

### Like this:

Like Loading...

*Related*

This entry was posted on March 31, 2016 at 5:00 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

April 1, 2016 at 4:18 pm |

The notion that there is usually a “best” solution in math is an illusion,brought about by reverse design of the math problems, starting from a solution technique and looking for artificial problems that best exemplify that technique. For math problems that arise more naturally, there are often many solutions—some good, some bad.

The programming problems you are starting with have not been carefully tuned over centuries to point to particular solution techniques, so are more like real math problems than the textbook examples usually taught in math classes.

April 1, 2016 at 4:45 pm |

You are absolutely correct. I should rephrase that to be contrived high school text book math. Most real world math does have many routes to a solution and even the solutions can be different and correct.