Showing posts with label codemaths. Show all posts
Showing posts with label codemaths. Show all posts

Thursday, March 12, 2015

Sparkfun Inventor's Kit: Choice activity in math class


After seeing a tweet from Casey Rutherford last week, I looked into the Sparkfun Inventor's Kit for my math students. It's a physical circuit board that allows students to play with code that causes the board to interact in the real world--LED lights, displays, sounds, motors, sensors, etc. The kit arrived this morning and rather than get it all figured out myself I threw it (figuratively) to the kids and let them try it out.
My initial concerns was, "I have chromebooks, do I need to install anything to get it to work?" Early into this thread that started in 2011 the answer would have been "No" but then this guy named Casey Halverson created a Chrome Webstore app called ChromeDuino that turns it into a plug and play device with Chromebooks. My students had the app installed in a minute and before 3 minutes were starting to follow the instructions in the user manual in getting starting on some of the beginner activities.

Before the kids got to school I actually plugged it into my Mac desktop running OSX and had trouble getting it to recognize the device. I had to install an application and then decide which serial device port was connected...blah blah blah. I never actually got it to connect properly but it didn't matter because the Chromebooks were the intended device.

This just might be one of the coolest uses for Chromebooks in a STEM application I have seen yet and it gets the creativity going when kids begin to think about the connections between computer programming and the physical world. I often hope and wonder if having experiences like this in the classroom can be moments where my students years from now will look back and say "That is when I became more interested in __________ and look at where I am today!"

Monday, November 25, 2013

#codemaths: Code exporting

For my own interest and in trying to make future work easier for myself I added a code export button the the #codemaths app. A person can now build a question in the app, test it quickly and then add it to a practice set to be used with students here. All code will be generated for the practice set script that will be used within the curly brackets below (in the questionSet file):
if(questionType==1)
{
Exported code here
}
 
You will still need to specify how many questions and follow the steps on publishing it as a web app but the other coding stuff gets much easier now.
This weekend I had a student email his codemaths creation of an equation that used random variables that always had a solution of 1. He talked to me about specific numerical examples and then went ahead and proved why it would always work SYMBOLICALLY...pretty cool. We haven't nearly touched that in class but he is excited enough and motivated by his project to figure it out on his own. My building tech teacher has also said he's seen kids working on it in the lab before school.

Sunday, November 17, 2013

Share #codemaths creations with others!

I now have it set up so code that is created in the #codemaths app can be shared with others through a url. This is a temporary solution for students wanting to be able to share their code with me and with others but I think it adds to the potential for making this a more useful tool in my classroom. I'm learning so much as I go and it has been fun to watch my students learning some fundamental code ideas as well. I hope to have a blog focusing on their work in the app after another week or so. Here is the link to app with some custom code already set and a screenshot below showing the Share Code addition.



Monday, November 11, 2013

#codemaths: Student outlining his approach to coding an algebra solution.

We are up and running in class today. This morning I caught a glitch that caused any use of commas to break the code but that is fixed. I had students working in class on this that were already proficient in solving equations with variables on both sides and understanding the causes for no solutions and infinite solutions.

The task for the group working in #codemaths was this:
Before you watch the video keep in mind that these students have had little or no experience up to today in writing computer code.


Sunday, November 10, 2013

Updated #codemaths web app

I've updated the app to now allow for evaluated expressions instead of just replacement of variables a, b and c in user input fields and have made it look a little nicer. Here is a new screen shot and link to the current version. Excited to try it with kids on Monday!

Saturday, November 9, 2013

Entry level point for using programming in Algebra!


After working with kids last Friday I left school thinking that maybe there is a way to get them into the idea of constraints, if statements and random variables without them having to do so much messy work early on. I'm working on making a web app that will let them enter only the constraints, variable expression, solution and worked out feedback when someone answers the question wrong. A problem I'm currently having is how to also allow for <a+b> to be replaced by the sum of the variables a and b. Right now it will only replace <a> with the variable a, etc. It does work and I am going to be working with kids this week on it. I'm pretty excited about this--it seems like a good way to integrate early JavaScript skills with my algebra class. What I see coming in the near future is evaluating expressions within sentence and making it a little more visually appealing. Here it is if you want to try it out so far.

