When things just work – starting with computers

Today’s lesson on objects in orbit went fantastically well, and I want to note down exactly what I did.

Scare the students:

Screen Shot 2013-02-05 at 3.23.59 PMhttp://neo.jpl.nasa.gov/news/news177.html

Push to (my) question – how close is that?

Connect to previous work:

The homework for today was to use a spreadsheet to calculate some things about an orbit. Based on what they did, I started with a blank sheet toward the beginning of class and filled in what they told me should be there.
orbit calculationsScreen Shot 2013-02-05 at 3.30.08 PM
Some students needed some gentle nudging at this stage, but nothing that felt forced. I hate when I make it feel forced.

Play with the results

Pose the question about the altitude needed to have a satellite orbit once every twenty four hours. Teach about the Goal Seek function in the spreadsheet to automatically find this. Ask what use such a satellite would serve, and grin when students look out the window, see a satellite dish, and make the connection.

Introduce the term ‘geosynchronous’. Show asteroid picture again. Wait for reaction.

Screen Shot 2013-02-05 at 3.23.59 PM

See what happens when the mass of the satellite changes. Notice that the calculations for orbital speed don’t change. Wonder why.

See what happens with the algebra.

Screen Shot 2013-02-05 at 3.36.51 PM

See that this confirms what we found. Feel good about ourselves.

Wonder if student looked at the lesson plan in advance because the question asked immediately after is curiously perfect.

Student asks how the size of that orbit looks next to the Earth. I point out that I’ve created a Python simulation to help simulate the path of an object moving only under the influence of gravity. We can then put the position data generated from the simulation into a Geogebra visualization to see what it looks like.

Simulate & Visualize

Introduce how to use the simulation
Use the output of the spreadsheet to provide input data for the program. Have them figure out how to relate the speed and altitude information to what the simulation expects so that the output is a visualization of the orbit of the geosynchronous satellite.

Screen Shot 2013-02-05 at 3.55.37 PM

Not everybody got all the way to this point, but most were at least at this final step at the end.


I’ve previously done this entire sequence starting first with the algebra. I always would show something related to the International Space Station and ask them ‘how fast do you think it is going?’ but they had no connection or investment in it, often because their thinking was still likely fixed on the fact that there is a space station orbiting the earth right now . Then we’d get to the stage of saying ‘well, I guess we should probably draw a free body diagram, and then apply Newton’s 2nd law, and derive a formula.’

I’ve had students tell me that I overuse the computer. That sometimes what we do seems too free form, and that it would be better to just get all of the notes on the board for the theory, do example problems, and then have practice for homework.

What is challenging me right now, professionally, is the idea that we must do algebra first. The general notion that the ‘see what the algebra tells us’ step should come first after a hook activity to get them interested since algebraic manipulation is the ultimate goal in solving problems.

There is something to be said for the power of the computer here to keep the calculations organized and drive the need for the algebra though. I look at the calculations in the spreadsheet, and it’s obvious to me why mass of the satellite shouldn’t matter. There’s also something powerful to be said for a situation like this where students put together a calculator from scratch, use it to play around and get a sense for the numbers, and then see that this model they created themselves for speed of an object in orbit does not depend on satellite mass. This was a social activity – students were talking to each other, comparing the results of their calculations, and figuring out what was wrong, if anything. The computer made it possible for them to successfully figure out an answer to my original question in a way that felt great as a teacher. Exploring the answer algebraically (read: having students follow me in a lecture) would not have felt nearly as good, during or afterwards.

I don’t believe algebra is dead. Students needed a bit of algebra in order to generate some of the calculations of cells in the table. Understanding the concept of a variable and having intuitive understanding of what it can be used to do is very important.

I’m just spending a lot of time these days wondering what happens to the math or science classroom if students building models on the computer is the common starting point to instruction, rather than what they should do just at the end of a problem to check their algebra. I know that for centuries mathematicians have stared at a blank paper when they begin their work. We, as math teachers, might start with a cool problem, but ultimately start the ‘real’ work with students on paper, a chalkboard, or some other vertical writing surface.

Our students don’t spend their time staring at sheets of paper anywhere but at school, and when they are doing work for school. The rest of the time, they look at screens. This is where they play, it’s where they communicate. Maybe we should be starting our work there. I am not recommending in any way that this means instruction should be on the computer – I’ve already commented plenty on previous posts on why I do not believe that. I am just curious what happens when the computer as a tool to organize, calculate, and iterate becomes as regular in the classroom as graphing calculators are right now.

