Wednesday, July 27, 2016

Coding and Math

Over the past two weeks or so, I've been working my way through the classes at Code.org.  I started with course 2 so I could get the full experience of working with it and I am in the middle of course 3.  As I've worked my way through each lesson, I've come to the realization that I need to know the basics in order to code effectively.  Even after starting this entry, I realized that there are two different types of coding and both involve math.


Penguin, Tux, Animal, Linux, CartoonThink about it.  You have the coding such as in hopscotch or scratch where you create a game using the visual blocks.  You might have the character dance, move around, or even make a few sounds but the other is actually using a language to create a routine that solves some mathematical equation.

 Because I started with Code.org, I thought of coding within the context of the first.  I thought the only math I needed was simply to decide how many steps my character took or how many repeats the subroutine needs to complete the design but this is only true if I stick with the small things.  If I want to create a more complex game or program, I defiantly needed math. It was once thought that you needed strong math skills to be a programmer but teachers are discovering that the programming may build math skills instead.

According to the Tynker blog, programming improves math skills and does it in a fun way at the same time.   Programming can help students visualize abstract concepts because they see the math in action.  I've seen it myself when I've goofed on an angle and the finished product wasn't correct.

Even when I created a design out of repeated shapes, I had to know the angles so I could instruct the pen to produce the basic shape and then another angle to offset it to produce the final picture.  There is a need to know measurement so the character can walk the correct distance, jump, or even dance.

Programming improves computational thinking such as logic, evaluating data, and breaking a problem down into more manageable pieces.  It helps students develop perseverance. In addition, they apply these skills to real world applications.  Programming also helps develop problem solving skills because you have to figure out where the mistake is and how to correct it.

 So if a student creates a game involving a projectile, he has to write in the proper mathematical equations otherwise the object will not follow the correct path.  There is also math involved in the object bouncing off of a wall or other solid item.  All these are examples of mathematical modeling that manifests itself visually in a game or app but what if students decide to program routines in a language such as Python which actually carry out some sort of mathematical calculations? 

This is where they need to have a solid basis in mathematics so they can write the program to complete the deed effectively.  If a student decides to create a program that factors a quadratic, they have to know how factoring is done even if they only use the quadratic equation.  In my opinion, they can look up the mathematics needed for any routine they wish to create by looking on the internet or in a textbook. They can learn what they need to know or become more solid in their understanding. 

So the next time someone asks, "When am I going to need this?" We can answer they will need it when they program!