Friday, September 26, 2014

Coding and the equation of a circle

A student was creating a tower defence game in my computer class, doing so he learned what the equation of a circle is.  This idea is a Gr. 12 math idea, and he did this in Grade 10.  Here is what happened...

He was coding a certain tower in his game and he asked me "How do I code the tower to only attack units which are within 200 pixels?"  I first asked if he could draw me a picture of what he wanted, and below is computer graphic of what he drew..

I then said, "What do you have?" He then showed me that he created variables:

t_x = x value of the turret
t_y= y value of the turret
u_x= x value of the unit
u_y= y value of the unit
He had currently coded that if the following two inequalities were true the tower would attack.
At a quick glance we realize that this creates a square around the turret not a circle.  This he had already realized.  He then said, "How do I test if the straight line distance is less than 200?".  We then drew a picture as follows:

 He then said "Well I know that once the line from the turret to the unit is less than or equal to 200, the turret will attack but what inequality do I create?"  A student, next to him, said "Would pythagorean theorem work?".  The problem we had was to label the other two sides.  Minutes passed while I let him think, and finally he asked if this would work
 I said.. "lets try it".. sadly the turret would attack the unit if the unit was within 200 units of the origin not the turret.  Once again, I refused to simply give him the answer and I asked him, "what could we do to change from the origin to the turret?"  He replied with "Well the turret isn't always the origin, so we would have to test the distance.. and so can we do.."
I then asked, "Why did you use the absolute value before?" Which is responded "because the code needs to take the positive value, and if the unit was to the left or below the turret I need it to become positive....but....wait....squaring is positive, so can I just remove the absolute value?"  We tried and here was his final test

When tested, this worked perfectly.  Keep in mind this child is in Grade 10, and completed an outcome from Gr. 12 mathematics.

Discovering a Variable

I wanted to see if I could get students to "create" or "discover" the idea of a variable.  To try this, I completed the following in my ESL (English as a Second Language) math class.

We first started with a discussion around language, and how math is the "Universal Language".  Next, we talked about "What is the best way to learn a language?"  The students agreed that we should learn how to translate from our language into math would be a great start.  I then told them how I once ordered 2 pepperoni pizzas and 3 Hawaiian pizzas and it cost $70.00, and I asked the class if there is a way we could translate this into math?  One student came up and wrote,
2 Pepperoni + 3 Hawaiian = $70.00 
We then had a discussion how, currently, we would not be able to deduce how much each pizza cost, however this would count as a translation.  I then asked how would you translate "4 Pineapple Pizzas, 3 bottles of Coca-Cola, and 1 Meat lovers, costing $92.00"? Another student came to the board and wrote
4 Pineapple + 3 Coca Cola + 1 Meat Lovers = 92
The class again agreed this was sufficient.  At this time, a student in the back was getting irritated at how easy and time consuming this one.  I asked him to go to the front and in front of everyone translate "3 super size fries, 2 Extra large Coca-cola, and 1 double, extra bacon, cheeseburger costs $21".  He let out a big "UGH!", and asked me to repeat.  As I repeated he wrote...

3 F + 2 C + 1 CB = 21

He looked at me with a smile, and some of his classmates started to laugh.  I then told him "I said supersize fries, not Fs", which he responded with "Yeah this F is supersize fries".  We then had a dialogue around what CB could mean.  After some time, a student asked "Could that be Cheese times burgers?",  and almost immediately a student yelled "but C is coca-cola, so coca-cola times burger?". The student, at the board then changed his answer to   

3 F + 2 C + 1 B = 21

I then wrote on the board

3D +2C = 13

and asked "What does that mean?".  The answers ranged from "3 Dogs and 2 cats cost 13" to "3 bags of dill pickles and 2 bags of cheetos is $13".  We then decided, as a class, that it is important to create a legend at the top.  Therefore we went back and wrote legends such as "F is Super size fries, C is extra large Coca-Cola..."

This was my attempt at students creating their own knowledge of variables.

Tuesday, June 10, 2014

Teaching math through Coding

I recently started teaching Computer Science 10 and 20 and I use the program Processing.  It is a free program and entirely based in a geometric space.  The cross curricular links in this program are amazing!  I want to share how my Grade 10 students were introduced to higher level math concepts while working with this program.