Computational Thinking & Spreadsheets

I feel sorry for the way spreadsheets are used most of the time in school. They are usually used as nothing more than a waypoint on the way to a chart or graph, inevitably with one of its data sets labeled ‘Series 1’. The most powerful uses of spreadsheets come from how they provide ways to organize and calculate easily.

I’ve observed a couple things about the problem solving process among students in both math and science.

  • Physics students see the step of writing out all of the information as an arbitrary requirement of physics teachers, not necessarily as part of the solution process. As a result, it is often one of the first steps to disappear.
  • In math, students solving non-routine problems like Three Act problems often have calculations scrawled all over the place. Even they are written in an organized way, in the event that a calculation is made incorrectly, any sets of calculations that are made must be made again. This can be infuriating to students that might be marginally interested in finding an answer in the first place.
  • Showing calculations in a hand written document is easy – doing so in a document that is to be shared electronically is more difficult. There are also different times when you want to see how the calculation was made, and other times that you want to see the results. These are often presented in different parts of a report (body vs. appendix) but in a digital document, this isn’t entirely necessary.

Here’s my model for how a spreadsheet can address some of these issues:
Screen Shot 2013-02-01 at 7.47.59 PM

Why I like it:

  • The student puts all of the given information at the top. This information may be important or used for subsequent calculations, or not. It minimally has all of the information used to solve a problem in one place.
  • The coloring scheme makes clear what is given and what is being being calculated.
  • The units column is a constant reminder that numbers usually have units. In my template, this column is left justified so that the units appear immediately to the right of the numerical column.
  • Many students aren’t comfortable exploring a concept algebraically. By making calculations that might be useful easy to make and well organized, this sets students up for a more playful approach to figuring things out.
  • Showing work is easy in a spreadsheet – look at the formulas. Depending on your own expectations, you might ask for more or less detail in the description column.

Some caveats:

    • A hand calculation should be done by someone to confirm the numbers generated by the spreadsheet are what they should be. This could be a set of test data provided by the teacher, or part of the initial exploration of a concept. Confirming that a calculation is being done correctly is an important step of trusting (but verifying, to quote Reagan for some reason) the computer to make the calculations so that attention can be focused on figuring out what the numbers mean.
    • It does take a bit of time to teach how to enter a formula into a spreadsheet. Don’t turn it into a lecture about absolute or relative addressing, or about rows and columns and which is which – this will come with practice. Show how numbers in scientific notation look, and demonstrate how to get a value placed in another cell. Get straight into making calculations happen among your students and in a way that is immediately relevant to what you are trying to do. Then change a given value, and watch the students nod when all of the values in the sheet change immediately.
    • Building off of what I just said, don’t jump to a spreadsheet for a situation just to do it. The structure and order should justify itself. Big numbers, nasty numbers, lots of calculations, or lots of given information to keep track of are the minimum for establishing this from the start as a tool to help do other things, not an end in and of itself.
    • Do not NOT

      NOT

      hand your students a spreadsheet that calculates everything for them. If a student wants to make a spreadsheet for a particular type of calculation, that’s great. That’s the student recognizing that such a tool would be useful, and making the effort to do this. If you hand them a calculator for one specific application, it perpetuates the idea among students that they have to wait for someone else that knows better than them to give them the tool to use. Students should have the ability to make their own utilities, and this is one way to do it.

Example from class yesterday:

We are exploring the way Newton’s Law of Gravitation is used. I asked students to calculate the force of gravity from different planets in the solar system pulling on a 65 kilogram person on Earth, with Wolfram Alpha as the source of data. Each of them used a scientific or graphing calculator to calculate their numbers, with the numbers they used written by hand (without units) on their papers with minimal consistency. They grumbled about the sizes of the numbers. When noticeable differences arose in magnitude between different students, they checked each other until they were satisfied.

I then showed them how to take the pieces of data they found and put them in the spreadsheet in the way I described above. In red, I highlighted the calculation for the magnitude of the force for an object on Earth, and then asked a student to give me her data. This was the value she calculated! I was quickly able to confirm the values that the other students also had made.

