Gas station without pumps

2013 April 23

Chapter 22 homework

We finally finished off Chapter 21 of Matter and Interactions today, about 2 months behind my original schedule, having been repeatedly distracted.  We never did get around to measuring the magnetic field of a coil as a function of distance or current, either, though we’ll probably get back to trying that after the AP exams.

It looks like there is a chance my son will get to take the AP CS and AP Physics C: E&M exams this year, even though my first 5 attempts to find a place for him to take them failed. He needs to take the late exam for AP CS, since it conflicts with the Oregon Shakespeare Festival field trip and no one in the County offers Physics C—my attempts to get one of the high schools to offer the exam (which is at the same time as Physics B) all failed.  His consultant teacher is trying to arrange to be the proctor for him on the late AP CS and the late Physics C: E&M exams (it is now too late to register for the regular exams) through another high school in the same district.  I’m hopeful that she’ll be more successful in moving the bureaucracy than I was as an outsider.

Of course, he’ll probably never get any credit for taking the exams, since many of the schools he is applying to don’t do AP credit anyway, and he’ll have to retake physics at any of the schools he’s likely to choose.  But the exams will help validate that he has done rigorous work in physics, which should help him get into the colleges that would be a good fit for him. The AP CS exam is so low level that all it validates is that one has learned some Java syntax—but it might help with admissions offices also, as most will not be familiar with the new Art of Problem-Solving Java course.

In any case, we have to speed up a bit on the physics, despite the distractions, so here are the problems for Chapter 22 “Patterns of Fields in Space”: 22P15, 22p16, 22p18, 22P22, 22P23, 22P25, 22P29, 22P31, 22P33, 22P37.

2013 March 21

Why Python first?

Filed under: home school,Uncategorized — gasstationwithoutpumps @ 11:21
Tags: , , , , , , ,

On one of the mailing lists I subscribe to, I advocated for teaching Python after Scratch to kids (as I’ve done on this blog: Computer languages for kids), and one parent wanted to know why, and whether they should have used Python rather than Java in the home-school course they were teaching.  Here is my off-the-cuff reply:

Python has many advantages over Java as a first text-based language, but it is hard for me to articulate precisely which differences are the important ones.

One big difference is that Python does not require any declaration of variables. Objects are strongly typed, but names can be attached to any type of object—there is no static typing of variables. Python follows the Smalltalk tradition of “duck typing” (“If it walks like a duck and quacks like a duck, then it is a duck”). That means that operations and functions can be performed on any object that supports the necessary calls—there is no need for a complex class inheritance hierarchy.

Java has a lot of machinery that is really only useful in very large projects (where it may be essential), and this machinery interferes with the initial learning of programming concepts.

Python provides machinery that is particularly useful in small, rapid prototyping projects, which is much closer to the sorts of programming that beginners should start with. Python is in several ways much cleaner than Java (no distinction between primitive types and objects, for example), but there is a price to pay—Python can’t do much compile time optimization or error checking, because the types of objects are not known until the statements are executed. There is no enforcement of information hiding, just programmer conventions, so partitioning a large project into independent modules written by different programmers is more difficult to achieve than in statically typed languages with specified interfaces like Java.

As an example of the support for rapid prototyping, I find the “yield” statement in Python, which permits the easy creation of generator functions, a particularly useful feature for separating input parsing from processing, without having to load everything into memory at once, as is usually taught in early Java courses. Callbacks in Java are far more complicated to program.

Here is a simple example of breaking a file into space-separated words and putting the words into a hash table that counts how often they appear, then prints a list of words sorted by decreasing counts:

def readword(file_object):
    '''This generator yields one word at a time from a file-like object, using the white-space separation defined by split() to define the words.
    '''
    for line in file_object:
        words=line.strip().split()
        for word in words:
             yield word

import sys
count = dict()
for word in readword(sys.stdin):
     count[word] = count.get(word,0) +1
word_list = sorted(count.keys(), key=lambda w:count[w], reverse=True)
for word in word_list:
    print( "{:5d} {}".format(count[word], word) )

Note: there is a slightly better way using Counter instead of dict, and there are slightly more efficient ways to do the sorting—this example was chosen for minimal explanation, not because it was the most Pythonic way to write the code. Note: I typed this directly into the e-mail without testing it, but I then cut-and-pasted it into a file—it seems to work correctly, though I might prefer it if if the sort function used count and then alphabetic ordering to break ties. That can be done with one change:

word_list = sorted(count.keys(), key=lambda w:(-count[w],w))

Doing the same task in Java is certainly possible, but requires more setup, and changing the sort key is probably more effort.

Caveat: my main programming languages are Python and C++ so my knowledge of Java is a bit limited.