First, here is a program Sean wrote:
int[] numb = new int[5];
void setup() {
  size(800, 800);   background(255);   numb[0]=0;  numb[1]=200;  numb[2]=400;   numb[3]=600;  numb[4]=800;
void draw() {
  line(numb[int( random(0, 5))], numb[int( random(0, 5))], numb[int( random(0, 5))], numb[int( random(0, 5))]);
The picture it creates is:

Now in case you don't understand processing what is drawing does is takes the numbers 0, 200, 400, 600, and 800 and creates a line from all possible co-ordinates created from these numbers to all other possible co-oridinates.  For example a line from (200, 600) to (800, 800).  It does it in a random pattern, but after running for some time all possible lines are drawn. 

After Sean drew this I asked him "How many lines have been drawn?"  This is a typical Math 30-1 question, a course in which Sean has never been in yet.

After some thought he asked if it would be "5 times 5 times 5 times 5 times 5?"  or 3125.  This is of course, a great way to start the problem but is too high as you can't have a line from (0,0) to (0,0).  Also he didn't account that the line from (0, 400) to (600, 800) is the same as the line from (600, 800) to (0, 400).  At this point the bell rang and we will finish the conversation tomorrow.  However in Grade 10 Computer Science he was introduced to a Gr 12 Math concept called "Fundamental Counting Principle" and "Permutations and Combinations".

Next was Ex who wanted to create a scene where a sun rises and sets. His original project had the sun follow a straight line to the top of the screen and then follow a straight line back down to the horizon.  Following a "^" shape in the sky.  This of course is not how the sun moves, as it would move more in a parabolic shape. 

Unfortunatly, Ex has only taken Math 10 and not have heard of a "Parabola".  Consequently, I sat with him and we played with his code.   Instead of it following "y=-x+10" I asked him to put in "x^2" and to watch what will happen.  Instantly he was surprised to see his sun move in a different fashion than before.

He asked how do we move the sun right in the sky, as he wanted the sun to be at the highest point in the middle of the screen.  What he was asking was "How do we horizontally move the parabola?".  Again this is Math 30 concept.  Through some guided discovery, Ex realized that by replacing x with x-h we move the parabola left and right.  

 Here is his final code.
int xPos=0; float xPos2=260; int positionX =50; int positionY = 100; int Switch = 0;
void setup() {
  size(500, 500);  smooth();
void draw() {
  background(130, 200, 255);  fill(255, 238, 21);  ellipse(xPos, xPos2, 100, 100);  xPos=xPos+1;
    background (0);
  noStroke();  fill(15, 80, 0);  rect(0, 300, 500, 400);  fill(40, 40, 40);  rect(200, 230, 100, 70);
  fill(65, 65, 65);  rect(235, 250, 30, 50);  triangle(300, 190, 300, 230, 202, 230);  ellipse(240, 280, 5, 5);
  fill(53, 43, 32);  rect(140, 230, 20, 70);  fill(6, 62, 0);  ellipse(150, 220, 60, 60);  fill(112, 112, 112);
  rect(0, 355, 500, 100);  fill(191, 191, 9);  rect(0, 400, 50, 10);  rect(75, 400, 50, 10);  rect(150, 400, 50, 10);
  rect(225, 400, 50, 10);  rect(300, 400, 50, 10);  rect(375, 400, 50, 10);  rect(450, 400, 50, 10);

Thursday, May 8, 2014

Cross Competencies in Alberta

In 2016, the Alberta Government is going to remove the "silos of learning" occurring in our schools.  No longer will only the English teachers teach literacy, and the Math teachers teach numeracy.  Here is an example of a problem that a student could face, with examples of how different grades could react to this problem.

Your community is planning to build a new recreation centre and is looking for residents of the area to share ideas.  You have the opportunity to offer your suggestions to the planning committee.  Think about the activities you would like to do at the centre.  Research what other communities offer at their recreation centres.  Considering the needs and interests of your community, select a format that will best communication your ideas to the planning committee.  Use your research to support your ideas.

Examples of how certain grades could address this task.

Grade 1- "We looked at pictures of really cool rec centres.  Then we drew pictures of things we want in our new rec centre like indoor soccer fields and rinks for learning to skate."
Grade 8- "I worked collaboratively with my skateboarding friends to create a PowerPoint presentation for the committee.  We would like a skateboarding park because we need a safe place to ride and learn new tricks."
Grade 12-"I wrote a speech advocating for a public library in the centre, recorded it as a podcast, and submitted a copy to the planning committee"

As you can see that the passions and interests of the students are just as important as the learning outcomes and content of the lesson.  Also you can see how many subject areas could be involved in this problem.  In 2016, cross-curricular competencies will be implemented.  Here is a diagram of the competencies.

How will these fit in with "Learning Outcomes" and the "Literacy and Numeracy" Benchmarks?  Here is another diagram showing the connection.

Thursday, April 17, 2014

Lowering Standards or increasing classes?

I think it is time to go back to traditional assessments.  Why? I am tired of large class sizes.... See, larger class sizes are the result of changing assessment.  

First, I abolished grades in my class, then instead of standardizing assessments, I actually personalized my assessment after some time I removed deadlines for assignments.  Why did I do all this?

I did this because my failure/drop rate in my calculus classes was extremely high.  The first 2 years, of teaching Calculus, I had a failure/drop rate of 40-50% of the class.  I would start with classes around 38 and end with classes around 18.  In one class, students had bets on what would be the final number of students.  This had to stop!  

Over the course of 2 years, I realized that my teaching was not the problem; it was how I assessed students.  I made all students know the material by Friday, assessed with a Multiple Choice, Written Response exam, and never let a child have a chance to be reassessed. In addition I would assign over an hour of homework each day.

Below is the result.  If there is one line you look at, it should be the orange one.  The orange line is the percentage of students who have failed/dropped my calculus class in each year.  The time is over 4 years.

I currently have a drop/failure rate of 4-5%.  I do believe I can get this to 0!  Was I joking about going back to traditional assessment? Yes!! Was I joking about classes being larger? No!  However, this is not a bad thing!  Here are what the other lines are

Light blue-The percentage of "traditional assessments" I use in my class.
Green-The class average on my Final Exam (This has been the constant over the 4 years)
Purple- The final class average.


  • The number of traditional assessment is directly related to my drop/failure rate. 

What is also pretty cool is you can see, by the green and blue lines, that the "standard" or "average" of my class has not dropped significantly!!  In fact, my class average has increased.  More kids completing the course and even a higher average....Remember these kids are not doing homework, prepping for exams, or completing worksheets.

There was one year, in which the Final Exam marked dropped, as it was due to the fact that I was perfecting my open ended projects.

Conclusion: If you want small class sizes, please use traditional assessments.  If you want a low drop/failure rate, please click on the links at the top and learn more.