I then had them calculate the weight of an object on Earth’s surface using Newton’s law of gravitation. This sent them again on a search for data on Earth’s vital statistics. They were surprised to see that this value was really close to the accepted value for g = $latex 9.8;m/s^2$. I then asked them in their spreadsheet how they might figure out the acceleration due to gravity based on what they already knew. Most were able to figure out without prompting that dividing by the 65 kilogram mass got them there. I then had them use that idea and Newton’s Law of Gravitation to figure out how to obtain the acceleration due to gravity at a given distance from the mass center of a planet. I then had them use the spreadsheet model on their own to calculate the acceleration due to gravity on a couple of different planets, and it went really well.

The focus from that point on was on figuring out what those numbers meant relative to Earth. Often with these types of problems, students will calculate and be done with it. These left them a bit curious about each other’s answers (gravity on Jupiter compared to the Moon) and opened up the possibilities for subsequent lessons. I’ll write more about how I have grown to view spreadsheets as indispensable computing tools in the classroom in the future. A pure computational tool is the lowest level on the totem pole of applications of computers for learning mathematics or science, but it’s a great entry point for students to see what can be done with it.

Files:

Spreadsheet Calculation Template

Centripetal Acceleration of the Moon – a comparison we used two days ago to suggest how a 1/r^2 relationship might exist for gravity and the moon.

 

 

Angry Birds Project – Results and Post-Mortem

In my post last week, I detailed what I was having students do to get some experience modeling quadratic functions using Angry Birds. I was at the 21CL conference in Hong Kong, so the students did this with a substitute teacher. The student teams each submitted their five predictions for the ratio of hit distance to the distance from the slingshot to the edge of the picture. I brought them into Geogebra and created a set of pictures like this one:

Screen Shot 2013-01-29 at 7.57.47 AM

After learning some features of Camtasia I hadn’t yet used, I put together this summary video of the activity:

[wpvideo ysubHH3L]

I played the video, and the students were engaged watching the videos, but there was a general sense of dread (not suspense) on their faces as the team with the best predictions was revealed. This, of course, made me really nervous. They did clap for the winners when they were revealed, and we had some good discussion about modeling, which videos were more difficult and why, but there was a general sense of discomfort all through this activity. Given that I wasn’t quite able to figure out exactly why they were being so awkward, I asked them what they thought of the activity on a scale of 1 – 10.

They hated it.

I should have guessed there might be something wrong when I received three separate emails from the three members one team with results that were completely different. Seeing three members of one team work independently (and inefficiently) is something I’m pretty tuned in to when I am in the room, but this was bigger. It didn’t sound like there was much utilization of the fact that they were in teams. I need to ask about this, but I think they were all working in parallel rather than dividing up the labor, talking about their results, and comparing to each other.

Some things I want to remember about this:

  • I need to be a lot more aware of the level of my own excitement around activity in comparison to that of the students. I showed one of the shortened videos at the end of the previous class and asked what questions they really wanted to know. They all said they wanted to know where the bird would land, but in all honesty, I think they were being charitable. They didn’t really care that much. In the game, you learn shortly after whether the bird you fling will hit where you want it to or not. Here, they had to go through a process of importing a picture, fitting a parabola, and finding a zero of a function using Geogebra, and then went a weekend without knowing.

    While it is true that using a computer made this task possible, and was more enjoyable than being forced to do this by hand, the relativity of this scale should be suspect. “Oh good, you’re giving me pain meds after pulling my tooth. Let’s do this again!”

  • A note about pseudocontext – throwing Angry Birds in to a project does not by itself does not necessarily engage students. It is a way in. I think the way I did this was less contrived than other similar projects I’ve seen, but that didn’t make it a good one. Trying to make things ‘relevant’ by connecting math to something the students like can look desperate if done in the wrong way. I think this was the wrong way.
  • I would have gotten a lot more mileage out of the video if I had stopped it here:

    Screen Shot 2013-01-30 at 9.23.26 AM
    That would have been relevant to them, and probably would have resulted in turning this activity back around. I am kicking myself for not doing that. Seriously. That moment WAS when the students were all watching and interested, and I missed it.

Next time. You try and fail and reflect – I’m still glad I did it.

We went on to have a lovely conversation about complex numbers and the equation $latex x^{2}+4 = 0 $. One student immediately said that $ sqrt{-2} $ was just fine to substitute. Another stayed after class to explain why she thought it was a disturbing idea.

No harm done.

P.S. – Anyone who uses this post as a reason not to try these ideas out with their class and to instead slog on with standard lectures has missed the point. I didn’t do this completely right. That doesn’t mean it couldn’t be a home run in the right hands.

Why computational thinking matters – Part I

My presentation at 21CLHK yesterday was an attempt to summarize much of the exploration I’ve done over the past year in my classroom into the connection between learning mathematical concepts and programming. I see a lot of potential there, but the details about how to integrate it effectively and naturally still need to be fleshed out.

After the presentation, I felt there needed to be some way to keep the content active other than just posting the slides. I’ve decided to take some of the main pieces of the presentation and package them as videos describing my thinking. I’m seeing this as an iterative process – in all likelihood, these videos will change as I refine my understanding of what I understand about the situation. Here is the start of what will hopefully be a developing collection:

[wpvideo HOucYa4m]

[wpvideo L3jr2hor]

[wpvideo PBc7xzdW]

I want to express my appreciation to Dan Meyer for his time chatting with during the conference about my ideas on making computation a part of the classroom experience. He pushed back against some my assertions and was honest about which arguments made sense and which needed more definition. I think this is a big deal, but the message on the power of computational thinking has to be spot on so it isn’t misunderstood or misused.

With the help of the edu-blogging community, I think we can nail this thing down together. Let’s talk.

How Good is Your Model (Angry Birds) Part 2 – Refining my process

A year ago, I wrote about my attempt to integrate Angry Birds as part of my quadratic modeling unit. I was certainly not the first, and there have been many others that have taken this idea and run with it. This is definitely a great way of using the concept of fitting parabolas to a realistic task that the students can have fun completing.

As I said a year ago, however, the bigger picture skill that is really powerful with modeling is making do with less information. I incentivized my students last year to come up with a model that predicts the final location of the collision of a bird earlier than everyone else. In other words, if Thomas is able to predict the correct final location with ten seconds of data, while Nick is able to do so with only seven, Nick has done the better job of modeling. I did this by asking the students to try to do this with the earliest possible frame in the video.

This time, I have found a better way to do this. Five videos, all of them cut short.
I’m asking the students to complete this table:
Screen Shot 2013-01-22 at 6.03.12 PM

The impact ratio is defined as the ratio of the orange line to the yellow line, as shown in this image:
Screen Shot 2013-01-22 at 6.04.44 PM

Each group of students will calculate the ratio for each video using Geogebra. Some videos reveal more about the path than others. I’ll sum the errors, rank the student groups based on cumulative error, and then we’ll have a great discussion about what made this difficult.

The sensitivity of a quadratic (or any fit) fit to data points that are close together is what I’m targeting here. I’ve tried other techniques to flesh this out in students before – I still get students ‘fitting’ a table of data by choosing the first two or three points. I’m hoping this will be a bit more interesting and successful than my previous attempts.

Trimmed Angry Bird Videos:

[wpvideo Em5oyDGw]
[wpvideo oJJml7i5]
[wpvideo gf2zXikv]
[wpvideo EY77wnKI]
[wpvideo DENYt0RX]

Cell phone tracking, Processing, and computational thinking

I gave a survey to my students recently. My lowest score on any of the questions was ‘What I learn in this class will help me in real life.’ I’ve given this question before, and am used to getting less than optimal responses. I even think I probably had a higher score on this question than I have received previously, but it still bothers me that we are having this discussion. Despite my efforts to include more problem solving, modeling, and focusing on conceptual understanding related tasks over boring algorithmic lessons, the fact that I am still getting lower scores on this question compared to others convinces me that I have a long way to go.

I came up with this activity in response. It combines some of the ideas I learned in my Udacity course on robotic cars with the fact that nearly all my students carry cell phones. While I know many cell phones have GPS, it is my understanding that phones have used cell towers for a while to help with the process of locating phones. It always amazes me, for example, how my cell service immediately switches to roaming immediately when driving across the US-Canada border, even when I had a non-GPS capable phone.

My students know how to find distance using the distance formula and sets of coordinates, but they were intrigued by the idea of going backwards – if you know your distance from known locations, can you figure out your own location? The idea of figuring this out isn’t complicated. It can most easily be done by identifying intersections of circles as shown below:

One of my students recalled this method of solving the problem from what he saw in the movie Taken 2 , and was quickly able to solve the problem this way graphically in Geogebra. Most students didn’t follow this method though – the general trend was to take a guess and adjust the guess to reduce the overall error until the distances were as close to the given distances as possible.

I got them to also look at other situations – if only two measurements to known locations are known, where could the cell phone be located? They played around to find that there were two locations in this case. I again pointed out that they were following an algorithm that could easily be taught to a computer.

I then showed them a Processing sketch that went through this process. It is not a true particle filter that goes through resampling to improve the guessed location over time, but it does use the idea of making a number of guesses and highlighting the ones with the lowest error. The idea of making 300,000 random guesses and choosing the ones that are closest to the set of distances is something that computers are clearly better at than humans are. There are analytical ways of solving this problem, but this is a good way of using the computational power of the computer to make a brute force calculation to get an approximate answer to the question.

You can look at the activity we did in class here:
Using Cell Phones to Track Location

Who’s gone overboard modeling w/ Python? Part II – Gravitation

I was working on orbits and gravitation with my AP Physics B students, and as has always been the case (including with me in high school), they were having trouble visualizing exactly what it meant for something to be in orbit. They did well calculating orbital speeds and periods as I asked them to do for solving problems, but they weren’t able to understand exactly what it meant for something to be in orbit. What happens when it speeds up from the speed they calculated? Slowed down? How would it actually get into orbit in the first place?

Last year I made a Geogebra simulation that used Euler’s method  to generate the trajectory of a projectile using Newton’s Law of Gravitation. While they were working on these problems, I was having trouble opening the simulation, and I realized it would be a simple task to write the simulation again using the Python knowledge I had developed since. I also used this to-scale diagram of the Earth-Moon system in Geogebra to help visualize the trajectory.

I quickly showed them what the trajectory looked like close to the surface of the Earth and then increased the launch velocity to show what would happen. I also showed them the line in the program that represented Newton’s 2nd law – no big deal from their reaction, though my use of the directional cosines did take a bit of explanation as to why they needed to be there.

I offered to let students show their proficiency on my orbital characteristics standard by using the program to generate an orbit with a period or altitude of my choice. I insist that they derive the formulae for orbital velocity or period from Newton’s 2nd law every time, but I really like how adding the simulation as an option turns this into an exercise requiring a much higher level of understanding. That said, no students gave it a shot until this afternoon. A student had correctly calculated the orbital speed for a circular orbit, but was having trouble configuring the initial components of velocity and position to make this happen. The student realized that the speed he calculated through Newton’s 2nd had to be vertical if the initial position was to the right of Earth, or horizontal if it was above it. Otherwise, the projectile would go in a straight line, reach a maximum position, and then crash right back into Earth.

The other part of why this numerical model served an interesting purpose in my class was as inspired by Shawn Cornally’s post about misconceptions surrounding gravitational potential and our friend mgh. I had also just watched an NBC Time Capsule episode about the moon landing and was wondering about the specifics of launching a rocket to the moon. I asked students how they thought it was done, and they really had no idea. They were working on another assignment during class, but while floating around looking at their work, I was also adjusting the initial conditions of my program to try to get an object that starts close to Earth to arrive in a lunar orbit.

Thinking about Shawn’s post, I knew that getting an object out of Earth’s orbit would require the object reaching escape velocity, and that this would certainly be too fast to work for a circular orbit around the moon. Getting the students to see this theoretically was not going to happen, particularly since we hadn’t discussed gravitational potential energy among the regular physics students, not to mention they had no intuition about things moving in orbit anyway.

I showed them the closest I could get without crashing:

One student immediately noticed that this did seem to be a case of moving too quickly. So we reduced the initial velocity in the x-direction by a bit. This resulted in this:

We talked about what this showed – the object was now moving too slowly and was falling back to Earth. After getting the object to dance just between the point of making it all the way to the moon (and then falling right past it) and slowing down before it ever got there, a student asked a key question:

Could you get it really close to the moon and then slow it down?

Bingo. I didn’t get to adjust the model during the class period to do this, but by the next class, I had implemented a simple orbital insertion burn opposite to the object’s velocity. You can see and try the code here at Github. The result? My first Earth – lunar orbit design. My mom was so proud.

The real power here is how quickly students developed intuition for some orbital mechanics concepts by seeing me play with this. Even better, they could play with the simulation themselves. They also saw that I was experimenting myself with this model and enjoying what I was figuring out along the way.

I think the idea that a program I design myself could result in surprising or unexpected output is a bit of a foreign concept to those that do not program. I think this helps establish for students that computation is a tool for modeling. It is a means to reaching a better understanding of our observations or ideas. It still requires a great amount of thought to interpret the results and to construct the model, and does not eliminate the need for theoretical work. I could guess and check my way to a circular orbit around Earth. With some insight on how gravity and circular motion function though, I can get the orbit right on the first try. Computation does not take away the opportunity for deep thinking. It is not about doing all the work for you. It instead broadens the possibilities for what we can do and explore in the comfort of our homes and classrooms.

Who’s gone overboard modeling in Physics? This guy, part I.

I’ve been sticking to my plan this year to follow the Modeling Instruction curriculum for my regular physics class. In addition to making use of the fantastic resources made available through the AMTA, I’ve found lots of ways to use Python to help drive the plow through what is new territory for me. I’ve always taught things in a fairly equation driven manner in Physics, but I have really seen the power so far of investing time instead into getting down and dirty with data in tables, graphs, and equations when doing so is necessary. Leaving equations out completely isn’t really what I’m going for, but I am trying to provide opportunities for students to choose the tools that work best for them.

So far, some have embraced graphs. Some like working with a table of data alone or equations. The general observation though is that most are comfortable using one to inform the other, which is the best possible outcome.

Here’s how I started. I gave them the Python code here and asked them to look at the lines that configure the program. I demonstrated how to run the program and how to paste the results of the output file into Geogebra, which created a nice visualization through this applet. Their goal through the activity was to figure out how to adjust the simulation to generate a set of graphs of position and velocity vs. time like this one:

Some used the graph directly and what they remembered from the constant velocity model (yeah, retention!) to figure out velocity and initial position. Others used the table for a start and did a bit of trial and error to make it fit. While I have always thought that trial and error is not an effective way to solve these types of problems, the intuition the students developed through doing came quite naturally, and was nice to see develop.

After working on this, I had them work on using the Python model to match the position data generated by my Geogebra Particle Dynamics Simulator. I had previously asked them to create sets of data where the object was clearly accelerating, so they had some to use for this task. This gave them the chance to not only see how to determine the initial velocity using just the position data, as well as use a spreadsheet intelligently to create a set of velocity vs. time data. I put together this video to show how to do this:

[wpvideo bQyM2woe].

It was really gratifying to see the students quickly become comfortable managing a table of data and knowing how to use computational tools  to do repeated calculations – this was one of my goals.

The final step was setting them free to solve some standard  Constant-Acceleration kinematics problems using the Python model. These are problems that I’ve used for a few years now as practice after introducing the full set of constant acceleration equations, and I’ve admittedly grown a bit bored of them.Seeing how the students were attacking them using the model as a guide was a way for me to see them in a whole new light – amazingly focused questions and questions about the relationship between the linear equation for velocity (the only equation we directly discussed after Day 1), the table of velocity data, and what was happening in position vs. time.

One student kept saying she had an answer for problem c based on equations, but that she couldn’t match the Python model to the problem. In previous classes where I had given that problem, getting the answer was the end of the story, but to see her struggling to match her answer to what was happening in her model was beautiful. I initially couldn’t do it myself either until I really thought about what was happening, and she almost scooped me on figuring it out. This was awesome.

They worked on these problems for homework and during the beginning of the next class. Again, some really great comments and questions came from students that were previously quiet during class discussions. Today we had a learning standard quiz on constant acceleration model questions, and then decided last night during planning was to go on to just extending the constant acceleration model to objects in free fall.

Then I realized I was falling back into old patterns just telling them that all objects in free fall near Earth’s surface accelerate downward at roughly 9.81 m/s^2. Why not give them another model to play with and figure this out? Here’s what I put together in Python.

The big plus to doing it this way was that students could decide whether air resistance was a factor or not. The first graph I showed them was the one at right – I asked whether they thought it could represent the position versus time graph for an object with constant acceleration. There was some inconsistency in their thinking, but they quickly decided as a group after discussing the graph that it wasn’t. I gave them marble launchers, one with a ping-pong ball, and another with a marble, and asked them to model the launch of their projectiles with the simulation. They decided what they wanted to measure and got right to it. I’m also having them solve some free fall problems using the gravity simulation first without directly telling them that acceleration is constant and equal to g. They already decided that they would probably turn off air resistance for these problems – this instead of telling them that we always do, even though air resistance is such a real phenomenon to manage in the real world.

A bit of justification here – why am I being so reliant on the computer and simulation rather than hands on lab work? Why not have them get out with stopwatches, rulers, Tracker, ultrasonic detectors, air tracks, etc?

The main reason is that I have yet to figure out how to get data that is reliable enough that the students can see what they have learned to look for in position and velocity data. I spent an hour working to get a cart on an inclined air track to generate reasonable data for students to use in the incline lab in the modeling materials from AMTA on constant acceleration, and gave up after realizing that the students would lose track of the overall goal while struggling to get the mere 1 – 2 seconds of data that my 1.5 meter long air track can provide. The lab in which one student runs and other students stand in a line stopping their stopwatches when the runner passes doesn’t work when you have a small class as I do. The discussions that ensue in these situations can be good, but I have always wished that we had more data to have a richer investigation into what the numbers really represent. The best part of lab work is not taking data. It’s not making repetitive calculations. Instead, it’s focusing on learning what the data tells you about the situation being measured or modeled. This is the point of spending so much time staring and playing with sets of data in physics.

I also find that continuing to show students that I can create a virtual laboratory using several simple lines of code demonstrates the power of models. I could very easily (and plan to) also introduce some random error so the data isn’t quite so smooth, but that’s something to do when we’ve already understood some of the fundamental issues. We dealt with this during the constant velocity model unit, but when things are a bit messier (and with straight lines not telling the whole picture) when acceleration comes into play, I’m perfectly comfortable with smooth data to start. Until I can generate data as masterfully as Kelly does here using my own equipment, I’m comfortable with the computer creating it, especially since they can do so at home when they think nobody is looking.

Most of all, I find I am excited myself to put together these models and play with the data to model what I see. Having answered the same kinematics questions many times myself, being able to look at them in a new way is awesome. Finding opportunities for students to figure out instead of parrot responses after learning lists of correct answers is the best part of teaching, and if simulations are the way to do this, I’m all for it. In the future, my hope is to have them do the programming, but for now I’m happy with how this experiment has unfolded thus far.

Simulations, Models, and the 2012 US Election

After the elections last night, I found I was looking back at Nate Silver’s blog at the New York Times, Five Thirty Eight.

Here was his predicted electoral college map:

Image

…and here was what ended up happening (from CNN.com):

Image

I’ve spent some time reading through Nate Silver’s methodology throughout the election season. It’s detailed enough to get a good idea of how far he and his team  have gone to construct a good model for simulating the election results. There is plenty of description of how he has used available information to construct the models used to predict election results, and last night was an incredible validation of his model. His popular vote percentage for Romney was predicted to be 48.4%, with the actual at 48.3 %. Considering all of the variables associated with human emotion, the complex factors involved in individuals making their decisions on how to vote, the fact that the Five Thirty Eight model worked so well is a testament to what a really good model can do with large amounts of data.

My fear is that the post-election analysis of such a tool over emphasizes the hand-waving and black box nature of what simulation can do. I see this as a real opportunity for us to pick up real world analyses like these, share them with students, and use it as an opportunity to get them involved in understanding what goes into a good model. How is it constructed? How does it accommodate new information? There is a lot of really smart thinking that went into this, but it isn’t necessarily beyond our students to at a minimum understand aspects of it. At its best, this is a chance to model something that is truly complex and see how good such a model can be.

I see this as another piece of evidence that computational thinking is a necessary skill for students to learn today. Seeing how to create a computational model of something in the real world, or minimally seeing it as an comprehensible process, gives them the power to understand how to ask and answer their own questions about the world. This is really interesting mathematics, and is just about the least contrived real world problem out there. It screams out to us to use it to get our students excited about what is possible with the tools we give them.

Automating conference scheduling using Python

I’ve always been interested in the process of matching large sets of data to a set of constraints – apparently the Nobel committee agreed this past week in awarding the economics prize. The person in charge of programming at my school in the Bronx managed to create an algorithm that generated a potential schedule for over four thousand students given student requests and needs. There was always some tweaking that needed to be done at the end to make it work, but the fact that the computer was able to start the process always amazed me. How do you teach a computer to do this sort of matching in an efficient way?

This has application within my classroom as well – generating groups based on ability, conflicting personalities, location – all complex situations that required time and attention to do correctly. In the end though, this is the same problem as arranging the schedules. It’s easy to start with a random arrangement and then make adjustments based on experience. There has to be a way to do this in an automated way that teaches the computer which placements work or do not. Andy Rundquist does this using genetic algorithms – I must know more about how he does it, as this is another approach to this type of problem.

This became a more tangible challenge for me to attempt to solve last year when I saw that the head of school was doing the two days of parent-teacher conference scheduling by hand. This is a complex process given the following constraints he was working to fulfill:

  • Parent preferences for morning/afternoon conference times.
  • Consecutive conference times for parents that had siblings so that the amount of time parents had to wait around was minimized.
  • Balanced schedules between the two days for all teachers.
  • Teachers with children had breaks in their schedule to attend conferences of their children.

This was apparently a process of 4 – 5 hours that sometimes required starting over because he discovered that the schedule he had started putting together was over constrained and could not meet all requirements. During this process, however, he had figured out an algorithm for what was most likely to work. Schedule the families with the largest number of children first, and work down the list in order of decreasing size. Based on the distribution of younger vs. older children in the school, start by scheduling the youngest children in a family first, and move to the older ones. Save all families with single children for last.

Hearing him talk about this process was interesting and heartbreaking at the same time – he works incredibly hard on all aspects of his job, and I wanted to provide some way to reduce the requirements of at least this task on his schedule. I was also looking for a reason to really learn Python, so this challenge became my personal exercise in problem based learning.

It took a while to figure out all of the details, but I broke it down into stages. How do you input the family data based on how it is already stored by the front office? (I didn’t want to ask the hard-working office staff to reformat the data to make it easier for me – this was supposed to make things easier on everyone.) How do you create a structure for storing this data in Python? How do you implement the algorithm that the head of school used and balance it with the idea of fairness and balance to all families and teachers?

Over the following few months, I was able to piece it together. It was, needless to say, a really interesting exercise. I learned how to ask the right questions that focused on the big picture needs of the administration, so that I could wrestle with the details of how to make it happen. The students learned that I was doing this (“Mr. Weinberg is using his robots to schedule conferences!”) and a few wanted to know how it worked. I have posted the code here as a gist.

I put in more than the 4-5 hours required to do this by hand. It was a learning experience for me. It also paid serious dividends when we needed to schedule conferences again for this year. We wanted to change the schedule slightly to be one full day rather than two half days, and it was a simple task adjusting the program to do this. We wanted to change the times of conferences so that the lower and upper schools had different amounts of time for each, rather than being a uniform twenty minutes each. (This I was not able to figure out before we needed conferences to go out, but I see a simple way to do it now.)

The big question that administration was about the upper school conferences. Last year we had seven different rooms for simultaneous conferences, and the question was whether we could reduce the number to five. I ran the program with five rooms a number of different times, and it was unable to find a working schedule, even with different arrangements and constraints. It was able to find one that worked with six rooms though, which frees administrators from needing to be in individual conference rooms so that they can address issues that come up during the day. Answering that question would not have been possible if scheduling was done by hand.

The question of using computers to automate processes that are repetitive has been in my head all this year. I’ve come to recognize when I am doing something along these lines, and try to immediately switch into creating a tool in Python to do this automatically. On the plane during a class trip last week, we needed to arrange students into hotel rooms, so I wrote a program to do this. I used it this week to also arrange my Algebra 2 students in groups for class. Generating practice questions for students to use as reassessment? I always find myself scrambling to make questions and write them out by hand, but my quiz generator has been working really well for doing this. Yesterday I had my first day of generating quizzes based on individual student needs.

The students get a kick out of hearing me say that I wrote a Python program to do XXX or YYY, and their reactions certainly are worth the effort. I think it just makes sense to use programming solutions when they allow me to focus on more important things. I have even had some success with getting individual students to want to learn to do this themselves, but I’ll write more about that later.

1 5 6 7 8