Bottom-line: I recommend starting kids with Scratch, then moving to Python when Scratch gets too limiting, and moving to Java only once they need to transition to an environment that requires Java (university courses that assume it, large multi-programmer projects, job, … ). It might be better for a student to learn C before picking up Java, as the need for compile-time type checking is more obvious in C, which is very close to the machine. Most of the objects-first approach to teaching programming can be better taught in Python than in either C or Java. For that matter, it might be better to include a radically different language (like Scheme) before teaching Java.

The approach I used with my son was more haphazard, and he started with various Logo and Lego languages, added Scratch and C before Scheme and then Python.  He’s been programming for about 6 years now, and has only picked up Java this year, through the Art of Problem Solving Java course, which is the only Java-after-Python course I could find for him—most Java courses would have been far too slow-paced for him.  It was still a bit low-level for him, but he found ways to challenge himself by stretching the assigned problems into more complicated ones.  His recreational programming is mostly in Python, but he does some JavaScript for web pages, and he has done a little C++ for Arduino programming (mostly the interrupt routines for the Data Logger code he wrote for me).  I think that his next steps should be more CS theory (he’s just finished an Applied Discrete Math course, and the AoPS programming course covers the basics of data structures, so he’s ready for some serious algorithm analysis), computer architecture (he’s started learning about interrupts on the Arduino, but has not had assembly language yet), and parallel programming (he’s done a little multi-threaded programming with queues for communication for the Data Logger, but has not had much parallel processing theory—Python relies pretty heavily on the global interpreter lock to avoid a lot of race conditions).

2013 February 12

Battery internal resistance lab and Chapter 21 homework

Filed under: home school — gasstationwithoutpumps @ 17:49
Tags: , , ,

In our home-school physics class today, my son and I did two things: comparing answers on homework questions and a lab measuring the internal resistance of a battery.  I only had time to read Chapter 20 of  Matter and Interactions this morning, and only finished about half the problems.  I’ll have to finish them and compare answers with my son later. He’s already finished—he found these problems as easy as the ones in Chapter 19, but much more fun.  I suspect that Chapter 19 is one of those things that only a physicist can love—those of us who have more of an engineering mindset just find it tedious make-work.

The internal resistance of the battery was a simple experiment: we put known resistors across the battery pack and measured the resulting voltage.

The top circuit shows the setup we used—the bottom shows the equivalent circuit we were modeling.

The top circuit shows the setup we used—the bottom shows the equivalent circuit we were modeling.

I also measured the short-circuit current (briefly) with an ammeter.

The data was much noisier than I had expected, probably because the “switch” just pushed one battery away from contact, and the contact resistance between the battery holder and the batteries varied. We tried cleaning the contacts on the battery holder and on the batteries, but the noisy data were after that cleaning.  The noise is probably not due to self-heating of the resistors, as it was highest for the larger resistors.

The load line using the open-circuit voltage and short-circuit current look reasonable, but many of the measured voltages corresponded to a lower current, and fitting just the data points that exclude the short-circuit current does not produce a reasonable load line, though the estimated internal resistance is not too far off.

The load line using the open-circuit voltage and short-circuit current look reasonable, but many of the measured voltages corresponded to a lower current, and fitting just the data points that exclude the short-circuit current does not produce a reasonable load line, though the estimated internal resistance is not too far off.

The battery-measurement lab took longer than I expected, because the data wasn’t as clean as I expected.  It might be worth trying again with a different battery holder, and a better switch, to see if the problems were just with the crummy contacts on the battery holder.  Variations of 0.5Ω in the resistance of the contacts would throw the measurements off by this much.

Chapter 21 of Matter and Interactions appears to be about magnetic force (though we don’t get to inductors until Chapter 23).  I find magnetism much more confusing than electricity, so I suspect we won’t be as quick with Chapters 21–23 as we were with Chapter 20. Problems for Chapter 21:  21P38, 21P39, 21P40, 21P44, 21P50, 21P60, 21P61, 21P66, 21P69, 21P71, 21P72, 21P79, 21P80, 21P90, 21P103, 21P105 (computational).

2012 November 24

Home school students at Baylor

Filed under: home school,Uncategorized — gasstationwithoutpumps @ 13:07
Tags: , , ,

A couple of years ago, Baylor University released a report on home school students at Baylor and how well they performed (Profile of First-Time Freshmen from Home Schools, Fall 2005 to Fall 2009). Some home-schoolers point to this report as evidence for how good home schooling is, because of statements in it like

Home school students took a slightly higher credit hour load during their first semester compared to the entire first-time freshmen population. The home school group also had a higher cumulative GPA at the end of their first year.