Friday, November 8, 2013

Applying student learning to writing code


Today in class I worked with a small group of kids on applying Google Apps Script concepts to some basic algebra that they have learned in the past. I have not done anything like this before with students so I am beginning to think through some of the pieces that they will need to know. I am getting their feet wet by using the same computer generated practice template that I've been using to provide practice for students in my algebra classes.
Please know that I am not completely going computer math here--this is just what is used for the practice and remediation cycle for my students. We are still having class discussions on parallel tasks, open ended questions, pulling out algebra tiles and self-assessing our own work and understanding.
Here is a link to a presentation outlining some of the components needed to begin working in it.

Tuesday, October 22, 2013

Computer generated practice


It's out there and I get that. As a teacher I always find that something that is already made is not quite what I'm looking for so I make it again myself. It's a problem I have and I should probably get some help :)

That being said, if you know some javascript I've shared the code for my computerized practice that I've been developing for my algebra kids this year. For those not experienced in javascript this is probably the point where you just stop reading and visit the blog another day...

Click here to get a copy of the script file. I have it set when you click to make a copy in your current Google Apps account.

In the file, go to the questionSet file. The questions in the comments should give a step by step of where to go and what to do.

Basic idea is you can make question sets for students (and I'm hoping to get some advanced students to apply their learning to make their own question sets to share with me). Here is an example of a set of questions.
[Here is a link to the code (specifically in the questionSet file) for the activity.]

I've also put some help slides related to this in my programming track presentation for students here.

Tuesday, September 10, 2013

What's in the bag: Theoretical vs Experimental Probability

If I thought yesterday was boring--what did the kids think?!
Yesterday I reflected on how tragic it was that we talked all day about dice, coins and cards and never had them in student hands. I thought about what aspects of this new class I thought were important and what things could be discontinued (or as Google would put it 'deprecated').

What I want to continue:
  1. Student self-reflection based on learning target rubrics on a semi-daily basis
  2. Activities and labs centered on the learning targets (ideally incorporating multiple targets)
  3. Short, meaningful yet challenging applications of the learning
  4. Computerized practice and resources for kids that need it
What will be optional but not a focus in class:
  1. Video lessons
  2. Notes packets
  3. 'I do, you repeat' cycle of examples

Sunday, August 4, 2013

Order of operations practice with feedback


My summer hobby has turned out to be learning more programming. I want to try and create some practice for students in areas that I anticipate will need more practice. One of those earlier topics being the order of operations. Now that I have the code put together I think making future practice exercises will go much quicker. On the programming side I learned this time around how to have help text appear within the textbox and then disappear when clicked--something I wish Google forms would integrate *hint, hint*
Here's the link to the practice. There are seven question types, chosen randomly. If there is another you want me to add write it out in the comments below and I'll get it in there.
Here is a link to the code file.
*Disclaimer: rather than program a solution for division by zero I just made sure not to have any questions that would have that occur. When using division in expressions I didn't want crazy decimals so you'll always see division by 2.

Thursday, July 25, 2013

'What's in the bag?' #gamified

As I was playing with my 'What's in the bag?' app I found myself thinking about my accuracy each round, trying to minimize the number of draws before I could see the solution and wishing there was a way to measure all those things. So instead of mowing my lawn, playing some guitar or other fun things I decided to figure it out. What I think I have is a finished game that could be used in my class at various points in the year and at different levels. (Click here for a link to the game)
1. Scoring points: In the scoring structure I tried to reward behaviors each round like minimal number of draws and maintaining a high accuracy level. I also didn't want a kid to be able to just keep doing poorly but getting more points just for persistence. (This feels like a metaphor for classroom grading policies...). As part of my class activities surrounding this game I will ask students to create a function that rewards these game behaviors using something like desmos.com to set up some sliders and view possible point values. Maybe some will actually figure out the function I have in the game itself. 
2. Probability: I want students to be thinking about sample size, potential combinations, experimental vs theoretical. There is a high reward value for guessing the correct combinations without drawing be we all know how that will end. I anticipate many conversations when they get one wrong that shows 8 greens and 3 red and the actual composition in the bag that round is 2 green and 2 red.
3. Ending the game: I didn't want to have to program an end to the game and I wanted students to decide when that stopping point occurs. As the number of games played increases, the points possible for each round will reduce...and actually approach zero : ) I like that it is hidden in the game play and they will discover it as they get further along. #evilteacher. 
4. Programming: I want to template the code a bit to give students a structure for creating their own javascript games later in the year. This may be naive wishful thinking in that I've never tried to teach javascript to algebra students and I have know idea how many will even go for it.
Anyway, I know what I'll be doing while I watch TV tonight. I'd love to hear your thought on this in the comments and would highly encourage you to start learning some programming. There are so many applications for it in my classroom.

Tuesday, July 23, 2013

What's in the bag?


This fall our first unit for the middle school algebra course I will be teaching will be on probability. I am also running a classroom of Chromebooks (two students to each device). I am guessing many of the students I have will already be comfortable with the basics of the probability unit I am required to teach so I want to promote thinking beyond what they have already learned with some open ended tasks.

I have had the privilege of learning from Terry Wyberg in past staff development and one of the activities he shared was 'What's in the bag?'. Each student or group of students is given a bag with 4 cubes placed in it of different colors. Students perform an experiment to try and determine the color composition of the bag without actually looking at more than 1 cube at a time (and replacing a drawn cube after looking at it).

I wanted to duplicate this activity with random combinations to be used on our computers. That way I don't have to create all these physical bags and kids will be able to look at patterns and develop their own ideas related to the number of trials and how they relate to the bag's composition. This will also be another program students (hopefully) could look at in creating their own programs as they move into javascript programming which I hope to be a parallel learning path within my algebra course.

Click here for a link to the web app and here for a link to the code.

Saturday, July 13, 2013

Course resource display manager for students


What is it?
I think I have put this together in a way that should allow for others to duplicate this for their own classroom. My goal was to allow students to locate resources for class simply by typing in an input box and the available resources would be filtered in real time. I could also see including items in the list that are not links like extension questions for students to think about. Links that are included could also be from various sources (not just YouTube) like Google presentations, related websites, links for electronic quizzes, etc. I've also tried to put it together in a way that allows collaboration where anyone with access to the form link can submit resources at any time and they will be included automatically in what is displayed.
*In making some changes to standardize this it is possible there may be an error in my code. Please let me know in the comments if you've followed the steps below and it doesn't seem to run.

Here is how to get started:
1. Click here to make a copy of the template.
2. Open the spreadsheet (or view responses if you are looking at the form) and copy the spreadsheet key ID:
The Key ID is the portion of the web address of the file you are wishing to copy between the key= and the # symbol:https://docs.google.com/spreadsheet/ccc?key=0ApfEUqF5qtzJdEh2QndSWGk5cG44RVNjUWhSR3ZPSUE#gid=3
3. From the Tools menu click on Script Editor, in line 8 replace the text "Spreadsheet key goes here" with your copied spreadsheet ID (with quotation marks around it like this "1234ASDFSAWEFSADFnf" for example).
4. Click the Publish menu and then "deploy as web app".
5. Save a version number (give it a name of some sort when prompted).
5. Set it to execute by you (says 'me' and then your email address) and then set access to the app as 'anyone, even anonymous'.
6. Finally publish it and then share the current link that appears to allow others to access your class resources.

Notes: 

  • Clicking on a column header will sort the table of resources by that column.
  • Columns B through E all need to have entries in them for the app to display without error and I don't think it will run into you have at least one row of resources entered in.
  • Feel free to tweak this for your own needs if you are feeling brave with javascript code.
  • You could create an ifttt.com recipe that sends new YouTube upload links and info to a Google spreadsheet (could even be this spreadsheet if you set it up correctly).


Tuesday, June 25, 2013

Using coding to think deeply in math #codemaths

What led me here...
I write this in hopes of what the next year will look like for my students in Algebra. I find the more that I learn to write code the more important it is that I pass on this skill to my students. Perhaps with daily access to Chromebooks and Google Apps Scripts in their Google Drive that will look like building extension activities parallel to the algebra we are learning in class that will also teach the code skills to my students.
In writing some of more own programs I feel that I've had to think deeply about the mathematics in order to consider all possible outcomes for anticipating errors or situations that may cause the program to break. Last spring I wrote a web app that will take the coordinates (in order) for a convex polygon and identify it (quadrilateral, parallelogram, square, rectangle, rhombus, kite, trapezoid). I had to anticipate what would happen if slopes calculated in the program would be zero or undefined and how to address that situation for the final output. I didn't have students create an actual program but some did choose to make a Google presentation that, through clicked links, would identify what type of a quadrilateral is present at the end by its properties.
Yesterday, while in a workshop on using code to teach mathematics, I decided to dig deeper into my quadrilateral program.
Researching what I thought might be possible
By doing some searching online here and here I found a 'fun' way to calculate the area of any convex quadrilateral using the slope and distances of its diagonals. This was an exercise where using a trig identify was actually necessary! So here is what I found:
You can calculate the area of a quadrilateral (convex) by taking half of pq sin θ where p and q are the lengths of the diagonals and θ is the angle between them.
This prompted me to ask the next question:
How do I calculate the angle between two lines using  their slopes?
Like any good child of the millennial generation I Googled the question I was asking and found this:
 θ = tan^(-1) [(m2 - m1)/(1 + m1*m2)]
Putting it together as a composite function:
Area = 0.5 pq sin ( tan^(-1) [(m2 - m1)/(1 + m1*m2)] )
Considering the range of circumstances
And now I had to think about what this would mean in the program. I know that there is the possibility of having some vertical lines as diagonals (problematic in a program because of division by zero) and also the possibility that a diagonal may be horizontal. I would need to use some if, else if, and else statements to account for this and figure out what to do in that situation. This is where some discovery for me as a math teacher took place:
In the situation of either a vertical or horizontal diagonal I could think of the quadrilateral being split by it, creating two triangles and finding their area by multiplying the length of the vertical/horizontal diagonal and then the difference in either the x coordinates or y coordinates respectively of the other diagonal (basically the altitudes of the two triangles added together). The horizontal diagonal wasn't really problematic in the program but I thought the connection to the vertical diagonal process was interesting.
In the situation of a vertical and horizontal diagonals this would create perpendicular lines causing θ = 90. Since sin 90 = 1 the area calculation simplifies to 0.5 pq which is the formula we teach in Geometry for areas of kites and rhombus (kind of cool to see how all the area formulas are related by trigonometry for me at this point).
For all other quadrilaterals I can just calculate the slopes and distances of the diagonals and use the standard formula above.
Converting the math to code
 So here is the javascript code for calculating the area of quadrilateral ABCD, for sake of time I'm not going to explain the variables but I'm guessing if you've read this far you can figure it out:
 //////////Area of quadrilateral////////////////////
   if (slopeAC == 0){if(slopeBD =="undefined"){var areaCalc = 0.5*distAC*distBD;}else{var areaCalc = Math.abs(distAC*yDiffBD);}}
  else if (slopeAC == "undefined"){if(slopeBD ==0){var areaCalc = 0.5*distAC*distBD;}else{var areaCalc = Math.abs(distAC*xDiffBD);}}
  else if (slopeBD == "undefined"){var areaCalc = Math.abs(distBD*xDiffAC);}
  else if (slopeBD == 0){var areaCalc = Math.abs(distBD*yDiffAC);} //This condition is not necessary and would be covered in the final else statement but is interesting in how it relates to the previous else if statement
  else
  {
  var theta = Math.atan(Math.abs((slopeAC-slopeBD)/(1+slopeAC*slopeBD)));
  var areaCalc = 0.5*distAC*distBD*Math.sin(theta);
  }  
 So now to think how to lead students toward learning these same skills...