Skip to main content

C'est la Z

Tag: pedagogy

Hidden Complexity

I've said it many times: Never use a tool you couldn't write yourself. That is - make sure you understand what's going on under the hood. In AP we've been playing with ArrayLists. The problem for today? Create an ArrayList with consecutive integers and then write a routine that will randomize the ArrayList. For example, you might start with this ArrayList: 0,1,2,3,4,5 and end up with 3,5,1,4,2,0 First cut, the students grabbed a random element from the ArrayList, removed it, and added it to the end of a new list.
# COMMENTS

Forty minutes to the punch line or "we'll never look at functions the same way again"

How many times do we teach something and leave the kids thinking: "what's the point of this?" "When will I use this?" or even just the plain old fashioned "that's weird." It's pretty cool when a lesson starts out that way but you get to the payoff by the end of the class. Today we started exploring some advanced python. We started by showing that you can assign functions to variables or pass them as parameters: def inc(x): return x+1 def dec(x): return x-1 f = inc print f(5) flist = [inc,dec] print flist[1](5) We then looked at closures in python: def makeAdder(n): def inner(x): return x+n return inner add3 = makeAdder(3) add5 = makeAdder(5) print add3(10) print add5(10) The idea that we can make a function that builds and returns a function.
# COMMENTS

Wait, I know that!!!!

If I'm doing my job right, by the time my kids graduate they can learn on their own. It's like when two years ago, before starting her summer internship, Batya listed all the tools and technologies she had to work with. When I pointed out that she hadn't ever used any of them before and asked how she was going to deal with it, she replied "I'll figure it out.
# COMMENTS

Building a SHIP - Outreach

We've got a few more topics to cover in the Building a SHIP series. We still have to cover: The Crew Curricular Choices The long term plan Site and funding But for today, we'll talk outreach. Outreach proved to be particular challenge for SHIP. Our entire crew is made up of teachers. That meant that we couldn't communicate with schools during business hours. That made things particularly tough. I could send emails after hours or set up emails to be sent at specific times during the day, but we couldn't call while at our day jobs.
# COMMENTS

Twitch Coding

We have the kids write programs in all sorts of ways on paper solo informally in pairs "pair programming" We have them trade code, pick up each others projects, and more. We do lots of different things to engage the kids in a lot of different ways and I love it when someone comes up with a new technique. My friend, colleague, and incidentally, former student, Sam had such an idea the other day.
# COMMENTS

Sorting - Subtle Errors

Time to wrap up sorting for a while. We just finished quicksort having gone through a series of lessons We started with Quickselect. Then we did a quicksort, copying to new arrays during the partition Then finally to an in place quicksort. For the final quicksort we used a partition algorithm pretty much the same as the one described here. We started testing using by building a randomly filled array like this: Random rnd = new Random(); int a[] = new int[n]; for (int i=0;i<n;i++) { a[i] = rnd.
# COMMENTS

From selection to sorting

When I first saw the quicksort it was in an algorithms class back in the day. We first learned the quicksort, then choosing a good pivot element and then as an afterthought we did quickselect. Fast forward to teaching. I was never really happy teaching quicksort. Mergesort is easy to motivate and it's pretty easy to write. Quicksort always felt a little forced. I thought I'd try switching things up this time and doing quickselect first.
# COMMENTS

Be the ball

Crystal Furman wrote a nice post titled Coding Comprehension about a week ago. There was a little buzz about it in the APCS Facebook group and shortly after, Alfred Thompson added his two cents. I thought I'd add mine, at least a couple of thoughts. There are a lot of issues - long term retention, transfer of knowledge from the basics to more advanced tools, pattern recognition, and more.
# COMMENTS

I guess I'm a dumbass

I like a fairly informal atmosphere in my classes. Students have to know that there’s a line between teacher and student but I also want them to feel like we’re all part of the Stuy CS family. Whenever we start a new term, it takes a while to break down the walls. The students don’t know what to expect of me, can they trust me? Am I a bozo? Who knows.
# COMMENTS

Change the data

Patient: “Doctor, it hurts when I do this.” Doctor: “So, don’t do that.” We’ve been spending time on State Space Search. It’s a great topic. We deal with or at least introduce: Recursion Blind search Heuristic search foreshadowing things like A* and Dijkstra’s algorithm. and more. Today, however. I want to talk about something else. We started by developing a maze solver. It reads a text file representing the maze and then proceeds to find an exit.
# COMMENTS