Of course, the report is useless for saying much about home schooling, since it only looks at how well the students admitted to Baylor did.  But to get into Baylor, home schoolers have to have very high test scores (according to the report, 61.3% of the home school students who enrolled at Baylor had SAT reading+math ≥1300, while only 25.3% of the overall freshman classes did).  Because the report does not match the home school admittees to a population with a similar distribution of SAT scores, any conclusions about how well the home school students perform are meaningless.  It would have been interesting to see whether there was a difference in performance, retention, levels of depression, … between home schoolers and regularly schooled students, but only after first controlling for differences in admissions policies and practices (for example, by matching SAT scores, gender, and income levels).

What one can reasonably conclude is that to get into Baylor as a home school student took exceptionally high test scores (only 6.4% of home school students who enrolled had SAT scores less than 1100, while 21.7% of the overall class did). The median SAT score for home schoolers  who enrolled was 1325, while for the class as a whole it was 1200.  The entire distribution for home schoolers is shifted up about 120 points from the distribution for the whole class.  This difference may reflect the greater reliance on test scores rather than GPA for home school applicants, as calibration for home school GPA is difficult.

The difference is not proof of discrimination against home school students, of course, as we have no idea what the pool of home school students looked like (for all we know, Baylor may have accepted all that applied), but it is suggestive of a higher threshold for home school students.

What is most disturbing to me is that the Office of Institutional Research and Test at Baylor thought that this profile supported their conclusions about differences in performance related to home schooling—I would expect better controls from a collegiate study, even one done by staff rather than faculty.

2012 November 9

Guiding gifted kids in selecting career paths

Filed under: home school — gasstationwithoutpumps @ 16:33
Tags: , , ,

I read Laura Vanderkam’s blog post, What to do if your kid wants to be an artist, about the difficulty of guiding gifted kids.  When kids have talents that could lead them to success in fields where success is very unlikely, how much do you encourage them?  The problem is not unique to gifted kids, of course.  Lots of parents see their kids as being particularly good at something (often sports or music) and wonder how much to encourage their child to pursue a career in the field, versus encouraging them to find a day job and pursue their talent recreationally.

For a kid with multiple talents, the parent’s job is even harder.  Which talents to do you support whole-heartedly, which do you encourage subtly, which do you subtly discourage?  (I’m assuming that there are no talents displayed that you want to forbid, though I could see that happening if a child showed talent for illegal or immoral activities.)

My son and I have discussed some (though not all) of his talents and interests.  The two that come up most often are his talent in computer science and in acting.  I’ve encouraged both, but favored the professional computer scientist/recreational actor combination, for purely practical reasons, as there are relatively few full-time actors supporting themselves purely by acting.  Since his interest is mainly in stage acting rather than movies, there is a lot more opportunity for amateur (unpaid) acting than professional.  He certainly has a love of acting, he’s maintained that interest for a long time (at least 11 years now), and he’s gotten pretty good at it.  But I don’t know that he has the singleness of purpose that would be needed for a professional actor.  Given free choice of nonfiction reading material, he’s more likely to read something about physics or computer science or linguistics than about acting or the theater.  He does not read scripts for pleasure or to analyze them, but just to learn his lines.  His knowledge of plays is pretty much limited to ones he has seen or acted in.

His computer science interest has appeared much deeper: in addition to programming classes and programming for fun, he also does a lot of reading about language features and computer science concepts.  He knows more about Python that I do, and has even explored modifying the Python byte code string produced by the compiler to do some tricky decorators. He’s also designed a few “esolangs“, esoteric computer languages whose main intent is to amuse computer scientists by their bizzareness.

Undoubtedly, when he goes off to college in a year and a half he will discover many other things to be interested in, and his interests may shift in unexpected directions.  But computer science is a good base to move to other subjects from, so I’m comfortable with advising him to start there as a good fit to his current interests, and use electives to explore other things that might interest him.

I think that he’ll be in a good position to make reasonable decisions while he’s in college, because home-schooling high school has been more like college than high school in many ways.  He has relatively few class hours a week (2 hours for Java, 3.5 for math, 2 for US history, 1.5 for writing, 1-2 for physics, 4 for theater, 1.5 for being a TA in a Python class), with most of his learning happening between classes.  His classes are scattered (4 different locations, with 4.6 miles between the most distant pair), and he sees different people in each class (except that his 2 theater classes overlap considerably in participants).

He is on his own for most of the day and has to manage his own schedule and transportation; there are no bells to signal class changes and synchronize students.  His courses are each taught in a different style, with some being almost pure group work (theater), some being almost entirely individual (Java), and others being a mix.  None of the classes is large (which is different from both high school and college experience for most students).  If he wants clean clothes, he has to do his own laundry, but food is provided for him without effort on his part (like being on a dorm meal plan, except that the cook is well aware of his idiosyncratic food preferences). Some aspects of college life will come as a bit of shock to him (like sharing a room), but the differences between what he now does and what he’ll do in college is less than for many students.

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 151 other followers

%d bloggers like this: